You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In your implementation of Dinic's algorithm, you visit every edge only once in the DFS portion. This is wrong, in my opinion, as it does not guarantee that you create a blocking flow. Specifically, you may have to traverse edges more than once if you didn't saturate the path to the sink the first time.
The text was updated successfully, but these errors were encountered:
Your 'ptr[u]++' is in the 'step' clause of the for(), so you will not execute it as long as there is still remaining capacity. I had mistakenly thought that ptr[u]++ was always executed, causing you to miss edges.
https://github.com/indy256/codelibrary/blob/master/java/src/MaxFlowDinic.java
In your implementation of Dinic's algorithm, you visit every edge only once in the DFS portion. This is wrong, in my opinion, as it does not guarantee that you create a blocking flow. Specifically, you may have to traverse edges more than once if you didn't saturate the path to the sink the first time.
The text was updated successfully, but these errors were encountered: