Тёмный

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

Back To Back SWE
Подписаться 242 тыс.
Просмотров 334 тыс.
50% 1

Free 5-Day Mini-Course: backtobackswe.com
Try Our Full Platform: backtobackswe....
📹 Intuitive Video Explanations
🏃 Run Code As You Learn
💾 Save Progress
❓New Unseen Questions
🔎 Get All Solutions
Flow Networks: en.wikipedia.o...
Ford-Fulkerson Algorithm: en.wikipedia.o...
Max-Flow Min-Cut Theorem: en.wikipedia.o...
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

Опубликовано:

 

4 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 330   
@FirstTimeDad23
@FirstTimeDad23 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
Congrats, happy for you
@alexanderson753
@alexanderson753 3 года назад
> 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!
@qR7pK9sJ2t
@qR7pK9sJ2t 4 года назад
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..
@BackToBackSWE
@BackToBackSWE 4 года назад
well put
@tvishathakur8947
@tvishathakur8947 10 месяцев назад
This 20 min video was more clear than a whole chapter of a book or any other lecture! Thanks for this beautiful explanation :D
@BackToBackSWE
@BackToBackSWE 9 месяцев назад
Happy Holidays 🎉 Thank you for this beautiful comment, tvishathakur! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@qqww1345
@qqww1345 2 года назад
This is literally the best video I've seen for explaining the min-cut problem.
@anastasiagavrilita6567
@anastasiagavrilita6567 4 года назад
There aren't enough good words in the world to describe my gratitude towards you and the videos you make!
@BackToBackSWE
@BackToBackSWE 4 года назад
May the internet grow big and strong
@mengengao7657
@mengengao7657 4 года назад
This is so helpful! I memorized Ford-Fulkerson algorithm but never got an intuitive understanding until I saw this video. Thanks!
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@CrzyAsianGuy
@CrzyAsianGuy 4 года назад
Watched like several videos on this topic, and this video by far the most clear and concise.
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@ollieeilon4061
@ollieeilon4061 Год назад
This is actually the best source out there which simplifies and explains properly!
@gabijaasvydyte595
@gabijaasvydyte595 Год назад
i agree :)
@enricomilettogranozio8817
@enricomilettogranozio8817 3 года назад
First year Computational Science student here. Thanks a lot for your videos, man. They're really helping me for my Data Structures & Algorithms class
@alitcher4425
@alitcher4425 2 года назад
Big Thanks from a novice com-sci student here! I couldn't follow this in class but you explained everything clearly!
@BackToBackSWE
@BackToBackSWE 2 года назад
Happy to help!
@SR-ti6jj
@SR-ti6jj 4 года назад
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!
@BackToBackSWE
@BackToBackSWE 4 года назад
yeah
@iustincondrea2105
@iustincondrea2105 29 дней назад
This made it easier to understand the Ford-Fulkerson Algorithm iterations on a graph.Thanks😁
@nayararossi7513
@nayararossi7513 4 года назад
I'd like to thank you cause I didn't understand anything my professor told us in class, and his slide were also a mistery until I saw your video.
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@orderkare7907
@orderkare7907 4 года назад
Are you also in Asif Salekin's class?
@BackToBackSWE
@BackToBackSWE 4 года назад
@@orderkare7907 ?
@addemfrench
@addemfrench 4 года назад
The choice of example was perfect. Simple but complex enough to illustrate the need for backflow. Great video for the intuition.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@dianaayt
@dianaayt 3 года назад
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!
@riddlediddleriddle
@riddlediddleriddle Год назад
Your ability to transmit information in a clear and complete way is golden.
@BackToBackSWE
@BackToBackSWE Год назад
Thank you 🎉 Please enjoy a special coupon from us - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SUB 🚀
@vicd32
@vicd32 4 года назад
Amazing Explanation! You have some great communication skills for a topic that is definitely not the easiest
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks
@pedro_soares_bhz
@pedro_soares_bhz 11 месяцев назад
Great. It really helps seeing a fellow human being gesticulating and talking and drawing. I never thought about it, but it really helps binding my attention. Thanks, my dude.
@irukandjiShred
@irukandjiShred 5 месяцев назад
God, thank you so much for this video. I was pulling my hair out reviewing some modules before my upcoming final. This clarified things so much!!
@sam-lr4lz
@sam-lr4lz 4 года назад
Found your video literally a day before my exams. Thanks heaps
@BackToBackSWE
@BackToBackSWE 4 года назад
yo
@abdi6141
@abdi6141 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks
@IAmNigHtMaReTR
@IAmNigHtMaReTR 4 года назад
5 mins in and I’m subbed. These videos are true gems. Thank you very much
@BackToBackSWE
@BackToBackSWE 4 года назад
ur a gem
@shawn77160
@shawn77160 9 месяцев назад
god bless you, i was trying to understand an exercices and just by saying it's like water pipe everything was so clear ! i wasn't thinking i can understand so fast with just a trivial comparaison xD But anyway thanks ! you're the best :)
@saneewhy
@saneewhy 9 месяцев назад
perfect. thanks so much.. spent hours watching lectures and this one vid helped me more than all of them combined!!!!
@MrKingoverall
@MrKingoverall 4 года назад
Operations Research student here , thanks Ben !
@BackToBackSWE
@BackToBackSWE 4 года назад
Sure yo
@sumitlahiri209
@sumitlahiri209 4 года назад
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.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@ckc2498
@ckc2498 Год назад
Really love the word "undo". It help me understand what the hell there's an reverse arrows in this algo
@dariusbuhai9074
@dariusbuhai9074 3 года назад
Dude, best explanation ever. I tried looking at 4 different videos, yours is the best.
@kureshimiru
@kureshimiru 3 года назад
Many thanks from graduate students at the Faculty of Electrical Engineering and Computing, Zagreb, Croatia! Amazing video!
@bryanthandamparambil1581
@bryanthandamparambil1581 3 года назад
Thank you for your help, I'm currently studying in year 12 in Australia and this is really helpful, Thank You!!!
@jackkrueckeberg2352
@jackkrueckeberg2352 11 месяцев назад
Thank you so much, you made this so much more understandable than my instructor
@Nika-i6p
@Nika-i6p 5 месяцев назад
Best video on this subject! Thank you!
@DUSHYANTPANCHAL
@DUSHYANTPANCHAL 4 года назад
Really well explained the intuition. Exactly what I was looking for!
@BackToBackSWE
@BackToBackSWE 4 года назад
great.
@priyanshugupta4875
@priyanshugupta4875 Год назад
literally one of the best explainations
@SDKThe8God
@SDKThe8God 4 года назад
Glad I couldn’t find any German videos on this topic, this is great!
@BackToBackSWE
@BackToBackSWE 4 года назад
German videos?
@tljstewart
@tljstewart 2 года назад
"S-T cut, S must be in A and T must be in B" exactly what I was searching for, most memorable. Thanks
@amaefulemercy8974
@amaefulemercy8974 5 месяцев назад
Thank you so much for this video, I've been struggling to understand this for awhile.. Buh now I get it..
@coffee-syrup
@coffee-syrup 10 месяцев назад
Thank you so much, I finally understood what was happening there. I read the book, not only consumes a lot of time but it can be tricky to understand. You helped me finally clearing up any question I had.
@BackToBackSWE
@BackToBackSWE 9 месяцев назад
Happy Holidays 🎉 Thank you for your kind words, Anto-y! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@Arush-eu2xz
@Arush-eu2xz 4 года назад
Hey man, thank you for your interview preparation videos. I have got a very good job offer from a startup in India, and your videos played a substantial role in building up my understanding of concepts during interview preparation. Thank you for explaining things so elegantly!
@BackToBackSWE
@BackToBackSWE 4 года назад
sure, good luck!
@ManishKumar-rz9ub
@ManishKumar-rz9ub 6 месяцев назад
I never understood that back edges concept until i saw this one.
@rio-ty9vr
@rio-ty9vr Год назад
thanks, was so much easier to understand after i watched the video
@BackToBackSWE
@BackToBackSWE Год назад
Thank you, appreciate it 😄 Also check out our Free 5 Day DSA Interview Prep Mini-Course - backtobackswe.com/ 🎉
@shmulimargulies5462
@shmulimargulies5462 3 года назад
someone get this man a medal
@danielescotece7144
@danielescotece7144 4 года назад
Mathematical engineering student here! Thanks man, this is helping me with my OR exam!
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@constantinemacris9047
@constantinemacris9047 5 месяцев назад
Fantastic video. Beautiful work.
@ShashidharG_addString_
@ShashidharG_addString_ 4 года назад
Great job in explaining the reason why the undo operations work!!
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@gtmashok
@gtmashok 3 года назад
THANKS a ton! You're explanation of max-flow min cut was so valuable, better than my course lectures.
@Daniel-iy1ed
@Daniel-iy1ed Год назад
This video was fantastic, I needed a visualization badly. Thank you so much
@caothanhlong7577
@caothanhlong7577 2 года назад
wow, it's so clear and intuitive. Thanks a lot. It helps me to understand more after diving complicated concepts in textbook.
@BackToBackSWE
@BackToBackSWE 2 года назад
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@mahditalebi1770
@mahditalebi1770 4 года назад
great explanation. no stutter.no bullshit. just good solid well explained! thank you
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@mariasandru7
@mariasandru7 5 лет назад
Amazing! My university professor recommended your videos last week in class🤗 Could you also explain when you have time the Bellman Ford algorithm?
@BackToBackSWE
@BackToBackSWE 5 лет назад
Yeah possibly
@PankajKP
@PankajKP 4 года назад
Which UNIVERSITY?
@KaranDoshicool
@KaranDoshicool 4 года назад
@@PankajKP LPU
@brettjenkins1645
@brettjenkins1645 2 года назад
So clear! Thank you! I find the textbook stuff is so bogged down with notation that I have a hard time seeing the intuitions. You made it crystal clear!
@BackToBackSWE
@BackToBackSWE 2 года назад
Glad it was helpful!
@henrynguyen911
@henrynguyen911 4 года назад
my man Ben doing God's work! Thank you so much!
@BackToBackSWE
@BackToBackSWE 4 года назад
hello
@zcjsword
@zcjsword 3 года назад
Your "undo" gives me the epiphany! Thank you!
@summerxia7474
@summerxia7474 Год назад
Please continue to do this series of lectures!!! You are way better than my teacher in college.
@niritcohen7199
@niritcohen7199 7 месяцев назад
Thank you!! You make it so simple. Keep on, it's great!!
@xflory26x
@xflory26x 4 года назад
So glad I found your channel!! Your explanations are so clear :)
@BackToBackSWE
@BackToBackSWE 4 года назад
Welcome to the channel.
@ZPSu-gs5hc
@ZPSu-gs5hc 4 года назад
thanks for your video it help me to understand maxflow -mincut more directly
@BackToBackSWE
@BackToBackSWE 4 года назад
nice
@sakshammahajan3568
@sakshammahajan3568 3 года назад
Best video i have ever seen thanks a lot.
@崔裕铭
@崔裕铭 2 года назад
Thanks! Your video lets me understand the theorem.
@BackToBackSWE
@BackToBackSWE 2 года назад
Thank you, glad you liked it 😀 Do check out backtobackswe.com/platform/content and please recommend us to your family and friends 😀
@nimidi2568
@nimidi2568 2 года назад
Thanks 🙏🏻 Your way of explaining is perfect
@boris5214
@boris5214 3 года назад
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.
@BackToBackSWE
@BackToBackSWE 5 лет назад
Check out the free DSA Mini-Course 👉backtobackswe.com/five-day 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
@noahcoomer9170
@noahcoomer9170 4 года назад
Thanks so much for this channel dude. Your videos on backtracking and sorting were absolutely key to my technical interviews at Amazon this past week. Ended up getting an offer, cheers mate.
@BackToBackSWE
@BackToBackSWE 4 года назад
Nice!
@rookiecookie8258
@rookiecookie8258 4 года назад
@@BackToBackSWE So as far as i understand the min cut (S,T) is an indication/bottleneck for the maximum flow we can push if all outgoing edges of the S part become saturated,right?
@ryanmacanzie1846
@ryanmacanzie1846 3 года назад
@@BackToBackSWE What purpose does a cut serve ?
@AlwaysFiesta
@AlwaysFiesta 4 года назад
Thank you! Brilliant explanation, so easy and clear!
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks
@sourishkrjana3126
@sourishkrjana3126 4 года назад
Best explanation..... Love from India🇮🇳
@BackToBackSWE
@BackToBackSWE 4 года назад
thx.
@magickb7255
@magickb7255 3 года назад
best lecture i ve found so far, thanks!
@yashrajpriyadarshanpatra566
Thanks that was worth the watch!
@umairfaisal5861
@umairfaisal5861 4 года назад
Hey man, that was really really helpful. Thank you so much for the awesome explanation.
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@sergten
@sergten 3 года назад
Finally an explanation that makes sense to me.
@isaacbuitrago2370
@isaacbuitrago2370 4 года назад
Thanks for explaining this. You have good teaching skills.
@BackToBackSWE
@BackToBackSWE 4 года назад
Thanks
@Young_Mocka
@Young_Mocka 4 года назад
i don't know what to say but this vid saved me ... thx a lot
@BackToBackSWE
@BackToBackSWE 4 года назад
u saved
@shamanstation6821
@shamanstation6821 10 месяцев назад
Thanks for nice explanation. Much appreciated.
@BackToBackSWE
@BackToBackSWE 9 месяцев назад
Happy Holidays 🎉 Thank you for your kind words, Shamanstation! We'd love to offer you a 40% Off our exclusive lifetime membership just use the code CHEER40 - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=CHEER40
@fb_a
@fb_a 4 года назад
Awesome explanation bro!!! Just Watched till 5:47 but felt amazing man!.
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@dana1391
@dana1391 2 месяца назад
That was very helpful, thanks!
@Lee-hd1eu
@Lee-hd1eu 4 месяца назад
Better than my algorithm prof
@ruchirjain1163
@ruchirjain1163 2 года назад
this was amazing
@satthu7593
@satthu7593 4 года назад
Really good work! Thanks
@BackToBackSWE
@BackToBackSWE 4 года назад
sure
@CarlosHenrique-pb5lz
@CarlosHenrique-pb5lz 3 года назад
Thank you a lot for this! This has helped me a lot with my presentation
@angiee_granda
@angiee_granda 11 месяцев назад
Thank you professor!!!
@JoseSanchez-vv1zd
@JoseSanchez-vv1zd 2 года назад
Thank you for making this great video! :) It's helping me with my graph algorithms course.
@Gwittdog
@Gwittdog 3 месяца назад
Great Explanation
@rutujashah3919
@rutujashah3919 3 года назад
Excellent teaching skills! I finally understood the concept now! Thanks a lot :)
@ADorssers
@ADorssers 3 года назад
Well done! Thank you very much for your work putting together this helpful video
@sr3277
@sr3277 4 года назад
thank you so much you made it very clear to understand. Saved me from failing ahaha
@BackToBackSWE
@BackToBackSWE 4 года назад
thanks and that's great
@boratsagdiev6486
@boratsagdiev6486 4 года назад
Wow really clear and good video! Thanks!
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@zdravo2247
@zdravo2247 4 года назад
Thank my friend from france
@BackToBackSWE
@BackToBackSWE 4 года назад
France is cool
@markusmichaeldavidsnelder3395
@markusmichaeldavidsnelder3395 4 года назад
You're videos are amazing! Keep it up
@BackToBackSWE
@BackToBackSWE 4 года назад
ok
@patchiang13
@patchiang13 4 года назад
Thank you. The tutorial is quite helpful.
@BackToBackSWE
@BackToBackSWE 4 года назад
great.
@bencameron8840
@bencameron8840 2 года назад
Great stuff! Really helped me understand these concepts!
@bodobaumstamm8386
@bodobaumstamm8386 3 года назад
Great video, clearified a lot! Thank you
@ankityadav-zz9gf
@ankityadav-zz9gf 5 лет назад
Thanks a lot for all your videos. Could you please upload some more videos on greedy problems and about the approach to solve them. for ex the gas station problem in Leetcode.
@BackToBackSWE
@BackToBackSWE 5 лет назад
ok
@mehmetalikeskin6467
@mehmetalikeskin6467 3 месяца назад
good job brother very appreciate it
@harshitanag2452
@harshitanag2452 4 года назад
Nice Explanation:)
@BackToBackSWE
@BackToBackSWE 4 года назад
Glad you liked it!
@sippy_cups
@sippy_cups 4 года назад
Awesome video! really well presented
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
@md.muidulalamtuhin1863
@md.muidulalamtuhin1863 4 года назад
Thanks, Man for the awsome explanation
@BackToBackSWE
@BackToBackSWE 4 года назад
ye
@XORBob
@XORBob 2 года назад
Well done, that was a big help. Thanks!
@DRUNKASSGAMING
@DRUNKASSGAMING Год назад
this was really helpful thank you!
@BackToBackSWE
@BackToBackSWE Год назад
Thank you 🎉 Please enjoy a special coupon from us - backtobackswe.com/checkout?plan=lifetime-legacy&discount_code=SUB 🚀
@jakob1379
@jakob1379 4 года назад
Great explanation. Just a note Ford Fulkerson, it is not an algorithm but rather a method as it has multiple possible implementations with different run times
@BackToBackSWE
@BackToBackSWE 4 года назад
en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm 😳😳
@jakob1379
@jakob1379 4 года назад
​@@BackToBackSWE okokok so it's just a matter of how strict you are before it is not categorized as an algorithm :D
@VineetBhatawadekar
@VineetBhatawadekar Год назад
This is very good content!
@tudor6210
@tudor6210 4 года назад
Great explanation!
@BackToBackSWE
@BackToBackSWE 4 года назад
thx
Далее
Maximum flow Minimum Cut Algorithm
14:02
Просмотров 40 тыс.
Dijkstra's Algorithm vs Prim's Algorithm
20:36
Просмотров 69 тыс.
V16 из БЕНЗОПИЛ - ПЕРВЫЙ ЗАПУСК
13:57
HA-HA-HA-HA 👫 #countryhumans
00:15
Просмотров 3,5 млн
БАГ ЕЩЕ РАБОТАЕТ?
00:26
Просмотров 236 тыс.
Minimum cuts and maximum flow rate
10:00
Просмотров 72 тыс.
Max Flow Ford Fulkerson | Network Flow | Graph Theory
13:25
13. Incremental Improvement: Max Flow, Min Cut
1:22:58
Просмотров 153 тыс.
Edmonds Karp Algorithm | Network Flow | Graph Theory
9:35
The hidden beauty of the A* algorithm
19:22
Просмотров 866 тыс.
Ford-Fulkerson in 5 minutes
5:15
Просмотров 929 тыс.
A Brain-Inspired Algorithm For Memory
26:52
Просмотров 115 тыс.
V16 из БЕНЗОПИЛ - ПЕРВЫЙ ЗАПУСК
13:57