Advanced Topic 42 of 51 Algorithms
Maximum Flow
Greatest amount of flow pushable through a capacity network.
How it works
The maximum flow problem asks for the largest amount of flow that can be sent from a source to a sink in a network where each edge has a capacity. Ford-Fulkerson repeatedly finds augmenting paths in the residual graph and pushes flow along them; Edmonds-Karp uses BFS for O(VE squared) time, and Dinic's algorithm is faster in practice. The max-flow min-cut theorem says the maximum flow equals the minimum cut capacity.
Step-by-step walkthrough
- Edges have capacities and the source wants to send as much as possible.
- Find an augmenting path with spare capacity: source to A to sink.
- Push flow along it, limited by its smallest edge.
- Residual edges let later paths undo earlier choices.
- When no augmenting path remains the flow equals the min cut.
Where it is used
Network bandwidth planning, airline scheduling, bipartite matching, image segmentation, project selection and supply chain logistics use maximum flow.
Common pitfall
Forgetting reverse edges in the residual graph prevents flow from being rerouted and gives suboptimal results. With irrational capacities or poor path choices, Ford-Fulkerson may not terminate. Multiple sources or sinks need a super source and sink. Store flows and capacities consistently.
Where it fits in the course
Maximum Flow is topic 42 of 51 in Algorithms, rated Advanced. It follows Strongly Connected Components. The next topic is KMP Algorithm.
Practice and explore
- Open the interactive lesson, with a mini quiz.
- Take the Algorithms quiz.
How to study this topic
- Read the explanation above and restate the definition in your own words.
- Open the interactive lesson and answer its mini quiz.
- Read the common pitfall, then write a short example that avoids it.
- Check your understanding in the Algorithms quiz, and revisit the topic if you miss a question.
Frequently asked questions
What is Maximum Flow?
Where do people use Maximum Flow?
What is the most common mistake with Maximum Flow?
What should I learn before this topic?
How can I practice it?
Is Maximum Flow hard to learn?
How long does it take to learn Maximum Flow?
Which topics are related to Maximum Flow?
What should I study after Maximum Flow?
Related topics
- Strongly Connected Components (Algorithms)
- KMP Algorithm (Algorithms)
- Prim's Algorithm (Algorithms)
- Rabin-Karp Algorithm (Algorithms)
- Flow Control (Computer Networks)
- Control Flow Graphs (Languages & Compilers)
- Data-Flow Analysis (Languages & Compilers)