How to use this calculator
Maximize feasible source-to-sink flow subject to directed edge capacities and intermediate flow conservation.
- Enter Node count, Directed edges as from to nonnegative capacity, Source node, Sink node. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Network maximum flow and minimum cut explained
A four-node directed network illustrates both the maximum feasible flow and its matching minimum cut.
A numerical walkthrough
Node count = 4; Directed edges as from to nonnegative capacity = 1 2 3, 1 3 2, 2 3 1, 2 4 2, 3 4 3; Source node = 1; Sink node = 4.
- Maximum source-to-sink flow: 5 capacity units
- Minimum cut capacity: 5 capacity units
- Source-side cut nodes: 1
The source has 5 capacity units leaving it and the sink has 5 entering it. The matching 5-unit flow and cut certify that no larger source-to-sink flow is possible for this example.
The model behind the numbers
Edmonds–Karp residual augmenting paths
Maintain residual capacities, including reverse capacity that can undo earlier flow. Repeated breadth-first augmenting paths increase the source-to-sink total until none remains. Nodes still reachable in the residual graph identify a minimum cut.
What to enter
n— Node count- Number n of nodes labeled 1 through n; source and sink must be different labels in this range.
e— Directed edges as from to nonnegative capacity- List each directed edge as from-node, to-node, capacity. Capacities are nonnegative; parallel edges are added.
s— Source node- Label of the node that supplies flow; it must be in 1…n and differ from the sink.
t— Sink node- Label of the destination node; it must be in 1…n and differ from the source.
Interpreting the result
Single commodity, nonnegative capacities, no lower bounds or flow costs; parallel edge capacities are added.
Frequently asked questions
Does reverse residual flow mean a reverse physical edge?
No, it can cancel previously assigned flow.
What does the cut show?
A partition whose forward capacity equals the maximum flow.
Are node capacities supported?
Not directly; transform them into edge capacities first.
How do I use the Network maximum flow and minimum cut calculator?
Enter Node count, Directed edges as from to nonnegative capacity, Source node, Sink node. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Network maximum flow and minimum cut?
Node count = 4; Directed edges as from to nonnegative capacity = 1 2 3, 1 3 2, 2 3 1, 2 4 2, 3 4 3; Source node = 1; Sink node = 4. Maximum source-to-sink flow: 5 capacity units Minimum cut capacity: 5 capacity units Source-side cut nodes: 1 The source has 5 capacity units leaving it and the sink has 5 entering it. The matching 5-unit flow and cut certify that no larger source-to-sink flow is possible for this example.
Method reference: NetworkX graph algorithm definitions.
Read our calculation methodology.