maxflow
- :
mf =maxflow(G, s, t)¶ - :
mf =maxflow(G, s, t, algorithm)¶ - :
[mf, GF] =maxflow(…)¶ - :
[mf, GF, cs, ct] =maxflow(…)¶ Maximum flow between two nodes of a graph.
G is a
graphordigraphwhose edge weights are treated as capacities. s and t are the source and target node indices (1-based). mf is the maximum flow value.When a second output is requested, GF is a
digraphof the flow on each edge. With four outputs, cs and ct are the node indices of a minimum s–t cut (source and target sides).For a
digraph, algorithm may be"searchtrees"(default),"augmentpath", or"pushrelabel". Undirected graphs accept only the three-argument form.G = digraph ([1 1 2 3], [2 3 4 4], [3 2 3 2]); mf = maxflow (G, 1, 4) ⇒ mf = 4