Блог пользователя Peregrine_Falcon

Автор Peregrine_Falcon, история, 7 лет назад, По-английски

I just learned Ford-Fulkerson Algorithm for Maximum Flow Problem with BFS/DFS. I solved one problem from lightoj.com.

But I couldn't find any basic problem to practice the basic algorithm.

If someone can provide me some very basic problem, by practicing them I'll get used to the basic concept & coding also learn something I'll be really very grateful. I've some problems but those are not basic.

Thank You.

  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Ford fulkerson's algo is likely not enough to get you through many Max Flow problems (I will let you find out why). Learn edmond karp's algo instead.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +6 Проголосовать: не нравится

https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=565

Try out some of these problems. You will probably not get them. Struggle with them, and then try to find solutions online.

The biggest thing with flow is figuring out how to construct the graph and motivate the flow to get the answer you want. This is very hard to do at first, but there's a few tricks involved that will get you through many, many problems. When you look up solutions online, some of them will describe somewhat inefficient graphs (say they use 3n nodes instead of only n necessary nodes, or something). See if you can modify the graphs and still get AC, because it will improve your understanding of how to create such graphs.

Flow problems are really hard at first. They get easier, I promise. Honestly, don't worry about coding the actual flow algorithm. Find some template that's good because 90% of the time you won't modify the actual flow algo.

»
7 лет назад, скрыть # |
 
Проголосовать: нравится +12 Проголосовать: не нравится

Ford-Fulkerson is rather a method — find augmenting paths and fill them while you can also filling with reverse flow if needed, and all max-flow algorithms like Edmond Karp build on this technique by using a good heuristic to find these paths.