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 | jiangly | 3976 |
2 | tourist | 3815 |
3 | jqdai0815 | 3682 |
4 | ksun48 | 3614 |
5 | orzdevinwang | 3526 |
6 | ecnerwala | 3514 |
7 | Benq | 3482 |
8 | hos.lyric | 3382 |
9 | gamegame | 3374 |
10 | heuristica | 3357 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | -is-this-fft- | 165 |
3 | Um_nik | 161 |
3 | atcoder_official | 161 |
5 | djm03178 | 157 |
6 | Dominater069 | 156 |
7 | adamant | 154 |
8 | luogu_official | 152 |
9 | awoo | 151 |
10 | TheScrasse | 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.