Previous topic

fnss.topologies.topology.fan_in_out_capacities

Next topic

fnss.topologies.topology.read_topology

fnss.topologies.topology.od_pairs_from_topology

od_pairs_from_topology(topology)[source]

Calculate all possible origin-destination pairs of graph topology. This function does not simply calculate all possible pairs of 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)]