Skip to content
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

Fix a bug of MinCostMaxFlow.h #263

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

tht2005
Copy link

@tht2005 tht2005 commented Aug 25, 2024

Fix a bug that occur when maxflow function is called multiple times from different source vertices.

Fix a bug that occur when maxflow function is called multiple times from different source vertices.
@simonlindholm
Copy link
Member

simonlindholm commented Aug 25, 2024

It's enough to set par[s] = NULL at the start of maxflow, right? Can you modify the stress test to cover this case?

@tht2005
Copy link
Author

tht2005 commented Sep 15, 2024

I add tests for this case.

@tht2005
Copy link
Author

tht2005 commented Sep 19, 2024

It's enough to set par[s] = NULL at the start of maxflow, right? Can you modify the stress test to cover this case?

can you review my code

@simonlindholm
Copy link
Member

NULL -> 0 to save a few chars. For the test, it doesn't actually check that maxflow returns the correct result, only that it doesn't crash. Can you check that too? E.g. test it by doing "construct graph. pick random a,b,c,d. compute e = maxflow(a,b), f = maxflow(c,d). set up the same maxflow instance again. compute f' = maxflow(c, d), e' = maxflow(a, b). check that e = e', f = f'."

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants