Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generalized network simplex #7381

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

alexandremcosta
Copy link

@alexandremcosta alexandremcosta commented Mar 30, 2024

This is a draft PR to implement the Generalized Network Simplex algorithm.

The purpose is to make it easier to search from networkx PRs tab, when people needs to implement something similar in future.

There is 2 test examples here and here. There can be bugs, so do not use it in production without previously testing.

The code was implemented as part of the Master program of PUC-Rio, for the Combinatorial Optimization credits, under supervision of professor Marcus Poggi.

The implementation was heavily inspired on: Ahuja, R. K.; Magnanti, T. L. & Orlin, J. B. (1993), Network Flows: Theory, Algorithms, and Applications , Prentice hall

alexandremcosta and others added 30 commits January 26, 2018 11:48
@dschult
Copy link
Member

dschult commented Mar 30, 2024

Thanks for this!
It's not in a format ready for networkx yet, but there is some good code there.
Let's talk about the big picture ideas first:

Did you look at the flow computations already in NetworkX? Why implement another one? do any of them use a similar method that this is an improvement on?

At least some people -- SO post feel that a recent good simplex method often performs better for the network problem than a network simplex method (because simplex methods have improved so much). Do you have thoughts on this? Does this method use a simplex method tool? I see gurobi.log as one of the files (which shouldn't be merged into the library) and I know they have a simplex method, but basically nothing else about that tool.

Does this PR use any libraries that networkx doesn't already use?

Thanks!

@alexandremcosta
Copy link
Author

alexandremcosta commented May 2, 2024

Why implement another one? do any of them use a similar method that this is an improvement on?

Notice this is the generalized version, where edges have gain/losses. I don't think a classic simplex can solve that.

This a proof of concept, to study and implement the proposed algorithm by the referenced book, by Ahuja.

At the time this code was written, we didn't find any generalized network simplex implementation open source for us to study, so we wrote our own.

I ended up publishing here in hopes it can be useful to someone that searches for it, but please feel free to close the PR.

The gurobi.log was used internally to verify our solutions. Yes, that needs to be deleted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants