NetworkX

Previous topic

networkx.LabeledGraph.number_of_edges

Next topic

networkx.LabeledGraph.degree

Quick search

networkx.LabeledGraph.number_of_selfloops

LabeledGraph.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