This is an old revision of the document!


Chapter 7

  • Matching in bipartite graphs can model situations in which objects are being assigned to other objects
    • Nodes in X represent jobs, and the nodes in Y represent machines, and an edge (xi,yj) indicates that machine yj is capable of processing job xi.
  • Perfect Matching: a way of assigning each job to a machine that can process it
    • Property that each machine is assigned exactly one job
  • One of the oldest problems in combinatorial algorithms: determining the size of the largest matching in a bipartite graph G
    • Network Flow Problems: includes the Bipartite Matching Problem as a special case

7.1 The Maximum-Flow Problem and the Ford-Fulkerson Algorithm

The Problem

  • Transportation Networks: networks whose edges carry some sort of traffic and whose nodes act as “switches” passing traffic between different edges
    • capacities on the edges
    • source nodes in the graph, which generate traffic
    • sink (or destination) nodes, which can “absorb” traffic as it arrives
    • traffic, which is transmitted across the edges
  • Flow Networks
    • traffic = flow
    • associated with each edge e is a capacity, ce
    • single source node s in V
    • single sink node t in V
    • all other nodes besides s and t are internal nodes
    • no edge enters s and no edge leaves t
    • at least one edge incident to each edge
    • all capacities are integers
  • Defining Flow
    • s-t flow is a function f that maps each edge e to a nonnegative real number, f
      • Flow must follow two properties:
        • Capacity: for each e in E: we have 0 ⇐ f(e) ⇐ ce
        • Conservation: for each node v other than s and t: sum of the flow value f(e) over all edges entering node v = sum of the flow values over all edges leaving node v
  • The Maximum-Flow Problem
    • goal: arrange the traffic for maximum efficiency of the available capacity
      • given a flow network, find a flow network
    • Each “cut” of the graph puts a bound on the maximum possible flow value
      • maximum-flow algorithm here will be intertwined with a proof that the maximum flow value equals the minimum capacity of any such division, called the minimum cut.

Designing the Algorithm

  • Suppose we start with zero flow: f(e) = 0 for all e
    • problem is that its value is 0
    • we want to increase the value of f by “pushing” flow along a path from s to t, up to the limits imposed by the edge capacities
      • need a general way of pushing flow from s to t to increase the value of the current flow
    • General: push forward on edges with leftover capacity / push backward on edges that are already carrying flow to divert it in a different direction
      • Residual Graph: provides a systematic way to search for forward-backward operations
  • Residual Graph
    • Residual Graph Gf of G with respect to f:
      • The node set of Gf is the same as that of G
      • For each edge e = (u,v) of G on which f(e) < ce, there are ce - f(e) leftover units of capacity: forward edges
      • For each edge e = (u,v) of G on which f(e) > 0, there are f(e) units of flow that we can undo if we want to: edge e' = (v, u) in Gf
        • e' has the same ends as e, but reverse direction: backward edges
  • Augmenting Paths in a Residual Graph

  • result of augment(f, P) is a new flow f' in G, obtained by increasing and decreasing the flow values on edges of P
    • f' is a flow in G:
      • to prove: need to check the capacity of edges on P, and check that the capacity condition and the conservation condition both hold true.
  • Ford-Fulkerson Algorithm:

  • Computes an s-t flow in G

Analyzing the Algorithm: Termination and Running Time

  • At every intermediate stage of the Ford-Fulkerson Algorithm, the flow values {f(e)} and the residual capacities in Gf are integers
  • Use this property to prove the algorithm terminates
    • Show that the flow value strictly increases when we apply an augmentation
      • Let f be a flow in G, and let P be a simple s-t path in Gf. Then we have v(f') = v(f) + bottleneck(P,f); and since bottleneck(P,f)>0, we have v(f') > v(f)
        • Since G has no edges entering s, the edge e must be a forward edge: increase the flow on this edge by bottleneck(P,f): we do not change the flow on any other edge incident to s, so the value of f' exceeds the value of f by bottleneck(P,f)
      • Suppose, as above, that all capacities in the flow network G are integers. Then the Ford-Fulkerson Algorithm terminates in at most C iterations of the While loop.
        • No flow in G can have value greater than C, due to the capcity condition on the edges leaving s. Since it starts with the value 0, and cannot go higher than C, the While loop in the Ford-Fulkerson Algorithm can run for at most C iterations.
      • Suppose, as above that all capacities in the flow network G are integers. Then the Ford-Fulkerson Algorithm can be implemented to run in O(mC) time.
        • Assuption: m>= n/2: O(m+n) is the same as O(m)
        • Procedure augment(f,P) takes time O(n) as the path P has at most n-1 edges
          • given the new flow f', we can build the new residual graph in O(m) time

