kactl icon indicating copy to clipboard operation
kactl copied to clipboard

Fix a bug of MinCostMaxFlow.h

Open tht2005 opened this issue 1 year ago • 4 comments

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

tht2005 avatar Aug 25 '24 05:08 tht2005

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

simonlindholm avatar Aug 25 '24 22:08 simonlindholm

I add tests for this case.

tht2005 avatar Sep 15 '24 21:09 tht2005

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

tht2005 avatar Sep 19 '24 20:09 tht2005

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

simonlindholm avatar Sep 19 '24 20:09 simonlindholm