Network Flows: Max-Flow Min-Cut Theorem (& Ford-Fulkerson Algorithm)

preview_player
Показать описание
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions

Proofs: Reference "Algorithm Design" by Jon Kleinberg and Éva Tardos Chapters 7.1, 7.2 for excellent proofs on all of this.

Things I'd Improve On This Explanation (w/ More Time):

1.) I should have done a walk-through showing how the residual graph dictates how the original graph's edge flows (f(e)) are updated each iteration. (That would've made it more clear how the residual graph in the Ford-Fulkerson algorithm tells us how to update the flow on each edge (f(e)) in the original graph along the s-t path P, THEN we update the residual graph (also along P) to prepare for the next iteration.)

2.) Go into the actual augmentation once we find an s-t path P in the residual graph. We can only modulate the flow f(e) for each edge in the original graph on path P ± the smallest value residual graph edge on path P. The smallest forward edge on path P in the residual graph is the "bottleneck" to how much we can increase flow along the path P in the original graph. (hard to visualize...the textbook may have to take it away with this one, but when you understand this you'll really get it after watching this video)

I also didn't talk about time complexity, but the amount of while loop iterations is bounded to the capacity coming out of start node 's'. We can't ever push more flow from 's' than the sum of capacities of those exiting edges. If each interaction increases the value of the flow v(f) by 1 (and v(f) starts at 0 in the beginning since no "water" is going through the "pipes"), we can do at most C augmentations of the flow network where C = sum(edge capacities leaving 's').

In each while loop:
- O(|V| + |E|) to find the augmenting path
- O(|E|) to update the flows in the original graph
- O(|E|) to update the residual graph

So total runtime can be bounded to O(C * (|V| + |E|)).

#backtobackswe #benyamephrem
Рекомендации по теме
Комментарии
Автор

> Textbooks could do 10 times of a better job than I could ever do.

Textbooks could stretch out what you described in this video to be 300 pages. This is beautiful and is more than I learned from a week of Algorithms. Thank you!

alexanderson
Автор

Ben your stuff is also helpful for senior devs(like myself). I’ve just landed a job at Amazon SA CPT. Thank you young man. Continue doing what you do.

FirstTimeDad
Автор

You already have achieved the minumum cut..Cause you(source) are clearly trying to maximize the amount of flow of knowledge that can reach us(sink)..
Well done bro..

qRpKsJt
Автор

This 20 min video was more clear than a whole chapter of a book or any other lecture! Thanks for this beautiful explanation :D

tvishathakur
Автор

This was really helpful! I'm studying to be a data engineering and we talk a lot about graphs so your videos really help. You are very clear and explain things in a very visual way which helps a lot. Thank you so much!

dianaayt
Автор

First year Computational Science student here. Thanks a lot for your videos, man. They're really helping me for my Data Structures & Algorithms class

enricomilettogranozio
Автор

There aren't enough good words in the world to describe my gratitude towards you and the videos you make! <3

anastasiagavrilita
Автор

Table of Contents:

Defining The Flow Network 0:00 - 3:35
Greedily Pushing Flow 3:35 - 5:16
Recovering From The Greedy Choice 5:16 - 8:01
The Residual Graph 8:01 - 15:36
Ford-Fulkerson Algorithm (Overview) 15:36 - 17:42
Max-Flow Min-Cut 17:42 - 21:55

BackToBackSWE
Автор

This is literally the best video I've seen for explaining the min-cut problem.

qqww
Автор

This is so helpful! I memorized Ford-Fulkerson algorithm but never got an intuitive understanding until I saw this video. Thanks!

mengengao
Автор

Thank you for explaining why we can traverse backwards edges when finding an augmented path. Most other resources seem to gloss over this when it's the trickiest part of the algo!

SR-tijj
Автор

DUDE. I am still really early on in your videos but just wanted to come to your latest video and say.Your videos are incredible they are such an enormous help. The amount of research and thought you put into each video Is very clear in how well you explain all of the concepts you cover. Thank you very much for all your hard work. I appreciate it and godspeed brother wishing you all the best in your career and studies.

abdi
Автор

Watched like several videos on this topic, and this video by far the most clear and concise.

CrzyAsianGuy
Автор

This is amazing, thank you so much for explaining what the residual graph actually means. I've studied the proof but never understood it fully until now.

boris
Автор

Dude, best explanation ever. I tried looking at 4 different videos, yours is the best.

dariusbuhai
Автор

Great Tutorial man. It saved me the pain of reading a whole paper. Thanks. This is a really good explanation. One can go back and code without much of a problem.

sumitlahiri
Автор

Big Thanks from a novice com-sci student here! I couldn't follow this in class but you explained everything clearly!

alitcher
Автор

THANKS a ton! You're explanation of max-flow min cut was so valuable, better than my course lectures.

gtmashok
Автор

This is actually the best source out there which simplifies and explains properly!

ollieeilon
Автор

The choice of example was perfect. Simple but complex enough to illustrate the need for backflow. Great video for the intuition.

addemfrench