-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added implementation of Dinic's #82
Added implementation of Dinic's #82
Conversation
Looks good. Golfed to 40 lines and 678 characters. (Counted by |
Looks good to me!
We could just put this in by default and note that if |
This reverts commit 50ce953.
As with our discussion, the original version is already doing a full blocking flow. |
Right, I misparsed how the |
Added scaling in b552ece. |
Comes in at 42 lines and 800 non-whitespace characters, compared to 36 lines and 592 non-whitespace characters for Edmonds-Karp, and 46 lines and 761 non-whitespace characters for Hopcroft-Karp. Note that about 4 of these lines and 100 of the characters are due to
addEdge
(whereas you need to add edges yourself for Edmonds-Karp).Unluckily, it seems to run at
0.45
seconds on SPOJ MATCHING compared to0.15
from Hopcroft-Karp... In addition, it doesn't return the matches themselves like Hopcroft-Karp it does.For now I haven't included it in the document - I think that's another discussion. See #75 .