Network.flow_on_shortest

Network.flow_on_shortest(demand_triples, weight=None, unique_sources=None, multiprocessing: bool = False, commodity_wise: bool = False)[source]

Find flow on shortest path.

Parameters
weightndarray, optional

Weight to compute predecessor matrix.

demand_tripleslist of tuple

Find flow on shortest path for all commoditiies specified by (source, target, demand).

unique_sourcesndarray, optional

If specified, only compute the paths from the nodes at the given indices.

multiprocessingbool, default=False

Whether to use multiprocessing to compute the shortest path matrices D and Pr.

commodity_wisebool, default=False

Whether to return to return flow on shortest path for each commodity individually, i.e., a matrix F of shape (m, c) is returned where F[:, i] is the flow for commodity at index i. Warning: is considerably slower for a large c.

Returns
ndarray or lil_matrix

Aggregated or commodity wise flow.