简体   繁体   English

使用maxflow算法在有向加权图中计算最小割

[英]calculating minimum - cut in a directed weighted graph using maxflow algorithm

i have calculated maximum flow using ford fulkerson algorithm,now i want to implement project selection problem for which i need to calculate max. 我已经使用福特富尔克森算法计算了最大流量,现在我想实现我需要计算最大值的项目选择问题。 no. 没有。 of feasible projects.i need to find a min.cut containing no. 我需要找到一个不包含任何项目的最小切割 of feasible projects with max profit. 具有最大利润的可行项目。 What should be the algorithm to find a min. 查找最小值的算法应该是什么。 cut *after knowing max.flow in graph.*How can i use max flow to determine cut containing ie no. *知道图中的最大流量后*我如何使用最大流量来确定包含编号的切割。 of nodes contributing to max flow.I need to select the optimal set of nodes so that revenue is maximisied. 我需要选择最佳的节点集,以使收益最大化。 In my application each node is associated with a revenue,it can be positive and negative also. 在我的应用程序中,每个节点都与收入相关联,它也可以是正数和负数。 and there are precedence constraints also,eg.if a is selected than b&c also must be selected Can anybody tell me how to implement this? 并且也有优先级约束,例如,如果选择a而不是b&c,那么有人可以告诉我如何实现吗?


I have transformed it in max flow graph as follows: if revenue(node)>0 add an edge from source->node else add an edge from node->sink and i have created a egde of infinite capacity for precedence constraints 我已经在最大流程图中对其进行了如下转换:如果Revenue(node)> 0从source-> node添加一条边,否则从node-> sink添加一条边,并且我为优先约束创建了无限容量的egde

Ford Fulkerson is somewhat of a meta-algorithm in that it can be implemented several different ways (Edmonds-Karp is an instantiation for the FF algorithm). Ford Fulkerson有点像元算法,因为它可以通过几种不同的方式实现(Edmonds-Karp是FF算法的实例化)。 Your question is difficult to answer without knowing which way you implemented it or what information you have. 如果不知道您实施该问题的方式或拥有的信息,就很难回答您的问题。

Ideally, you are doing some type of Breadth First Search in the algorithm using a residual graph of some kind. 理想情况下,您使用某种残差图在算法中进行某种类型的广度优先搜索。 When you are doing this, the algorithm should halt when your BFS can not find the sink. 在执行此操作时,当您的BFS找不到接收器时,算法应停止。 Once this has happened, the first set for your cut is all of the nodes you were able to find with your BFS, and the other set is all the nodes you could not find. 一旦发生这种情况,剪切的第一个集合是您可以在BFS中找到的所有节点,而另一个集合是您找不到的所有节点。

If you are using the labeling version of the algorithm, the sets that form the cut are the labeled set and the unlabeled set. 如果使用算法的标注版本,则构成剪切的标注集为标注标注集和未标注标注集。

I hope this helps. 我希望这有帮助。 Your question was admittedly a little difficult for me to parse. 您的问题对我来说很难解析。 If you are unable to find sufficient help here, I would have the same recommendations as matcheek (look on Wikipedia or CLRS if you have that book available). 如果您在这里找不到足够的帮助,我将与Matcheek提出相同的建议(如果有此书,请查阅Wikipedia或CLRS)。

我们可以通过从源顶点运行dfs / bfs来计算最小割(A,B),然后在最终残差图中找到饱和边,即在没有增量路径之后

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM