PythonOT/POT

Modernize/Refactor the network_simplex method

Closed this issue ยท 2 comments

Hello,

I checked the EMD implementation. I know that this is largely an unmodified version from the LEMON graph library but I am wondering how much freedom one has to modernize/refactor that code. What are the policies for that? Is the library sticking to the original code for consistency/to avoid adding bugs, or are we free to refactor it? Also, which C++ standard version is the library targeting? Is C++11 acceptable?

๐Ÿš€ Feature

Modernize and refactor the C++ files under ot/lp. The changes can go from simple things such as reformatting the code, removing the GOTO statements, and improving variable names; to more complex things such as changing the template logic, extracting classes, etc

Motivation

I have been working on this code to adapt for my case, but I found the code difficult to work with because of the way that it is organized

Pitch

A cleaner code becomes more accessible for new developers, making it also possible to optimize and extend. At the same time, using modern C++ helps in preventing bugs

Alternatives

One could consider extracting the EMD C++ part into a standalone library.

Hello @EduardoGoulart1 we are open to modernization of the C++ code. Even better we are looking for someone who is willing to maintain it because we are mostly python developers and C++ is its own thing so your are welcome to contribute to POT. The C++ code was mostly a copy paste from the existing solver with python glue and has worked well up to now but we indeed have a hard time updating it.

C++11 makes sens to me and could avoid some remaining bugs,, we just need to make sure that it is available for building the wheels o all platforms.

Among the features that are currently missing I think a very important one would be the ability to give a warm start to the solver (dual and/or primal) which could greatly accelerate the resolution and would maybe be easier after refactoring.

Great! I'll prepare some PR wth a few improvements