组合数学 (Fall 2011)/Flow and matching
Contents
Flow and Cut
Flows
An instance of the maximum flow problem consists of:
- a directed graph ;
- two distinguished vertices (the source) and (the sink), where the in-degree of and the out-degree of are both 0;
- the capacity function which associates each directed edge a nonnegative real number called the capacity of the edge.
The quadruple is called a flow network.
A function is called a flow (to be specific an - flow) in the network if it satisfies:
- Capacity constraint: for all .
- Conservation constraint: for all .
The value of the flow is .
Given a flow network, the maximum flow problem asks to find the flow of the maximum value.
The maximum flow problem can be described as the following linear program.
Cuts
Definition - Let be a flow network. Let . We call an - cut if and .
- The value of the cut (also called the capacity of the cut) is defined as .
A fundamental fact in flow theory is that cuts always upper bound flows.
Lemma - Let be a flow network. Let be an arbitrary flow in , and let be an arbitrary - cut. Then
- ,
- that is, the value of any flow is no greater than the value of any cut.
- Let be a flow network. Let be an arbitrary flow in , and let be an arbitrary - cut. Then
Proof. By the definition of - cut, and . Due to the conservation of flow,
On the other hand, summing flow over edges,
Therefore,
Augmenting paths
Definition (Augmenting path) - Let be a flow in . An augmenting path to is a sequence of distinct vertices , such that
- ;
- and each pair of consecutive vertices in corresponds to either a forward edge or a reverse edge , and
- when corresponds to a forward edge , and
- when corresponds to a reverse edge .
- If , we simply call an augmenting path.
- Let be a flow in . An augmenting path to is a sequence of distinct vertices , such that
Let be a flow in . Suppose there is an augmenting path , where and . Let be a positive constant satisfying
- for all forward edges in ;
- for all reverse edges in .
Due to the definition of augmenting path, we can always find such a positive .
Increase by for all forward edges in and decrease by for all reverse edges in . Denote the modified flow by . It can be verified that satisfies the capacity constraint and conservation constraint thus is still a valid flow. On the other hand, the value of the new flow
- .
Therefore, the value of the flow can be "augmented" by adjusting the flow on the augmenting path. This immediately implies that if a flow is maximum, then there is no augmenting path. Surprisingly, the converse is also true, thus maximum flows are "characterized" by augmenting paths.
Lemma - A flow is maximum if and only if there are no augmenting paths.
Proof. We have already proved the "only if" direction above. Now we prove the "if" direction. Let . Clearly , and since there is no augmenting path . Therefore, defines an - cut.
We claim that
- ,
that is, the value of flow approach the value of the cut defined above. By the above lemma, this will imply that the current flow is maximum.
To prove this claim, we first observe that
- .
This identity is implied by the flow conservation constraint, and holds for any - cut .
We then claim that
- for all ; and
- for all .
If otherwise, then the augmenting path to apending becomes a new augmenting path to , which contradicts that includes all vertices to which there exist augmenting paths.
Therefore,
- .
As discussed above, this proves the theorem.
Max-Flow Min-Cut
The max-flow min-cut theorem
Max-Flow Min-Cut Theorem - In a flow network, the maximum value of any - flow equals the minimum value of any - cut.
Proof. Let be a flow with maximum value, so there is no augmenting path.
Again, let
- .
As proved above, forms an - cut, and
- ,
that is, the value of flow equals the value of cut .
Since we know that all - flows are not greater than any - cut, the value of flow equals the minimum value of any - cut.
Flow Integrality Theorem
Flow Integrality Theorem - Let be a flow network with integral capacity . There exists an integral flow which is maximum.
Proof. Let be an integral flow of maximum value. If there is an augmenting path, since both and are integral, a new flow can be constructed of value 1+the value of , contradicting that is maximum over all integral flows. Therefore, there is no augmenting path, which means that is maximum over all flows, integral or not.
Applications: Menger's theorem
Given an undirected graph and two distinct vertices , a set of edges is called an - cut, if deleting edges in disconnects and .
A simple path from to is called an - path. Two paths are said to be edge-disjoint if they do not share any edge.
Theorem (Menger 1927) - Let be an arbitrary undirected graph and be two distinct vertices. The minimum size of any - cut equals the maximum number of edge-disjoint - paths.
Proof. Construct a directed graph from as follows: replace every undirected edge that by two directed edges and ; replace every undirected edge by , and very undirected edge by . Then assign every directed edge with capacity 1.
It is easy to verify that in the flow network constructed as above, the followings hold:
- An integral - flow corresponds to a set of - paths in the undirected graph , where the value of the flow is the number of - paths.
- An - cut in the flow network corresponds to an - cut in the undirected graph with the same value.
The Menger's theorem follows as a direct consequence of the max-flow min-cut theorem.
Applications: König-Egerváry theorem
Let be a graph. An edge set is called a matching if no edge in shares any vertex. A vertex set is called a vertex cover if for any edge , either or .
Theorem (König 1936) - In any bipartite graph , the size of a maximum matching equals the size of a minimum vertex cover.
We now show how a reduction of bipartite matchings to flows.
Construct a flow network as follows:
- where and are two new vertices.
- For ever , add to ; for every , add to ; and for every , add to .
- Let for every and for every . Let for every bipartite edges .
Lemma - The size of a maximum matching in is equal to the value of a maximum - flow in .
Proof. Given an integral - flow in , let . Then must be a matching since for every . To see this, observe that there is at most one that , because of that and conservation of flows. The same holds for vertices in by the same argument. Therefore, each flow corresponds to a matching.
Given a matching in bipartite graph , define an integral flow as such: for , if and if otherwise; for , if for some and if otherwise; for , if for some and if otherwise.
It is easy to check that is valid - flow in . Therefore, there is an one-one correspondence between flows in and matchings in . The lemma follows naturally.
We then establish a correspondence between - cuts in and vertex covers in .
Suppose is an - cut in .
Lemma - The size of a minimum vertex cover in is equal to the value of a minimum - cut in .
Proof. Let be an - cut of minimum capacity in . Then must be finite since gives us an - cut whose capacity is which is finite. Therefore, no edge has and , i.e., for all , either or . Therefore, is a vertex cover in , whose size is
- .
The last term is the capacity of the minimum - cut .
The König-Egerváry theorem then holds as a consequence of the max-flow min-cut theorem.