Warning

This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.

# networkx.algorithms.isolate.is_isolate¶

is_isolate(G, n)[source]

Determines whether a node is an isolate.

An isolate is a node with no neighbors (that is, with degree zero). For directed graphs, this means no in-neighbors and no out-neighbors.

Parameters: G (NetworkX graph) n (node) – A node in G. is_isolate – True if and only if n has no neighbors. bool

Examples

>>> G=nx.Graph()