fnss.topologies.topology.Topology.number_of_selfloops — FNSS 0.1.0 documentation

### Navigation

- index
- modules |
- modules |
- FNSS 0.1.0 documentation »

# fnss.topologies.topology.Topology.number_of_selfloops

`Topology.` `number_of_selfloops`()

  Return the number of selfloop edges.

  A selfloop edge has the same node at both ends.

  Returns : | nloops : int The number of selfloops.

  See also

  `nodes_with_selfloops`, `selfloop_edges`

  Examples

      >>> G=nx.Graph()   # or DiGraph, MultiGraph, MultiDiGraph, etc
      >>> G.add_edge(1,1)
      >>> G.add_edge(1,2)
      >>> G.number_of_selfloops()
      1

### Navigation

- index
- modules |
- modules |
- FNSS 0.1.0 documentation »