networks
flow
finds the maximum flow in a network
Calling Sequence
Parameters
Description
Examples
flow(G, s, t)
flow(G, s, t, 'maxflow'=n)
flow(G, s, t, eset, comp)
flow(G, s, t, eset, comp, 'maxflow'=n)
G
-
graph or network
s
source vertex for flow
t
sink vertex for flow
n
non-negative integer, upper bound for flow
eset
name for the set of saturated edges
comp
name for vertices in eset
Important: The networks package has been deprecated. Use the superseding command GraphTheory[MaxFlow] instead.
It returns the maximum flow from s to t in G.
If 'maxflow' option is set then flow of at most n in G is found.
This routine is normally loaded via the command with(networks) but may also be referenced using the full name networks[flow](...).
with⁡networks:
G≔petersen⁡:
flow⁡G,1,2,eset,comp
3
1,2,1,5,1,6,2,3,2,8,3,4,4,7,5,9,6,7,8,9
1,2,4,5,6,7,8,9
eset≔eset:comp≔comp:
flow⁡G,1,5,eset,comp,maxflow=1
1
1,5
See Also
GraphTheory
GraphTheory[MaxFlow]
networks(deprecated)[connectivity]
Download Help Document