本文介绍了最低成本流的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有一个在R中实现最小成本流算法的软件包?

Is there a package which implements a min cost flow algorithm in R?

igraph软件包似乎仅具有最大流量(通过graph.maxflow()函数),在这里或 rseek.org 看起来很有帮助.

The igraphpackage seems only to have max flows (via the graph.maxflow() function), and nothing else here or on rseek.org looks helpful.

推荐答案

我也为此而苦苦挣扎,并发布了一个有关可重现的最小成本流问题的问题.虽然我没有收到社区的确切答复,但我确实发布了最终实施的方法.它涉及具有$cost$capacity属性的edgesdata.frame,然后我使用它为lpSolve优化生成适当的约束.检查一下,希望对您有所帮助!

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!

这篇关于最低成本流的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!