• Home
  • University of Cambridge
  • Optimisation
  • Network Flows and the Ford-Fulkerson Algorithm

Network Flows and the Ford-Fulkerson Algorithm

Optimisation Michael Tehranchi Lecture 10 - Easter 2008 Network flows A network (or directed graph) is a set N = {1, ... , n} of nodes (or vertices), together with a collection N × N of ordered pairs (i, j) is called arcs (or directed edges). The flow in the network is a collection of numbers (xij)i,j indexed by the arcs of the network. Maximal flow in a network In this problem, each arc (i, j) is assigned a capacity cij ? 0. (For notational convenience, we will pretend that all nodes are connected by an arc, and set the capacity to zero for non-existent arcs.) The network has two distinguished nodes, node 1 called the source and node n called the sink. Flow is conserved for all other nodes. The maximum flow problem is to maximise v subject to 0 < Kij ? Cij for all i, j ifi= 1 EjEN Dij - EjEN Cji = 1 v 0 ifi=2, ... ,n-1 -U if i = n We now introduce a method of finding the maximum flow. The Ford-Fulkerson algorithm (0) Assign an initial feasible flow (xij)i,j with value v. (1) Find an augmenting path: A collection of nodes 1 = i1, i2, ... , ir-1, ir = n such that either Cikik+1 - Wikik+1 > 0 or Kik+1 > 0 for each k. If no augmenting path exists, then STOP. (2) If an augmenting path exists, then increase the flow along the path by the amount 10 k=1, ... ,r-1 max {Cixix+1 - Cikik+1, Cik+1ix } by setting X'ij - - Cij + 8 Dij - 8 Cij if i, j are consecutive nodes of path if j, i are consecutive nodes of path otherwise Then (x'ij)i,j is a feasible flow with value v' = v + 8. (3) Go to step (1). 1 We will show that the Ford-Fulkerson algorithm terminates if and only if the flow is optimal. The max flow-min cut theorem Let S C N be a collection of nodes. The complement of S in N is denoted S = N\S. A cut separating the source = node 1 and the sink = node n is a set S such that 1 € S and n E S. Equivalently, the cut is the set of arcs (i, j) with i E S and j ES. The capacity of a cut S, denoted c(S) = > iES,jeŠ Cij, is the sum of all the capacity of the arcs joining S to S. We now come to the main result: Theorem (The max-flow min-cut theorem). For a network, the maximum value of the flow from node 1 to node n is equal to the minimum of the capacities of all cuts separating 1 and n. 2