NetworkX

Previous topic

networkx.LabeledDiGraph.number_of_edges

Next topic

networkx.LabeledDiGraph.degree

Quick search

networkx.LabeledDiGraph.number_of_selfloops

LabeledDiGraph.number_of_selfloops()

Return the number of selfloop edges (edge from a node to itself).

Examples

>>> G=nx.Graph()
>>> G.add_edge(1,1)
>>> G.add_edge(1,2)
>>> G.number_of_selfloops()
1