Maximum Flow Calculator

Compute max flow for directed capacity networks using the Edmonds–Karp algorithm. Enter your nodes and edges, then calculate instantly.

Calculator

Use integer or decimal capacities. Nodes are 0-indexed. Parallel edges are allowed (their capacities are summed).

Maximum Flow Calculator Guide: Concepts, Algorithms, and Practical Uses

A maximum flow calculator helps you solve one of the most important optimization problems in graph theory: finding the greatest possible flow from a source node to a sink node while respecting edge capacities. This problem appears in logistics, telecommunications, traffic engineering, scheduling, computer vision, supply chains, and many other domains where constrained movement through a network matters.

What Is Maximum Flow?

The maximum flow problem starts with a directed graph where each edge has a capacity. Capacity is the maximum amount that can move through that edge. You select one node as the source (where flow starts) and another as the sink (where flow ends). The goal is to assign flow values to edges such that:

The final value is called the maximum flow. A maximum flow calculator automates this process and is especially useful when your network has many nodes and complex paths.

Flow Network Terminology

To use a max flow tool effectively, it helps to know the key vocabulary:

How This Maximum Flow Calculator Works

This calculator uses a simple and practical input format:

When you click calculate, the tool parses your graph, merges parallel edges by summing capacities, and runs Edmonds–Karp. The result panel returns:

Edmonds–Karp Algorithm Overview

Edmonds–Karp is a classical implementation of the Ford–Fulkerson framework. Instead of picking arbitrary augmenting paths, it always selects the shortest path in terms of number of edges using BFS. This choice guarantees polynomial runtime and stable behavior in practice.

Step What Happens
1 Initialize all flows to zero.
2 Build residual capacities from current flow.
3 Use BFS to find an augmenting path from source to sink.
4 Find bottleneck capacity (minimum residual edge on that path).
5 Increase flow along forward edges and reduce via reverse edges.
6 Repeat until no augmenting path exists.

Because BFS is used each iteration, Edmonds–Karp runs in O(VE²) time, where V is number of nodes and E is number of edges.

Max-Flow Min-Cut Theorem

One of the most powerful results in combinatorial optimization is the max-flow min-cut theorem: the value of maximum flow equals the capacity of a minimum s-t cut. A cut partitions nodes into two sets, with source in one set and sink in the other. The cut capacity is the sum of capacities on edges crossing from source-side to sink-side.

After computing maximum flow, this calculator inspects the residual graph to identify nodes still reachable from the source. Edges crossing from reachable to non-reachable nodes form a minimum cut. This gives not just the optimal throughput but also the bottlenecks that limit it.

Real-World Applications of Maximum Flow

Best Practices for Modeling with a Maximum Flow Calculator

If your network includes lower bounds, costs, or multiple commodities, you may need advanced formulations such as minimum-cost flow, circulation with demands, or multicommodity flow models.

FAQ: Maximum Flow Calculator

Does this tool support decimal capacities?
Yes. Decimal values are accepted and processed numerically.

What if my graph has parallel edges?
Parallel edges between the same ordered pair are combined by summing capacities.

Can I use undirected graphs?
Represent each undirected edge as two directed edges with appropriate capacities.

What does it mean if max flow is zero?
There is no positive-capacity path from source to sink in the residual perspective of the initial graph.