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
One of the oldest problems in combinatorial algorithms: determining the size of the largest matching in a bipartite graph G
7.1 The Maximum-Flow Problem and the Ford-Fulkerson Algorithm
The Problem
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
Designing the Algorithm
result of augment(f, P) is a new flow f' in G, obtained by increasing and decreasing the flow values on edges of P
Ford-Fulkerson Algorithm:
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
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)
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).
Let f be any s-t flow, and (A,B) any s-t cut. Then v(f) = fin(B) -fout(B)
Let f be any s-t flow, and (A,B) any s-t cut. Then v(f) ⇐ c(A,B)
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
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
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
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
If we view M' as a set of edges in the original bipartite graph G, we get a matching of size k:
Bounding the Running Time
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
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|
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|.
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
7.7 Extensions to the Maximum-Flow Problem
The Problem: Circulations with Demands
set S of sources generating flow and set T of sinks that can absorb flow
Consider a problem where sources have fixed supply values and sinks have fixed deman values
goal: ship flow from nodes with available supply to those with given demands
Associated with each node v in V is a demand dv
If dv > 0, the node v has a demand of dv for flow
Node is a sink and it wishes to receive dv units more flow than it sends out
If dv < 0, the node v has a supply of -dv; the node is a source and it wishes to send out -dv units more flow than it receives
If dv = 0: node v is neither a source nor a sink
S: set of all nodes with negative demand
T: set of all nodes with positive demand
Circulation with demands {dv} is a function f that assigns a nonnegative real number to each edge and satisfies the following two conditions:
Capacity: for each e in E, we have 0 ⇐ f(e) ⇐ ce
Demand: for each v in V, we have v, fin(v)-fout(v) = dv
Feasibility Problem: does there exist a circulation that meets the two conditions above?
If there exists a feasible circulation with demands {dv}, then sum of the demands = 0
Designing and Analyzing an Algorithm for Circulations
We can reduce the problem of finding a feasible circulation with demands {dv} to the problem of finding a maximum s-t flow in a different network
We attach a “super-source” s* to each node in S and a “super-sink” t* to each node in T
create a graph G' from G by adding new nodes s* and t* to G
for each node v in T, we add an edge (v,t*) with capacity dv
for each node u in S, we add an edge (s*, u) with capacity du
carry the remaining structure of G over to G' unchanged
Can think of this reduction as introducing a node s* that “supplies” all the sources with their extra flow, and a node t* that “siphons” the extra flow out of the sinks.
There cannot be an s*-t* flow in G' of value greater than D, since the cut (A,B) with A ={s*} only has capacity D
There is a feasible circulation with demands {dv} in G if and only if the maximum s*-t* flow in G' has value D. If all capacities and demands in G are integers, and there is a feasible circulation, there there is a feasible circulation that is integer-valued
The graph G has a feasible circulation with demands {dv} if and only if for all cuts (A,B), the sum of for all v in B of dv ⇐ c(A,B).
The Problem: Circulations with Demands and Lower Bounds
To force the flow to make use of certain edges, we can enforce lower bounds on edges
G=(V,E) with a capacity of ce and a lower bound le on each edge e
-⇐ le ⇐ ce for each e
each node v also has a demand dv (positive or negative)
all are integers
circulation in flow network must satisfy two conditions:
Capacity: for each e in E, we have le⇐f(e)⇐ce
Demand: for every v in V, we have fin(v)-fout(v) = dv
Designing and Analyzing an Algorithm with Lower Bounds
Reduce this to the problem of finding a circulation with demands but no lower bounds
On each edge e, we need to sent at least le units of flow
Initial circulation: f0(e) = le
If Lv = dv, where Lv is quantity, then we have satisfied the demand condition at v
If not, then we need to superimpose a circulation f1 on top of f0 that will clear the remaining “imbalance” at v
There is a feasible circulation in G if and only if there is a feasible circulation in G'
If all demands, capacities, and lower bounds in G are integers and there is a feasible circulation, then there is a feasible circulation that is integer-valued.
Personal Thoughts
This section took the concept of network flows to the next level by bringing in other variations/extensions of the original problem. While the overarching problems made sense, I got bogged down in a lot of the terminology and new factors that were added in. I think I need to reread this section one more time after we go over it in class to fully grasp the concepts presented in this section.
Readability: 5.5
Interesting: 5.5