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

最大流量问题


     对于最大流量问题的详细分析和理论参见算法导论,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


下面通过一个具体例子,说明算法的执行流程。
最大流问题(Ford-Fulkerson算法)_第1张图片



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




你可能感兴趣的:(Algorithm)