'Minimum cost flow
Is there a package which implements a min cost flow algorithm in R?
The igraphpackage seems only to have max flows (via the graph.maxflow() function), and nothing else here or on rseek.org looks helpful.
Solution 1:[1]
Perhaps you could return all flows and then sort by value?
Package sna has a flowbet() function for flow between.
Solution 2:[2]
I was struggling with this as well and posted a question with a reproducible min-cost-flow problem here. While I did not receive a definite answer from the community, I did post the approach that I ended up implementing. It involved a data.frame of edges with a $cost and a $capacity property, which I then used to generate appropriate constraints for an lpSolve optimisation. Check it out, hope it helps!
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | metasequoia |
| Solution 2 | JanLauGe |
