hiperwalk.Graph.number_of_loops#

Graph.number_of_loops()[source]#

Return the number of loops in the graph.

This method counts and returns the number of loops in the graph. A loop is defined as an edge that connects a vertex to itself.

Returns:
int

The number of loops in the graph.