NetworkX

Previous topic

networkx.MultiDiGraph.has_neighbor

Next topic

networkx.MultiDiGraph.selfloop_edges

Quick search

networkx.MultiDiGraph.nodes_with_selfloops

MultiDiGraph.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]