Personal Thoughts

This section was not too difficult to understand. I think once you understand the ideas behind network flow, it is very easy to understand how they work. It also helped that we covered this in class yesterday, so phrasing that may have been confusing before was actually pretty clear and easy to understand. Some of the proofs were a little hard to understand, but that is pretty normal and I think more practice will help solidify the ideas of this section!

Readability: 7.0 Interesting: 6.5


7.2 Maximum Flows and Minimum cuts in a Network

Analyzing the Algorithm: Flows and Cuts

  • Goal: show that the flow that is returned by the Ford-Fulkerson Algorithm has the maximum possible value of any flow in G
  • Use the notion o a cut to develop a much more general means of placing upper bounds on the maximum-flow value
  • If we divide the nodes into two sets: A and B (s in A, t in B)
    • all the flow must cross from A to B somewhere
  • s-t cut is a partition (A,B) of the vertex set V so that s is in A and t is in B
  • capacity of a cut (A,B): c(A,B) → sup of the capacities of all edges
  • Let f be any s-t flow and (A,B) any s-t cut. Then v(f) = fout(A) - fin(A).
    • by watching the amount of flow f sends across a cut, we can exactly measure the flow value (amount that leaves A - the amount that swirls back into A)
      • Proof: fin(s) = 0, as source s has no entering edges

  • Let f be any s-t flow, and (A,B) any s-t cut. Then v(f) = fin(B) -fout(B)
    • value of flow in terms of sink: fin(t), the amount of flow arriving at the sink.
  • Let f be any s-t flow, and (A,B) any s-t cut. Then v(f) ⇐ c(A,B)
    • The value of every flow is upper-bounded by the capacity of every cut
      • If we exhibit any s-t cut in G of some value c*, we know that there cannot be an s-t flow in G of value greater than c*.

Analyzing the Algorithm: Max-Flow Equals Min-Cut

  • f+ denotes the flow that is returned by the Ford-Fulkerson Algorithm
  • want to show that f+ has the maximum possible value of any flow i G
  • If f is an s-t flow such that there is no s-t path in the residual graph Gf, then there is an s-t cut (A*,B*) in G for which v(f) = c(A*B*). Consequently, f has the maximm value of any flow in G, and (A*,B*) has the minimum capacity of any s-t cut in G
    • A* denotes the set of all nodes v in G for which there is an s-v path in Gf
    • B* denotes the set of all other nodes: B* = V - A*

  • All edges out of A* are saturated with flow
  • All edges into A* are completely unused, so:

  • The flow f+ returned by the Ford-Fulkerson Algorithm is a maximum flow
  • Given a flow f of maximum value, we can compute an s-t cut of minimum capacity in O(m) time
    • construct the residual graph Gf, perform breadth-first search/depth-first search, define B* = V - A*, return the cut (A*,B*)
  • In every flow network, the maximum value of an s-t flow is equal to the minimum capacity of an s-t cut

Further Analysis: Integer-Valued Flows

  • If all capacities in the flow network are integers, then there is a maximum flow f for which every flow value f(e) is an integer
    • Not every maximum flow is integer-valued, only some maximum flow has this property
  • Real Numbers as Capacities?
    • allowing capacities to be rational numbers does not make the situation any more general, since we can determine the least common multiple of all capacities, and multiple them all by this value to obtain an equivalent problem with integer capacities.
    • If real numbers are capacities: concern is that the value of our flow keeps increasing, but in increments that become arbitrarily smaller and smaller; no guarantee that the number of iterations of the loop is finite
    • Capacities in any practical application of network flow would be integers or rational numbers
      • The problem of pathological choices for the augmenting paths can manifest itself even with integer capacities.

