最大流问题(Ford-Fulkerson算法)

来源:互联网 发布:mysql从零开始学 pdf 编辑:程序博客网 时间:2024/04/29 15:01

最大流量问题


     对于最大流量问题的详细分析和理论参见算法导论,Ford-Fulkerson算法,伪代码如下:
SetFtotal= 0
Repeat until there is no path from s to t:
     Run DFS from s to find a flow path to t
     Letcp be the minimum capacity value on the path
     Addcp toFtotal
     For each edgeu -> v on the path:
          Decrease c(u,v) bycp
          Increasec(v,u) bycp


下面通过一个具体例子,说明算法的执行流程。




参考:
(1)《算法导论》P404;




0 0