MCPcopy
hub / github.com/networkx/networkx / neighbors

Method neighbors

networkx/algorithms/approximation/kcomponents.py:237–244  ·  view source on GitHub ↗

Returns an iterator over all neighbors of node n in the dense graph.

(self, n)

Source from the content-addressed store, hash-verified

235 }
236
237 def neighbors(self, n):
238 """Returns an iterator over all neighbors of node n in the
239 dense graph.
240 """
241 try:
242 return iter(set(self._adj) - set(self._adj[n]) - {n})
243 except KeyError as err:
244 raise NetworkXError(f"The node {n} is not in the graph.") from err
245
246 class AntiAtlasView(Mapping):
247 """An adjacency inner dict for AntiGraph"""

Callers 15

node_expansionFunction · 0.45
chordal_graph_cliquesFunction · 0.45
random_referenceFunction · 0.45
lattice_referenceFunction · 0.45
find_alternating_4_cycleFunction · 0.45
find_creation_sequenceFunction · 0.45
all_trianglesFunction · 0.45
is_kl_connectedFunction · 0.45
addBlossomFunction · 0.45
max_weight_matchingFunction · 0.45

Calls 1

NetworkXErrorClass · 0.90

Tested by 9

test_neighborsMethod · 0.36
test_union_and_composeFunction · 0.36
densifyMethod · 0.36
test_random_graphsFunction · 0.36
pick_add_edgeMethod · 0.36
pick_remove_edgeMethod · 0.36
verify_coloringFunction · 0.36
test_first_labelFunction · 0.36