fnss.topologies.topology.od_pairs_from_topology — FNSS 0.5.0 documentation

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.5.0 documentation »
- API Reference »
- Functions »

# fnss.topologies.topology.od_pairs_from_topology

`od_pairs_from_topology`(topology)

  Calculate all possible origin-destination pairs of the topology. This function does not simply calculate all possible pairs of the topology nodes. Instead, it only returns pairs of nodes connected by at least a path.

  Parameters : | topology : Topology or DirectedTopology The topology whose OD pairs are calculated
  Returns : | od_pair : list List containing all origin destination tuples.

  Examples

      >>> import fnss
      >>> topology = fnss.ring_topology(3)
      >>> fnss.od_pairs_from_topology(topology)
      [(0, 1), (0, 2), (1, 0), (1, 2), (2, 0), (2, 1)]

### Navigation

- index
- modules |
- modules |
- next |
- previous |
- FNSS 0.5.0 documentation »
- API Reference »
- Functions »