Min Cost Flow in R

2019-04-02 11:03发布

问题:

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.

回答1:

Perhaps you could return all flows and then sort by value?

Package sna has a flowbet() function for flow between.



回答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!



标签: r graph flow