Min Cost Flow in R

风流意气都作罢 提交于 2019-12-09 13:49:37

问题


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!



来源:https://stackoverflow.com/questions/13272612/min-cost-flow-in-r

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!