I am wondering is there any open source Java library for minimum cost flow problem? I have checked jgrapht and it is not helping. Does Any body know such library?
Regards, Luke
3. What is the source? Explanation: Vertex with no incoming edges is called as a source. Vertex with no leaving edges is called as a sink.
Turn the feasible flow into a minimum flow by solving a max flow problem. You need to find the maximum flow on the graph that has capacities equal to flow(e) - lower-bound(e), where flow(e) means flow from the feasible flow. This maximum flow subtracted from the feasible flow will be a minimum flow.
This is an algorithm for the minimum-cost perfect matching problem that runs in O(n(m + n log n)) time. Recall that we let G = (V ; E) be a directed graph with edge costs c : E → R≥0 and capacities µ : E → R≥0.
I don't know of a library that is both open source and includes this algorithm, but here are a few places to look if you decide to have a go at implementing it yourself.
The answers to this question: Good Java graph algorithm library? identify some of the main Java graph libraries.
This article: Minimum cost flow problem and its applications discusses how to express the problem in OptimJ. OptimJ is a commercial product with a "free" version.
This book also has half a chapter on the algorithm: A Java Library of Graph Algorithms and Optimization
Here's a min cost max flow algorithm in Java. There's no license with the code so you may need to contact the page owner for that info. I've not yet used this code myself. If it doesn't do the job & you're willing to port some code, I've seen numerous C / C++ implementations.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With