6

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

icexelloss
  • 61
  • 1
  • 2
  • Can you define what you want better? What exactly do you mean by "minimum cost flow" problem? – Falmarri Apr 27 '11 at 01:45
  • @Falmarri he's probably referring to the Ford-Fulkerson network flow algorithm. http://en.wikipedia.org/wiki/Ford%E2%80%93Fulkerson_algorithm – Brian Willis Apr 27 '11 at 01:50
  • I am referring to the Minimum-cost flow problem. http://en.wikipedia.org/wiki/Minimum-cost_flow_problem – icexelloss Apr 27 '11 at 01:56
  • JUNG2 seems to support two other problems: (i) `Implements the Edmonds-Karp maximum flow algorithm for solving the maximum flow problem.` (ii) a few shortest path algorithms http://jung.sourceforge.net/doc/api/index.html Maybe you can look into (i) and modify it a bit – eee Apr 27 '11 at 07:46
  • Here are two https://sites.google.com/site/indy256/algo/min_cost_flow_bf https://sites.google.com/site/indy256/algo/min_cost_flow_pot – Felipe Jul 19 '18 at 08:12

2 Answers2

2

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.

Pikalek
  • 926
  • 7
  • 21
2

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

Community
  • 1
  • 1
richj
  • 7,499
  • 3
  • 32
  • 50