NetworkX

Previous topic

networkx.algorithms.isolate.isolates

Next topic

networkx.algorithms.isolate.isolates

networkx.algorithms.isolate.is_isolate

networkx.algorithms.isolate.is_isolate(G, n)

Determine of node n is an isolate (degree zero).

Parameters :

G : graph

A networkx graph

n : node

A node in G

Returns :

isolate : bool

True if n has no neighbors, False otherwise.

Examples

>>> G=nx.Graph()
>>> G.add_edge(1,2)
>>> G.add_node(3)
>>> nx.is_isolate(G,2)
False
>>> nx.is_isolate(G,3)
True