cheran-senthil / PyRival

⚡ Competitive Programming Library
https://pyrival.readthedocs.io/
Apache License 2.0
1.17k stars 312 forks source link

Translate push-relabel from Kactl #79

Open whosyourjay opened 1 year ago

whosyourjay commented 1 year ago

Push relabel is known to be much faster than Dinic and necessary for solving some flow problems with tighter time constraints. Here I translated Kactl's c++ version to python.

This translation is likely buggy and needs testing for correctness. It would also be nice to have a benchmark of how much faster it is.

cheran-senthil commented 1 year ago

I think some formatting is necessary, but we can make those changes ourselves

@bjorn-martinsson @Mukundan314 What are your thoughts

bjorn-martinsson commented 1 year ago

Think the main thing is that we need to make sure that the implementation is correct. It also would be good to check that it runs fast enough to be useful in practice.