Is there a package which implements a min cost flow algorithm in R?
The igraph
package seems only to have max flows (via the graph.maxflow()
function), and nothing else here or on rseek.org looks helpful.
Is there a package which implements a min cost flow algorithm in R?
The igraph
package seems only to have max flows (via the graph.maxflow()
function), and nothing else here or on rseek.org looks helpful.
Perhaps you could return all flows and then sort by value?
Package sna
has a flowbet()
function for flow between.
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!