This documents an unmaintained version of NetworkX. Please upgrade to a maintained version and see the current NetworkX documentation.
Build a residual network and initialize a zero flow.
The residual network
Rfrom an input graph
Ghas the same nodes as
Ris a DiGraph that contains a pair of edges
(u, v)is not a self-loop, and at least one of
(v, u)exists in
For each edge
R[u][v]['capacity']is equal to the capacity of
Gif it exists in
Gor zero otherwise. If the capacity is infinite,
R[u][v]['capacity']will have a high arbitrary finite value that does not affect the solution of the problem. This value is stored in
R.graph['inf']. For each edge
R[u][v]['flow']represents the flow function of
(u, v)and satisfies
R[u][v]['flow'] == -R[v][u]['flow'].
The flow value, defined as the total flow into
t, the sink, is stored in
cutoffis not specified, reachability to
tusing only edges
(u, v)such that
R[u][v]['flow'] < R[u][v]['capacity']induces a minimum