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

Поділитися
Вставка
  • Опубліковано 24 січ 2025

КОМЕНТАРІ • 348

  • @FirstTimeDad23
    @FirstTimeDad23 5 років тому +275

    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.

  • @alexanderson753
    @alexanderson753 3 роки тому +86

    > 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!

  • @tvishathakur8947
    @tvishathakur8947 Рік тому +21

    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  Рік тому +1

      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

    • @anhkhoiaoduy6072
      @anhkhoiaoduy6072 2 місяці тому

      super super succinct, straightaway, something that professors lack is the ability to articulate and give ways to teach students more obviously.

  • @qR7pK9sJ2t
    @qR7pK9sJ2t 5 років тому +144

    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..

  • @anastasiagavrilita6567
    @anastasiagavrilita6567 4 роки тому +14

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

    • @BackToBackSWE
      @BackToBackSWE  4 роки тому +3

      May the internet grow big and strong

  • @qqww1345
    @qqww1345 2 роки тому +3

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

  • @mengengao7657
    @mengengao7657 4 роки тому +6

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

  • @enricomilettogranozio8817
    @enricomilettogranozio8817 3 роки тому +7

    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 роки тому +3

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

  • @ollieeilon4061
    @ollieeilon4061 Рік тому +2

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

  • @dianaayt
    @dianaayt 4 роки тому +10

    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!

  • @CrzyAsianGuy
    @CrzyAsianGuy 5 років тому +4

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

  • @abdi6141
    @abdi6141 5 років тому +7

    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.

  • @SR-ti6jj
    @SR-ti6jj 4 роки тому +5

    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!

  • @nayararossi7513
    @nayararossi7513 5 років тому +20

    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.

  • @addemfrench
    @addemfrench 4 роки тому +1

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

  • @Arush-eu2xz
    @Arush-eu2xz 5 років тому +2

    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!

  • @pedro_soares_bhz
    @pedro_soares_bhz Рік тому

    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.

  • @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 🚀

  • @IAmNigHtMaReTR
    @IAmNigHtMaReTR 5 років тому +2

    5 mins in and I’m subbed. These videos are true gems. Thank you very much

  • @sumitlahiri209
    @sumitlahiri209 5 років тому +3

    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.

  • @kureshimiru
    @kureshimiru 4 роки тому

    Many thanks from graduate students at the Faculty of Electrical Engineering and Computing, Zagreb, Croatia!
    Amazing video!

  • @sam-lr4lz
    @sam-lr4lz 5 років тому +3

    Found your video literally a day before my exams. Thanks heaps

  • @danielescotece7144
    @danielescotece7144 5 років тому +4

    Mathematical engineering student here! Thanks man, this is helping me with my OR exam!

  • @dariusbuhai9074
    @dariusbuhai9074 4 роки тому

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

  • @MrKingoverall
    @MrKingoverall 4 роки тому +5

    Operations Research student here , thanks Ben !

  • @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

  • @BackToBackSWE
    @BackToBackSWE  5 років тому +99

    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 5 років тому +2

      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  5 років тому

      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 ?

  • @SDKThe8God
    @SDKThe8God 5 років тому +3

    Glad I couldn’t find any German videos on this topic, this is great!

  • @dorsamotiallah3998
    @dorsamotiallah3998 21 день тому

    Thank you man you explained better than houndreds and hundreds of text books. Let me say it once more, Thanks a lot for this video again 🙏🏻

  • @shawn77160
    @shawn77160 Рік тому +1

    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 :)

  • @ckc2498
    @ckc2498 2 роки тому

    Really love the word "undo". It help me understand what the hell there's an reverse arrows in this algo

  • @bryanthandamparambil1581
    @bryanthandamparambil1581 3 роки тому +1

    Thank you for your help, I'm currently studying in year 12 in Australia and this is really helpful, Thank You!!!

  • @coffee-syrup
    @coffee-syrup Рік тому

    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  Рік тому

      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

  • @saneewhy
    @saneewhy Рік тому

    perfect. thanks so much.. spent hours watching lectures and this one vid helped me more than all of them combined!!!!

  • @irukandjiShred
    @irukandjiShred 9 місяців тому

    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!!

  • @mariasandru7
    @mariasandru7 5 років тому +14

    Amazing! My university professor recommended your videos last week in class🤗 Could you also explain when you have time the Bellman Ford algorithm?

  • @vicd32
    @vicd32 4 роки тому +13

    Amazing Explanation! You have some great communication skills for a topic that is definitely not the easiest

  • @iustincondrea2105
    @iustincondrea2105 4 місяці тому

    This made it easier to understand the Ford-Fulkerson Algorithm iterations on a graph.Thanks😁

  • @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!

  • @shmulimargulies5462
    @shmulimargulies5462 4 роки тому

    someone get this man a medal

  • @MohammadAlshariar
    @MohammadAlshariar Місяць тому

    Bro you are genius. You saved my time.

  • @gtmashok
    @gtmashok 4 роки тому

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

  • @DUSHYANTPANCHAL
    @DUSHYANTPANCHAL 4 роки тому +5

    Really well explained the intuition. Exactly what I was looking for!

  • @imotvoksim
    @imotvoksim 2 роки тому +2

    Isn't the idea of the min-cut just that it is the bottle neck between s and t? Hence, pushing flow from s to t will be capped by the min-cut edges, therefore their value tells you the max-flow through the network. At least that is my intuitive takeaway from this :)

  • @fb_a
    @fb_a 5 років тому +3

    Awesome explanation bro!!! Just Watched till 5:47 but felt amazing man!.

  • @boris5214
    @boris5214 3 роки тому +1

    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.

  • @xflory26x
    @xflory26x 4 роки тому +2

    So glad I found your channel!! Your explanations are so clear :)

  • @nikhiljain3549
    @nikhiljain3549 3 роки тому +1

    20:45 Can't we cut from in front of U for the minimum cut that will be 2+1 = 3?

    • @yuktikumari6042
      @yuktikumari6042 3 роки тому +1

      graph is changed by then.....it is not the initial one ....now it is 4+3 = 7

  • @agnesakne4409
    @agnesakne4409 3 роки тому +1

    20:35 why the heck do you not count the edge weighted 2?

  • @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 😀

  • @jackkrueckeberg2352
    @jackkrueckeberg2352 Рік тому

    Thank you so much, you made this so much more understandable than my instructor

  • @henrynguyen911
    @henrynguyen911 5 років тому +5

    my man Ben doing God's work! Thank you so much!

  • @Himanshu9178
    @Himanshu9178 3 роки тому +1

    Well can i think of the back edges as kind of an U-TURN ?

  • @priyanshugupta4875
    @priyanshugupta4875 Рік тому

    literally one of the best explainations

  • @sourishkrjana3126
    @sourishkrjana3126 4 роки тому +2

    Best explanation.....
    Love from India🇮🇳

  • @Daniel-iy1ed
    @Daniel-iy1ed Рік тому

    This video was fantastic, I needed a visualization badly. Thank you so much

  • @ShashidharG_addString_
    @ShashidharG_addString_ 4 роки тому +1

    Great job in explaining the reason why the undo operations work!!

  • @mahditalebi1770
    @mahditalebi1770 4 роки тому +1

    great explanation. no stutter.no bullshit. just good solid well explained!
    thank you

  • @summerxia7474
    @summerxia7474 Рік тому

    Please continue to do this series of lectures!!! You are way better than my teacher in college.

  • @zcjsword
    @zcjsword 3 роки тому

    Your "undo" gives me the epiphany! Thank you!

  • @ankityadav-zz9gf
    @ankityadav-zz9gf 5 років тому +3

    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.

  • @jakob1379
    @jakob1379 4 роки тому +1

    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

  • @ZPSu-gs5hc
    @ZPSu-gs5hc 5 років тому +1

    thanks for your video it help me to understand maxflow -mincut more directly

  • @Young_Mocka
    @Young_Mocka 5 років тому +1

    i don't know what to say but this vid saved me ... thx a lot

  • @mathewa7450
    @mathewa7450 Місяць тому

    This has helped me so much for me exam. Thank you so much.

  • @amaefulemercy8974
    @amaefulemercy8974 8 місяців тому

    Thank you so much for this video, I've been struggling to understand this for awhile.. Buh now I get it..

  • @daniellewis6228
    @daniellewis6228 24 дні тому

    i passed my algorithms class bc of u

  • @umairfaisal5861
    @umairfaisal5861 5 років тому +3

    Hey man, that was really really helpful. Thank you so much for the awesome explanation.

  • @osmankhalid2005
    @osmankhalid2005 4 роки тому

    What does it mean by "counting edges going out of the cut". How we become sure about the direction.

  • @ruchirjain1163
    @ruchirjain1163 2 роки тому +1

    this was amazing

  • @nimidi2568
    @nimidi2568 2 роки тому

    Thanks 🙏🏻
    Your way of explaining is perfect

  • @MiketheCoder
    @MiketheCoder 5 років тому +1

    Fellow terp here. Do you have any tips on tackling system design problems during interviews? I feel like leetcode doesn't really have much on those.

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +1

      Yeah I know you (have seen you commenting a couple times before) although not sure if we've met in real life. And I do not, and yes Leetcode is thin on that as of now

  • @niritcohen7199
    @niritcohen7199 10 місяців тому

    Thank you!! You make it so simple. Keep on, it's great!!

  • @ManishKumar-rz9ub
    @ManishKumar-rz9ub 10 місяців тому

    I never understood that back edges concept until i saw this one.

  • @magickb7255
    @magickb7255 4 роки тому

    best lecture i ve found so far, thanks!

  • @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/ 🎉

  • @yuktikhantwal2342
    @yuktikhantwal2342 4 роки тому +1

    hey man.. can u probably make a video about how to go about thinking when u are solving any coding questions? like what should be the thought process? so that we can come up with optimized solutions.. it would be a great help

  • @Nika-i6p
    @Nika-i6p 8 місяців тому

    Best video on this subject! Thank you!

  • @markusmichaeldavidsnelder3395
    @markusmichaeldavidsnelder3395 4 роки тому +1

    You're videos are amazing! Keep it up

  • @sergten
    @sergten 4 роки тому

    Finally an explanation that makes sense to me.

  • @AlwaysFiesta
    @AlwaysFiesta 4 роки тому +2

    Thank you! Brilliant explanation, so easy and clear!

  • @prakad97
    @prakad97 5 років тому +2

    Hey man..a small video suggestion..if possible can you make a video on..how your brain processes when you see a problem..decide this method to approach..like breakdown your method of approaching a problem..or like take an unsolved problem solve it live..this can help us know how to think to approach and solve a problem..like some framework or steps that you have for backtracking..make a generalized framework for every topic and problem approaching..!! Just a suggestion...!!✌️
    Edit : Example:: check out Anton Spraul's Think Like A Programmer playlist something like that..but in your point of view..!

  • @MarkedMuichiro828
    @MarkedMuichiro828 2 роки тому

    Thank you for making this great video! :) It's helping me with my graph algorithms course.

  • @blasttrash
    @blasttrash 5 років тому +2

    Just a question, while making these videos do you only learn enough to make this video or do you go and check the proofs and understand them deeply? I am asking because I want to use that as a standard while reading or learning about some new concept on wikipedia etc in future.

    • @BackToBackSWE
      @BackToBackSWE  5 років тому +2

      I'm in a class for algorithm design and it is all proof centric. I just made this to cover the surface level concepts and to help teach myself as well.

  • @XORBob
    @XORBob 3 роки тому

    Well done, that was a big help. Thanks!

  • @isaacbuitrago2370
    @isaacbuitrago2370 4 роки тому +1

    Thanks for explaining this. You have good teaching skills.

  • @sr3277
    @sr3277 4 роки тому +1

    thank you so much you made it very clear to understand.
    Saved me from failing ahaha

  • @divyaranga6058
    @divyaranga6058 5 років тому +3

    Hi Ben, Great work! These videos are so helpful for interview preparation. Can you make a video to go over Union-Find data structure ?

    • @BackToBackSWE
      @BackToBackSWE  5 років тому

      Yes I can, just time limits my ability to contribute here.

  • @bonaseraproductions1460
    @bonaseraproductions1460 Рік тому

    Why would you count 2 for the cut when you slice the 1,2,3 edges but with the 4,2,3 you won’t count the 2v

  • @guyharem2082
    @guyharem2082 11 днів тому

    you made such a nice video but it's so hard to follow with the residual/original corrections, at some points I wasn't sure anymore what you mean..

  • @constantinemacris9047
    @constantinemacris9047 9 місяців тому

    Fantastic video. Beautiful work.

  • @Eccthelion
    @Eccthelion 5 років тому

    you mentioned we only take the edges going out of the cuts but at 20:17 you take into account the edge from U to V and at 20:31 you dont ?

    • @BackToBackSWE
      @BackToBackSWE  5 років тому

      I haven't replied to this for a bit, replying to close this out in my "unresponded to comments" feed.

    • @alexandrubarbat
      @alexandrubarbat 4 роки тому

      The author is correct, is taking into account only the forward edges .The capacity of the cut is the sum of the capacities of forward edges -- it represents the maximum flow which can be pushed through that cut.

  • @smartlearners3257
    @smartlearners3257 3 роки тому

    Please a qustion, can we hav more than one min cut in a network flow? Bcs from what i did i get 2 min cuts cuz when i sum both gives me the max flow value i got.

  • @AvirupChakraborty-ex9bf
    @AvirupChakraborty-ex9bf 9 місяців тому

    Can you plz suggest a good text book for this....I was using Douglas West....what's your choice

  • @happyandinformedlife1212
    @happyandinformedlife1212 5 років тому +1

    Great video , thanks. Love all your videos. Can you please make a video on 647 Approach #2: Manacher's Algorithm

  • @miftahihsan6780
    @miftahihsan6780 5 років тому +1

    Please make a video on graph articulation points and bridges. There are not many good videos out there on this topic.

  • @bencameron8840
    @bencameron8840 3 роки тому

    Great stuff! Really helped me understand these concepts!

  • @boratsagdiev6486
    @boratsagdiev6486 5 років тому +1

    Wow really clear and good video! Thanks!

  • @ADorssers
    @ADorssers 4 роки тому

    Well done! Thank you very much for your work putting together this helpful video