




Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The maximum flow problem in combinatorial optimization, where given a directed graph with weighted edges, the goal is to find the maximum flow possible between a source vertex and a sink vertex. The concept of edge capacities, the single-source, single-sink graph, and the relationship between maximum flows and dipaths. An example of professors' teaching assignments is provided to illustrate the concept.
Typology: Study notes
1 / 8
This page cannot be seen from the preview
Don't miss anything!





Given a directed graph with weighted edges, we would like to know the maximum flow possible between two special vertices in the graph, the source vertex r and the sink vertex s; that is, we imagine some fluid being pumped from r through the graph to s, and we think of edge weights as capacities limiting the amount of fluid that may be pumped through that edge. We assume that an infinite supply is available at r, and that s can consume an infinite amount, so that only edge capacities (we will call the edge weights “capacities” from now on) limit flow through the graph. We also restrict all edge capacities and flows to integers, although in general the Max-Flow problem may be solved for any edge capacity and flow values. For example, we can solve Max-Flow by inspection for the following simple graph:
r
a 7 b 3
(^4) s
2
2
1
There are only two edges connected to s (eas, ebs), so the Max-Flow can not exceed the sum of these edges’ capacities (4 + 2 = 6). We can pump 4 to a through era without exceeding its capacity (7), and we can pump 2 to b without exceeding its capacity (3). With 4 available at a and 2 available at b, we can fill eas and ebs to capacity; therefore the Max-Flow = 6. Edge capacities may be = ∞; if so that edge will not limit flow. This fact can be used to transform a graph with more than one source or sink (or more than one of both) into a single-source, single-sink problem. We start with the graph below, in which u indicates an arbitrary edge capacity, and the dotted vertices and edges indicate some arbitrary subgraph between multiple source vertices r 1... r 3 and multiple sink vertices s 1... s 4 :
r_
r_
r_
u
u
u
s_
s_
s_
s_
u
u
u
u
If we add a “super-source” r and a “super-sink” s to the graph, and if we connect r to the sources and s to the sinks already in in the graph via infinite-capacity edges, we have the following single-source, single-sink graph (since flow is only limited by the finite-capacity edges from the previous graph, our Max-Flow solution for this graph would be the same as for the previous):
r
r_ inf
inf r_
r_
inf
s
u
u
u
s_ inf
s_2 (^) inf
s_
s_3 inf
inf
u
u
u
u
Suppose we have a list of professors and a list of courses in need of a professor for the coming semesters. The professors have indicated which of the courses they would be willing to teach. We would like to assign one course to each professor such that a) at most one professor is assigned to any course, and b) professors are only assigned to courses they would be willing to teach. We can model the problem as a directed graph so that the Max-Flow solution for that graph is the assignment solution we are looking for. First of all, we put professors on the left and courses on the right, with a (unit-capacity) directed edge from a professor to a course indicating the professor would be willing to teach the course:
Subramani
VanScoy
Shereshevsky
Montgomery
491 1
346
1
1 326
1 236 (^1336)
1
1
126
1
1 268
1
So we have an xe for every edge; that is, ~x assigns a number to every edge. We have stated above that for a flow k there must be k (r-s) dipaths, that xe is equal to the number of those dipaths using edge e. But what if we are given ~x by itself and want to know whether it represents a legitimate flow vector? The following condition must hold:
~x is a flow if: ∑ (xwv : w ∈ V, ewv ∈ E) −
(xvw : w ∈ V, evw ∈ E) = 0 , ∀v ∈ V \ {r, s}.
The amount coming into vertex w (the first
(.. .)) minus the amount going out (the second
must be zero—nothing can be stored in w. We call this “conservation of flow.” We call flows “feasible” if they satisfy the condition above, ~x values are positive, and no edge capacities are exceeded (the simplest feasible flow ~x = ~0):
~x is a feasible flow if:
~x is a flow, and 0 ≤ xvw ≤ uvw.
When given a flow ~x through some graph G, we represent the edges of G as (ue, xe), and we define f~x(v) as the net flow into vertex v; the net flow into s, f~x(s), is the flow we would like to maximize. Using this notation we formulate Max-Flow as a linear program:
max f~x(s) s.t. f~x(v) = 0, ∀v ∈ V \ {r, s} 0 ≤ xe ≤ ue
We can formulate Max-Flow as a linear program, but we would like to find a simpler way to solve it. With that in mind, we propose the following connection between the Pi dipaths and flow value k discussed above:
(Proposition 3.1 in the text [1, p.38])
(a) ∃ a family of (r-s) dipaths (P 1... Pk) such that |{i : Pi uses edge e}| ≤ ue, ∀e ∈ E if and only if (b) ∃ an integral feasible (r-s) flow of value k.
The proof that (a)⇒(b) should be obvious: we can use the left-hand side of the capacity limitation for each path Pi (|{.. .}| above) as the value for each xi in ~x, so that no edge’s capacity is exceeded and the sum of all xi’s = k. Now we must prove that (b)⇒(a). We are given an integral feasible flow value k. If k = 0, we have zero Pi’s and the proposition is trivial. If k ≥ 1, there must be at least one edge of at least unit-capacity coming into s. If that edge exists (we will call it evs), there must be at least one edge of unit capacity coming into its beginning vertex v, and there must be some edge coming into that edge’s beginning vertex, etc., all the way back to r. So if k ≥ 0 there must be at least one dipath Pi. We can eliminate that path from the graph and let k = k − 1. If k is still ≥ 0, we repeat the process again and again until k = 0. At that point we have eliminated k dipaths P 1... Pk. We note the following related lemma:
Lemma (which we will not prove here)
Every feasible flow is the sum of at most m flows.
We also note that a “maximum circulation” problem related to Max-Flow may be modeled by adding an edge from s back to r and extending the flow conservation condition to these vertices:
r
s
This edge added for Max Circulation problem.
Cut (for digraphs):
Given a set R ⊆ V, the set δ(R) = {evw : v ∈ R, w /∈ R} is called a “cut.”
So a cut is a set of edges beginning in R but ending outside of R (in R¯).
(r-s) Cut:
A cut δ(R) such that r ∈ R, s /∈ R.
And an (r-s) cut is a set of edges as defined above, with the extra stipulation that the graph is divided by the cut, so that r is in R and s is not.
Lemma (Proposition 3.3 in the text [1, p.40]):
Given an (r-s) cut δ(R) and any (r-s) flow ~x, we have x(δ(R)) − x(δ( R¯)) = f~x(s) (x(a set) = the sum of ~x values on edges in that set).
This lemma says that the total flow out of R minus the total flow into R = f~x(s). To prove the lemma, we first of all consider a graph divided into subgraphs R, R¯ \ {s}, and s:
The equation and illustration above apply to each vertex v from the set R¯ \ {s}. So we can sum up all of those equations (one for each vertex v ∈ R¯ \ {s}) and get
v∈ R¯{s} f~x(v), which is the first term from the previous equation (
f~x(v) + f~x(s) = f~x(s)). Summing all these vertices, we have:
∑ v∈ R¯{s} (^ f~x(v)^ ) =
v∈ R¯{s} (^
w∈R xwv^ −^ (
w∈R xvw^ +^
w∈ R¯{s} xvw^ +^ xvs) +^
w∈ R¯{s} xwv^ )
We stated earlier that for all v in R¯ \ {s},
f~x(v) = 0, since none of these vertices can store any flow. So this means that the two terms above pertaining to edges completely within R¯ \ {s} will cancel each other out:
∑ v∈ R¯{s} (^
w∈ R¯{s} xwv^ )^ −^
v∈ R¯{s} (^
w∈ R¯{s} xvw^ )^ =^0 After cancelling, we have: ∑ v∈ R¯{s} (^ f~x(v)^ )^ =^
v∈ R¯{s} (^
w∈R xwv^ −^ (
w∈R xvw^ +^ xvs)^ ) f~x(s) can be broken up in the following way:
f~x(s) =
v∈R xvs^ +^
v∈ R¯{s} xvs
We now have equalities for
f~x(v) and f~x(s), which we can substitue into
f~x(v) + f~x(s) = f~x(s): ∑ v∈ R¯{s} (^
w∈R xwv^ −^ (
w∈R xvw^ +^ xvs)^ )^ +^
v∈R xvs^ +^
v∈ R¯{s} xvs^ =^ f~x(s) The xvs terms cancel each other out, so that we have: ∑ v∈ R¯{s} (^
w∈R xwv^ −^ (
w∈R xvw)^ )^ +^
v∈R xvs^ =^ f~x(s) We can simply rename v in the third term above w: ∑ v∈ R¯{s} (^
w∈R xwv^ −^ (
w∈R xvw)^ )^ +^
w∈R xws^ =^ f~x(s) And simplify: ∑ v∈ R¯{s}, w∈R (^ xwv^ −^ xvw^ +^ xws^ )^ =^ f~x(s) These are the edges referred to in the lemma! The xwv ’s and xws’s together constitute the flow through the cut δ(R), and the xvw’s the flow through the cut δ( R¯). So we have proved the lemma.
Corollary (3.4 in the text [1, p.40]):
For any feasible flow ~x and any (r-s) cut, f~x(s) ≤ u(δ(R)).
The corollary states that the net flow into s cannot exceed the sum of the capacities of the edges in the (r-s) cut. This makes sense, since we we have just shown that the net flow into s is at most equal to the flow across the cut (it would be equal if there is no flow across the cut in the opposite direction—if δ R¯ = 0), which obviously can not exceed the sum of the capacities of edges in the cut.
Max-Flow Min-Cut Theorem
If G = 〈V, E, ~u〉 is a flow graph,
max {f~x(s) : ~x is a feasible flow} = min{u(δ(R)) : R is an (r-s) cut}
We note that in terms of linear programming, Max-Flow and Min-Cut are duals of each other. Before proving the theorem we need two definitions:
~x-Incrementing Path:
Given a flow ~x, a path p in a graph G is called “~x-incrementing” if
~x-Augmenting Path:
An (r-s) ~x-incrementing path is called ~x-augmenting path.
~x-augmenting paths are those paths from r to s through which the flow may be increased, through forward arcs whose flow is less than their capacity and through backward arcs whose flow is greater than zero (and may therefore be decreased). To prove the Max-Flow Min-Cut therorem, we let ~x be a Max-Flow. This means there is no ~x-augmenting path. If there were an ~x-augmenting path, the flow from r to s through that path could be increased, implying that the former flow ~x was not in fact the Max-Flow. There may be ~x-incrementing paths, however. We let R = {v : there is an ~x-incrementing path from r to v}. We note that s may not be part of R, but r must be part of R. It follows that {evw : v ∈ R, w /∈ R} is an (r-s) cut. And we know that the flow xvw (through edge evw ∈ δ(R)) must be equal to the capacity uvw, otherwise evw would make up part of an ~x-incrementing path, and we would put w in R. By the same reasoning all edges in δ( R¯) (those edges going from v ∈ R¯ to w ∈ R) must have flow xvw = 0. So we know that, for all edges in the cut δ(R), xvw = uvw; and for all edges in the cut δ( R¯), xvw = 0. From the previous theorem, we know:
~x(δ(R)) − ~x(δ( R¯)) = f~x(s)
If we substitute u(δ(R)) for ~x(δ(R)) and 0 for ~x(δ( R¯)), we have proved the theorem:
u(δ(R)) = f~x(s)
References
[1] William Cook, William H. Cunningham, William Pulleyblank, and Alexander Schrijver. Combinatorial Optimization. John Wiley & Sons, 1998.