G. Plebanek M atP rogOpt no 6 May 15, 2021
1. Supplement to the previous list. Prove that if every vertex of bipartite graph G = (S, T, A) has the same degree d > 0 then there is a matching of the maximal size |S|.
2. The bottleneck problem. There are n workers and they work along the assembly line (e.g. producing cars). Let ai,j denote the effectiveness of the ith worker at the station number j. Suppose that we have assigned the ith worker to the station σ(i), using some permutation σ. Note that the efficiency of the whole process is then determined by
m(σ) = min
i¬n aiσ(i),
as the line must respect the slowest worker. So the problem is to find a permutation σ maximizing m(σ).
Consider some permutation σ (e.g. the constant one). To check if it is optimal consider a bipartite graph G = (T, S, A), where T = S = {1, 2, . . . , n} and we draw an arc (i, j) if aij > m(σ).
Prove that σ is not optimal if and only if there is a matching in G of size n. Design an algorithm solving the bottleneck problem.
3. The Ford-Bellman algorithm. Consider a directed graph G = (V, A), V = {1, 2, . . . , n}
with given lengths of arcs cij. Recall that the shortest path from any vertex i to a fixed destination n ∈ V can be detected once we know the table of shortest distances di from i to n. This can be done using (already discussed) Dijkstra’s algorithm; however, it works if cij 0 for every (i, j) ∈ A.
Sometimes we want to consider also negative lengths (imagine that cij is a price for the bus ticket from i to j and you have been promised to get double reimbursement for some travels). This can be done using the Ford-Bellman algorithm based on the following.
Let di(t) denotes the length of the shortest path from i to n using at most t arcs. Note that dn(t) = 0 for every t (we are already there); we put di(t) = ∞ if there are no path joining i and n by at most t arcs (in particular, di(0) = ∞ for i 6= n).
The main point is that di(t + 1) = min
k∈Out(i)(cik+ dk(t));
why? Check that this enables one to calculate the minimal distance di which is equal to di(n − 1). Note that this works even if some ‘distances’ are negative; we, however, need to assume that there are no cycles in the graph consisting of arcs of negative length.
4. The Floyd–Warshall algorithm. Consider the problem as above. Let dij(k) deno- tes the shortest distance from i to j that goes only through vertices {1, 2, . . . , k} (as intermmediate points of the travel). Prove that
dij(k + 1) = min (dij(k), di,k+1(k) + dk+1,j(k)) . How to design an algorithm for finding dij?
5. The caterer problem. A catering company provides ri table cloths to a restaurant on each of N consecutive days. New tablecloths can be bougth for the price p per item. The used ones can be send to the express laundry; it makes them unavailable for n days (the cost is l1 per item) or to the normal laundry; this makes them unaviable for next m days (m > n but the cost l2 is smaller).
At the beginning there are no tablecloths available. Find a network flow problem (in the form as in (6) below) that will decide about the optimal plan of delivery. Consider, in particular, the case N = 5, n = 1, m = 3.
Hint. You will need separate vertices vi and wi for clean and dirty tablecloths for the day number i.
6. The general network flow problem (GNFP). Recall that we consider a directed graph G = (V, A) together with a function V 3 i → bi ∈ R defining an external supply;
we assume Pibi = 0. We are also given a function c : A → R+, cij is the cost in the arc (i, j) ∈ A (no limit on capacities of the arc).
Recall that a flow f = (f (i, j))(i,j)∈A is feasible if 0 ¬ f (i, j) for every arc (i, j) ∈ A and Pj∈In(i)f (j, i) + bi = Pj∈Out(i)f (i, j) for every vertex i. We want to minimize
P
(i,j)∈Acijf (i, j) over all feasible flows.
Check that this is a linear problem in its standard form when we consider the incidence matrix M = (mij); its rows correspond to vertices and columns represent arcs. We put mij = 1 if the jth arc starts at i and mij = −1 if the jth arc ends at i; other entries are zero. Prove that M f = b.
7. Using the form of GNFP mentioned above (and general duality for linear problems) find the dual problem of GNFP.
8. Exercises on GNFP. Consider the network (with bi and cij given)
j
j j j
j
j
j j
~
3
W
- - -
+ s
a
b
c
d e h f
g
−3
1
−3 1 1 3
2
−1
6 2
4 1
2 −2
1 3
Find some spanning tree and the basic flow associated to it (feasible or not). Once you find some feasible basic flow, reduce the costs to see if it is optimal.