NetworkX

Previous topic

networkx.Graph.has_neighbor

Next topic

networkx.Graph.selfloop_edges

Quick search

networkx.Graph.nodes_with_selfloops

Graph.nodes_with_selfloops()

Return a list of nodes with self loops.

Examples

>>> G=nx.Graph()
>>> G.add_edge(1,1)
>>> G.add_edge(1,2)
>>> G.nodes_with_selfloops()
[1]