mincut problem: an edge-weighted digraph, source vertex s, and target vertex t.
a st-cut is a partition of the vertices into two disjoint sets, with s in one set A and t in the other set B.
他的容量就是从A到B的边的容量之和,而不计算从B到A的边。
最小st-cut问题: 找一个cut,使得cut的容量最小。
最大流问题: st-flow容量, 边的流 <= 边的容量。除了s和t,inflow = outflow。 流的值等于在t的inflow。需要找到一个值最大的flow。
在augmenting paths增加flow。终止条件是: full forward edge 或者 empty backward edge.
FFA:
start with 0 flow
while there exists an augmenting path:
find an augmenting path
compute bottleneck capacity
increase flow on that path by bottleneck capacity.
the net flow across a cut (A, B) is the sum of the flows on its edges from A to B minus the sum of the flows on its edges from B to A.
Flow-value lemma: let f be any flow and let (A, B) be any cut. Then, the net flow across (A, B) equals the value of f.
value of flow f = net flow across cut (A, B) <= capacity of cut (A, B)
Augmenting path theorem: 如果没有增强路径,一个流是最大流
Maxflow-mincut theorem: value of the maxflow = capacity of mincut
对于任何一个流来说下面的3个条件是对等的
i, 有一个cut的容量 = 流f的值
ii, f是最大流
iii, 对于f来说没有增强路径。
i -> ii , the value of any flow f' <= capacity of cut (A, B) = value of f, 所以f是最大流
ii -> iii, prove contrapositive
iii -> i, let (A, B) be a cut where A is the set of vertices connected to s by an undirected path with no full forward or empty backward edges. s is in A; since no augmenting path, t is in B. capacity of cut = net flow across cut (because forward edges full; backward edges empty) = value of flow f.