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. It is different to calculate all possible nodes pairs in that this function excludes all pairs of nodes not connected by any path.

Parameters :

topology : Topology

The topology should be directed. If not, this function will convert the graph to a directed one and calculate pairs on this graph.

Returns :

od_pair : list

List containing all origin destination tuples. Value of the maximum flow, i.e., net outflow from the source.

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)]