Definition:

Max-flow problem:

Definition
  • Only an amount of crates per day can go from city to city
  • What is the maximum crates can be transported per day?
    • the number of each directed edge denotes the capacity
  • Formally defined:
    • a tuple with two nodes called source and sink
    • a flow that map satisfying the two constraints:
      • capacity:
      • flow conservation: for all nodes except start and sink

Minimum-cut problem:

  • This can be solved with defining minimum-cut problem:
  • Say all nodes are splitted to 2 groups with group A includes start node and group B includes sink
  • Therefore, need to find cut such that flow from 1 group to the other is minimum, which means it is the max flow that satisfy the capacity
  • Net flow across cut is sum of flow from A to B and B to A
  • formally:
    1. An st-cut is a partition (A, B) of the nodes with and
    2. Its capacity is the sum of the capacities of the edges from A to B
  • Using greedy will fail because once it increase a flow on an edge, it will never decrease
  • This can be expensive to compute

Residual Network:

  • For an edge with flow/capacity :
    • define the flow as an independent edge with weight
    • define a new residual edge with reverse direction and with weight
  • A flow on a reverse edge negates flow on corresponding forward edge
  • Formally:
    • with , new set of edges
    • key property: is a flow in iff is a flow in
    • an augmenting path is a simple path in the residual network
    • The bottleneck capacity of an augmenting path is the minimum residual capacity of any edge in
      • think of it like the amount of flow that cant be passed due to other nodes, minimize that is to maximize the flow
    • Key property: Let be a flow and let be an augmenting path in . Then, after calling , the resulting is a flow and
  • AUGMENT(f,c,P):
    • = bottleneck capacity of augmenting path
    • FOREACH edge :
      • IF :
      • Else;
    • return f

Ford-fulkerson Algorithm:

  • Start with for each edge
  • Find an path in the residual network
  • Augment flow along path
  • Repeat until get stuck
  • Input: Network G
  • Pseudocode:
    • Foreach edge
    • residuel network of with respect to flow
    • WHILE: there exists an path in
      • Augment(f,c,P)
      • update
    • Return f

Flow and cut relationship

  • Let f be any flow and let be any cut.
    • Lemma: then, the value of the flow f equals the net flow across the cut .
    • Weak duality:
    • Corollary: if then f is the max flow and is a min cut
  • Theorem: Value of a max flow = capacity of a min cut