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

Negative cycles in min cost max flow algorithms #67

Open
williamfiset opened this issue Dec 4, 2018 · 2 comments
Open

Negative cycles in min cost max flow algorithms #67

williamfiset opened this issue Dec 4, 2018 · 2 comments

Comments

@williamfiset
Copy link
Owner

williamfiset commented Dec 4, 2018

The current implementation of the Bellman Ford min-cost flow algorithms seems to only support non-negative edge costs, but in reality, they should be able to handle negative weighted edges.

@williamfiset
Copy link
Owner Author

I will need to investigate this more to see if the initial graph should be able to handle negative edge cost or if negative edge costs simply arise as part of the residual graph.

@jishanshaikh4
Copy link

It seems like it works perfectly with negative cycles too. Bellman-Ford algorithm takes to care for negative edges for shortest cost calculation. And usually I saw at most places, it is implemented in a similar fashion. Maybe I'm wrong, feel free to correct me. For a more thorough reference, you can see at https://cp-algorithms.com/graph/min_cost_flow.html

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

No branches or pull requests

2 participants