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 | 3985 |
2 | jiangly | 3814 |
3 | jqdai0815 | 3682 |
4 | Benq | 3529 |
5 | orzdevinwang | 3526 |
6 | ksun48 | 3517 |
7 | Radewoosh | 3410 |
8 | hos.lyric | 3399 |
9 | ecnerwala | 3392 |
9 | Um_nik | 3392 |
# | User | Contrib. |
---|---|---|
1 | cry | 169 |
2 | maomao90 | 162 |
2 | Um_nik | 162 |
4 | atcoder_official | 161 |
5 | djm03178 | 158 |
6 | -is-this-fft- | 157 |
7 | adamant | 155 |
8 | Dominater069 | 154 |
8 | awoo | 154 |
10 | luogu_official | 150 |
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.