networkx.isolates
Enter search terms or a module, class or function name.
Determine of node n is an isolate (degree zero).
G : graph
A networkx graph
n : node
A node in G
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