Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
1 Network Flow
We continue considering network flow problems.
We consider the uncapacitated problem
min cT f
s.t. Af = b (1)
0 ≤ f.
In each iteration there is a dual feasible solution and the algorithm checks wether
there exists a direction d with p + θd is another feasible solution and dT b > 0.
Such a direction is called a dual ascent direction. It so happens that for the
search for such directions d we can concentrate on those that are of the form
½
1, if i ∈ S
di =
0, otherwise
i ∈ S and pi = cij + pj ⇒ j ∈ S.
In the book such arcs, for which equality holds in the dual restriction, are
called balanced arcs. According to complementary slackness, fij (cij + pj − pi ) =
0, ∀(i, j) ∈ A, these are the only arcs in an optimal primal solution that can
carry positive flow.
Now delete from Gst all arcs that are not balanced, yielding the network Gbalanced ,
that next to the auxiliary arc includes only balanced arcs.PSolve the max flow
problem on this network. If the max flow happens to be {i|bi >0} bi then we
1
have a feasible flow and a dual solution that satisfy the complementary slack-
ness conditions and therefore it is optimal. In this case, at termination the cut
found is just s since all the arcs going out of s are all saturated, used to their
full capacity.
Otherwise at termination, the max flow algorithm will give us a cut S, contain-
ing a subset of Q+ . The claim is that dS is a dual ascent direction.
Now,
X X X X X X
(dS )T b = bi + bj = bi + bj > fsi − |bj | = 0.
i∈S∩Q+ j∈S∩Q− i∈S∩Q+ j∈S∩Q− i∈S∩Q+ j∈S∩Q−
The strict inequality is due to the fact that i ∈ S ∩ Q+ implies that the arc (s, i)
is not saturated: fsi < bi .
pi + θ ≤ cij + pj , ∀i ∈ S, j ∈
/ S, (i, j) ∈ A.
We therefore choose
θ∗ = min {cij + pj − pi }.
i∈S, j ∈S,
/ (i,j)∈A
2
In doing so, at least one extra arc becomes balanced, and we start a new max
flow search in the larger graph. We continue the process until, either a flow
augmentation has been found, in which case we augment the flow and restart
the search for a new augmenting path, or no elementary dual ascent direction
is found, and we conclude optimality.
Assuming that the total supply (is total demand) is B, there are at most B
flow augmentations. In between two consecutive augmentations there can be at
most n dual updates (at most n nodes can become reachable), giving in total at
most nB dual updates. Straightforward calculation of θ∗ in each update would
cost O(m) making the total running time O(mnB).
Pn Pn
min i=1 j=1 cij fij
Pn
s.t. i=1 fij = 1, ∀j = 1, . . . , n
Pn
j=1 fij = 1, ∀i = 1, . . . , n
fij ≥ 0, ∀i, j
In fact we should restrict fij to be either 0 or 1 but we know already that the
optimal solution has integer values given integer right-hand side coefficients. I
remark, as in the book, that the maximization version of this problem with
cij ∈ {0, 1} is the bipartite matching problem.
The idea behind the auction algorithm stems from insights into the optimal dual
solution and the complementary slack conditions:
Pn Pn
max i=1 ri + j=1 pj
Dual :
s.t. ri + pj ≤ cij , ∀i, j,
3
implying ri = minj=1,...,n {cij − pj }.
implying that
Think of the persons as contractors who try to get a job and interpret pj as the
price paid to the person who will do job j. In this interpretation pj − cij is the
profit that person i makes if he gets assigned job j. Thus, in this interpretation,
according to complementary slack, if i gets assigned j, then j is amongst his
most profitable jobs. Indeed, if in the auction algorithm described below, we
would use for the price of each job j the optimal value of its dual variable pj
then the auction algorithm would give an optimal assignment. The main goal
behind the auction algorithm is to avoid the LP-computations and settle for a
much simpler iterative process of bidding to compute the optimal dual solution.
On the other hand ² > 0 makes that persons do not get the most profitable
jobs that they would get according to the complementary slack (CS) conditions.
However they get so almost. We say that ²-CS holds for all assigned persons if
each of them gets a job, the profit of which is within ² from the best profit.
Theorem 1.2 (Theorem 7.14 in [B&T]) In each step of the algorithm all
persons assigned satisfy ²-CS.
Proof. The algorithm starts with some initial universal price P , e.g. equal to
maxi,j cij . Notice that the actual value of P is unimportant (as before), but we
may like to work with positive profits. Initially no persons are assigned and the
4
theorem certainly holds.
After bidding, if person i gets assigned job j, then pj is set to pj = maxk6=j {pk −
cik } + cij − ² ⇒ pj − cij ≥ maxk6=j {pk − cik } + cij − ². Changes in prices of other
jobs in the same round keep the statement true since prices are only lowered.
If in a round job j remains in i’s hands then there is no new bid on job j and
hence the price remains the same. 2
Let us assume, w.l.o.g. that the algorithm starts with equal initial price for all
jobs: let us take P = maxi,j cij .
(a) Once a job has received a bid it will always remain assigned to some person.
This means that the algorithm stops at the moment the last job gets a bid.
(b) If the algorithm would not terminate, then some job, k say, never gets a
bid, i.e. remains having value P . But in each round the price of some job is
decreased by at least ². Hence after 1 + (n − 1)P/² rounds at least one job must
have negative profit, whereas job k has still non-negative profit for all persons,
contradicting that it did not receive a bid.
Thus indeed the algorithm terminates after O(n maxi,j cij /²) bidding rounds.
Each bidding round requires determination of the most profitable and the second
most profitable job for each unassigned person, which in its most straightforward
implementation takes O(n2 ). In total the running time is O(n3 maxi,j cij /²).
A nice property is that if we choose ² small enough, and in fact ² = 1/n is small
enough, then the auction algorithm produces an optimal assignment, provided
that the costs-coefficients are integer value (Theorem 7.16 in [B&T]). The proof
is straightforward from Theorem 7.14 (proved above).
Exercises of Week 7
7.28, 7.29, 7.32 and you may try 7.30.
Next time
Chapter 8