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.
№ | Пользователь | Рейтинг |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
Страны | Города | Организации | Всё → |
№ | Пользователь | Вклад |
---|---|---|
1 | cry | 166 |
2 | maomao90 | 163 |
2 | Um_nik | 163 |
4 | atcoder_official | 161 |
5 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
9 | nor | 153 |
9 | Dominater069 | 153 |
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.
Название |
---|
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.