LearnViz CompSci
Home / Learn / Algorithms / Maximum Flow

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

  1. Edges have capacities and the source wants to send as much as possible.
  2. Find an augmenting path with spare capacity: source to A to sink.
  3. Push flow along it, limited by its smallest edge.
  4. Residual edges let later paths undo earlier choices.
  5. 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

How to study this topic

  1. Read the explanation above and restate the definition in your own words.
  2. Open the interactive lesson and answer its mini quiz.
  3. Read the common pitfall, then write a short example that avoids it.
  4. Check your understanding in the Algorithms quiz, and revisit the topic if you miss a question.

Frequently asked questions

What is Maximum Flow?
Greatest amount of flow pushable through a capacity network. It belongs to Algorithms and is an advanced-level topic.
Where do people use Maximum Flow?
Network bandwidth planning, airline scheduling, bipartite matching, image segmentation, project selection and supply chain logistics use maximum flow.
What is the most common mistake with Maximum Flow?
Forgetting reverse edges in the residual graph prevents flow from being rerouted and gives suboptimal results.
What should I learn before this topic?
Start with Strongly Connected Components, the topic just before it in Algorithms.
How can I practice it?
Answer the mini quiz in the interactive lesson, then take the Algorithms quiz.
Is Maximum Flow hard to learn?
It is an Advanced topic. Expect to read the explanation more than once and to connect it with earlier topics. Working through a small example by hand helps most.
How long does it take to learn Maximum Flow?
Most learners can read the explanation and finish the interactive lesson in under an hour. Fluency comes from applying the idea, so plan a few short practice sessions with the quiz.
Which topics are related to Maximum Flow?
Strongly Connected Components, KMP Algorithm, Prim's Algorithm are closely connected. The full list is in the related topics section of this page.
What should I study after Maximum Flow?
Continue with KMP Algorithm, the next topic in Algorithms.

Related topics