Fix a bug of MinCostMaxFlow.h#263
Conversation
Fix a bug that occur when maxflow function is called multiple times from different source vertices.
|
It's enough to set par[s] = NULL at the start of maxflow, right? Can you modify the stress test to cover this case? |
|
I add tests for this case. |
can you review my code |
|
NULL -> 0 to save a few chars. For the test, it doesn't actually check that |
|
Maybe I've just misunderstood this PR, but I don't think we want to support this? I don't think Simon's stated property holds. The usecase this fixes seems to be "call maxflow on multiple different source vertices in the same weakly connected component", which as far as I'm aware is a somewhat nonsensical computation? Additionally, I suspect that you might get issues with having incorrect potentials on some graphs. |
Fix a bug that occur when maxflow function is called multiple times from different source vertices.