This documents the development version of NetworkX. Documentation for the current release can be found here.
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.
- GNetworkX graph
A node in
True if and only if
nhas no neighbors.
>>> G = nx.Graph() >>> G.add_edge(1, 2) >>> G.add_node(3) >>> nx.is_isolate(G, 2) False >>> nx.is_isolate(G, 3) True