Personal Thoughts

This section makes a lot of sense, again, because we began our discussion on this chapter in class on Friday. I think most of the ideas are logical, but some take a little longer to understand than others. The idea of having real numbers as capacities is a little confusing for me, especially because of the way that the section leaves off. The section ends by saying that there can be problems with integer capacities, not just with rational number capacities. I'd like to know more about why that is and what the solution to it is.

Readability: 6.5 Interesting: 6.5


7.5 A First Application: The Bipartite Matching Problem

Analyzing the Algorithm: Flows and Cuts

The Problem

  • Bipartite Graph G = (V,E) is an undirected graph whose node set can be partitioned as V = X union Y, with the property that every edge e in E has one end in X and the other in Y
  • Matching M in G is a subset on the edge M in E such that each node appears in at most one edge in M

Designing the Algorithm

  • We construct a flow network G'
  • Direct all edges in G from X to Y
  • Add a node s, and an edge (s,x) from s to each node in X
  • add a node t, and an edge (y,t) from each node in Y to t
  • Give each edge in G' a capacity of 1
  • Compute a maximum s-t flow in the network G'

Analyzing the Algorithm

  • Suppose there is a matching in G consisting of k edges
  • Then consider the flow f that sends one unit along each path, that is f(e) = 1 for each ege on one of these paths
  • Suppose there is a flow f' in G' of value k
  • By the integrality theorem for maximum flows, we know there is an integer-valued flow f of value k
  • Since all capacities are 1, f(e) is equal to either 0 or 1 for each edge e
  • Consider the set M' of edges in the form (x,y) on which the flow value is 1
    • M' contains k edges
    • Each node in X is the tail of at most one edge in M'
    • Each node in Y is the head of at most one edge in M'
  • If we view M' as a set of edges in the original bipartite graph G, we get a matching of size k:
    • The size of the maximum matching in G is equal to the value of the maximum flow in G'; and the edges in such a matching in G are the edges that carry flow from X to Y in G'
  • Bounding the Running Time
    • The Ford-Fulkerson Algorithm can be used to find a maximum matching in a bipartite graph in O(mn) time
      • Consider the matching M consisting of edges in the bipartite graph
        • Let f be the corresponding flow in G'
        • Matching in not maximum, so f is not a maximum s-t flow, and hence there is an augmenting path in the residual graph G'f.
        • All augmenting paths must alternate between edged used backward and forward, as all edges of the graph G' go from X to Y
          • also known as alternating paths in the context of finding a maximum matching
        • Effect of this augmentation is to take the edges used backward out of the matching and replace them with the edges going forward.
          • Because the path goes from s to t, there is one more forward edge than backward edge (size of the matching increases by one)

Extensions: The Structure of Bipartite Graphs with No Perfect Matching

  • What if there is not a perfect matching?
  • We can decide if the graph G has a perfect matching by checking if the maximum flow in a related graph G' has at least n
    • By the Max-Flow Min-Cut Theorem, there will be an s-t cut of capacity less than n if the maximum-flow value in G' has value less than n
      • a cut with capacity less than n provides a “certificate” of no matching
  • If a bipartite graph G = (V,E) with two sides X and Y has a perfect matching, then for all A in X, we must have |Gamma(A)| >= |A|
    • Hall's Theorem
  • Assume that the bipartite graph G = (V,E) has two sides X and Y such that |X| = |Y|. Then the graph G either has a perfect matching or there is a subset A in X such that |Gamma(A)| < |A|.
    • A perfect matching or an appropriate subset A can be found in O(mn) time

Personal Thoughts

This section was more dense, so it was not quite as easy to read. I think this section spent a lot of time trying to prove theorems, and as a result, I had to spend more time processing and learning this section. However, on the whole, I think everything this section says made sense to me. I know I'll need some application practice in order to fully comprehend this section.

Readability: 6.0 Interesting: 6.0


courses/cs211/winter2018/journals/patelk/chapter7.1522509939.txt.gz · Last modified: by patelk
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0