Is it possible to recover the flow for each edge after running the Push-relabel algorithm on a graph?
It seems like some inside cycles of flow can exist after running the algorithm.
# | User | Rating |
---|---|---|
1 | tourist | 3856 |
2 | jiangly | 3747 |
3 | orzdevinwang | 3706 |
4 | jqdai0815 | 3682 |
5 | ksun48 | 3591 |
6 | gamegame | 3477 |
7 | Benq | 3468 |
8 | Radewoosh | 3462 |
9 | ecnerwala | 3451 |
10 | heuristica | 3431 |
# | User | Contrib. |
---|---|---|
1 | cry | 167 |
2 | -is-this-fft- | 162 |
3 | Dominater069 | 160 |
4 | Um_nik | 158 |
5 | atcoder_official | 157 |
6 | Qingyu | 155 |
7 | djm03178 | 151 |
7 | adamant | 151 |
9 | luogu_official | 150 |
10 | awoo | 147 |
Is it possible to recover the flow for each edge after running the Push-relabel algorithm on a graph?
It seems like some inside cycles of flow can exist after running the algorithm.
Name |
---|
There is some optimization for the push-relabel algorithm which only guarantees the answer to be preflow, not actual flows. To recover the solution, you should run flow decomposition or just get rid of this optimization. I think flow decomposition can be slow, so you should just generally don't have this optimization.
Here is the implementation without that optimization.
I was just reading through the implementation, and read a comment in it that said
basic_string
is bad for this specific use-case. Any idea why that might be the case (I've never faced any issue with usingbasic_string
for graphs — weighted or unweighted)?Well, it did something unbelievable, but I don't remember what it was. I think you can look up for C++ documentation to guess what it is.
What's the complexity without the optimization? I'm thinking of just using Dinic instead.
Complexity remains same: $$$O(V^2 \sqrt E)$$$. Even without the optimization, HLPP is still fast enough empirically.