Massachusetts Institute of Technology Michel X. Goemans 18.433: Combinatorial Optimization Spring 2015 Solutions to problem set 5 5-2 Let G be any graph on the vertex set V . Let us define E = V and I = {S ⊆ E : S is covered by some matching M }. To prove (E, I) is a matroid, we need to verify two axioms. (I1 ) If Y ∈ I and X ⊆ Y then X ∈ I. If M is a matching covering Y , since X ⊆ Y , then M also covers X. By definition, X ∈ I. (I2 ) If X ∈ I and Y ∈ I and |Y | > |X| then there exists v ∈ Y \ X : X ∪ {v} ∈ I Let MX , MY be matchings covering X and Y , respectively. If there exists v ∈ Y \ X such that v is a vertex covered by MX , then clearly X ∪ {v} ∈ I. Then let us assume such vertex v does not exist. This assumption allows us to say that a vertex covered by both MX and MY is either in both X and Y , in X but not in Y , or in neither X nor Y . In other words, a vertex covered by MX and MY cannot be in Y \X. We wish to find a matching MX0 covering X ∪ {v}, for some v ∈ Y \X. Consider the edges in MX ∆MY . We know they form cycles or simple paths. Since |Y | > |X|, then some cycle or some path must have more vertices from Y than from X. In cycles, all vertices are covered by both MX and MY . As determined above, this implies that they cannot be in Y \X. Similarly, we see that the inner vertices of a path cannot be in Y \X. Thus, some path P has one of its endpoints v belonging to Y \X. It is thus clear that MX0 = MX 4P is a matching covering X ∪ {v}, for v ∈ Y \X, as desired. 5-5 It is easy to see that the first axiom is satisfied. For the second, consider the following bipartite graph: one set of vertices is A = ∪Ai and the other is B = {Ai : 1 ≤ i ≤ n}. A pair of vertices a ∈ A and Ai ∈ B forms an edge iff a ∈ Ai . There is a correspondence between partial transversals of the family of sets and matchings of the graph: given a matching, the corresponding partial transversal is given by all the vertices in A that have an edge of the matching incident to them. Consider two partial transversals X, Y such that |X| < |Y |, with associated matchings M and N . Consider the sets Y \ X and X \ Y and alternating paths in M 4N starting at vertices in Y \ X. Because of the cardinality condition we have that |Y \ X| > |X \ Y |, which implies that not all such alternating paths can end at vertices in X \ Y ; in other words, there exists a ∈ Y \ X such that the alternating path in M 4N starting from it ends at a vertex in B. Then X ∪ {a} is also a partial transversal, as we can augment the matching M by means of the alternating path starting at a. 5-7 It is easy to see that (E, I) satisfies the first axiom (I1 ) that if X ⊆ Y and Y ∈ I, then X ∈ I. For (I2 ), consider X, Y ∈ I and |Y | > |X|, in order to show the second Solutions to problem set 5 Spring 2015 2 axiom (I2 ), we need to show that there exists e ∈ Y \ X such that X ∪ {e} ∈ I. Let us call a set S ∈ F maximal in T ⊆ E, T 6= S, if S ⊂ T and S is not contained in any other element of F that is properly contained in T. Suppose that A1 , . . . , An are the maximal sets in E. Set A∗ = E\(A1 ∪ · · · An ). Since |Y | > |X|, we must have |Y ∩ A∗ | > |X ∩ A∗ |, or |Y ∩ Ai | > |X ∩ Ai | for some i. In case |Y ∩ A∗ | > |X ∩ A∗ |, there is an element e ∈ (Y ∩ A∗ ) ∈ (X ∩ A∗ ), and X ∪ {e} ∈ I. So we only need to study the case that |Y ∩ Ai | > |X ∩ Ai | for some i. Without lost of generality we may assume |Y ∩ A1 | > |X ∩ A1 |. Let B1 , . . . , Bm be the maximal sets in A1 and let B ∗ = A1 \(B1 ∪ . . . Bm ). Since |Y ∩ A1 | > |X ∩ A1 |, we have |Y ∩ B ∗ | > |X ∩ B ∗ | or |Y ∩ Bi | > |X ∩ Bi | for some i. Again if |Y ∩ B ∗ | > |X ∩ B ∗ |, there is an element e ∈ (Y ∩ A∗ ) ∈ (X ∩ A∗ ), and X ∪ {e} ∈ I. Otherwise we can repeat this process for Bi satisfying |Y ∩ Bi | > |X ∩ Bi |. Since the ground set E is finite, we can find the required e in finite number of steps, and we are done. 5-8 Let (j1 , j2 , ..., jk ) be a sequence of jobs ordered in increasing order on their deadlines, i.e., dj1 ≤ dj2 ≤ . . . ≤ djk . If they could not be completed in time, there must exist some i for which dji < i (because j1 will finish at time 1, j2 will finish at time 2, etc.) However, this would imply that dj1 , dj2 , ...dji < i. In other words, there are i jobs with deadline less than i; therefore at least i jobs need to be completed by the time i − 1. This implies that the sequence of jobs is infeasible. Thus the contrapositive of what we just proved is that if a sequence of jobs can be completed in some order, then they can be completed in order of their deadlines. Now we prove M is a matroid by checking the two axioms. I1 If Y ∈ I and X ⊂ Y , then X ∈ I. This is obvious: if a set of jobs can be completed in time, then a subset of the jobs can also be completed in time. I2 If X ∈ I, Y ∈ I and |Y | > |X| then ∃e ∈ Y \ X : X ∪ {e} ∈ I. Suppose both sets of jobs are scheduled in order of their deadlines and each job is scheduled as early as possible. Thus the kth job in X or in Y completes at time k. For X (the smaller of the two sets), let j ∈ X be the last job of X which completes at time precisely dj . If j does not exist, any job of Y \ X can be added to X. If j exists then X has precisely dj jobs whose deadline is at most dj : dj = {i ∈ X|di ≤ dj }. But by feasibility of Y , Y has at most dj jobs whose deadline is at most dj . This means that |{i ∈ Y |di > dj }| > {i ∈ X|di > dj }|. Thus we can find a e ∈ Y \X such that de > dj . To show I2, we claim that X ∪{e} ∈ I. Indeed, if it was not the case, we would have a job in X that is scheduled at its deadline, and this deadline is greater than dj , a contradiction with the definition of j. Solutions to problem set 5 Spring 2015 3 Finally, to find an optimal scheduling, consider the value of each job ji being its reward ci . The greedy algorithm in matroid M then finds the optimal configuration. To test if a set of jobs is feasible we simply schedule them by their deadlines and check whether each job is scheduled on time. Problem 5 Let us describe the exchange graph DM1 ,M2 (S) by in-neighbors and out-neighbors of a, b, c, d. We get δ + (a) = δ + (b) δ + (c) = δ + (d) δ − (a) = δ − (b) δ − (c) = δ − (d) = = = = {f, g, h, i}, {e, f, g, h, i}, {e, f, g, h}, {e, g, h, i}. Moreover, sources are f and i and sinks are e and h. Note that there is a path i → c → e, which is a shortest path from sources to sinks. Hence, S4{c, e, i} = {a, b, d, e, i} is a larger common independent set of M1 and M2 . Since each graph has six vertices, this is indeed maximum. 5-12 First, let us prove that the conditions are sufficient. Consider two independent set I1 and I2 such that (i) holds. Let f be the only element in I2 \ I1 , and consider the weight function c : E → R given by: if e ∈ I1 , 1, c(e) = 0, if e = f , −1, if e ∈ / I2 . For this cost, the only maximum weight independent sets are exactly I1 and I2 . Therefore I1 and I2 are adjacent. The case where (ii) holds is analogous. Now, assume that I1 and I2 satisfy (iii). For this case let f be the only element in I2 \ I1 and g be the only element in I1 \ I2 . Consider the weight function c : E → R given by: if e ∈ I1 ∩ I2 , 2, c(e) = 1, if e = f , or e = g −1, if e ∈ / I1 ∪ I2 . For this cost, the only maximum weight independent sets are exactly I1 and I2 , and so they are adjacent in the matroid polytope. Now let us prove that the conditions are necessary. Assume that I1 and I2 are a pair of adjacent independent sets and let c : E → R be a cost function that is maximized only by I1 and I2 . In particular note that c(e) ≥ 0 for every element in I1 ∪ I2 . Assume w.l.o.g. that |I1 | ≤ |I2 |. Solutions to problem set 5 Spring 2015 4 Case 1:|I2 | > |I1 |. By the exchange axiom (I3), there exists an element f ∈ I2 \ I1 such that I1 + f is an independent set and, by a previous observation, it has weight greater or equal than the weight of I1 . Since I1 is optimum it follows that so is I1 + f . Since I2 and I1 are the only optima, it follows that I2 = I1 + f . Therefore, (i) holds. Case 2: |I2 | = |I1 |. Let f be the element in I1 ∆I2 = I1 \I2 ∪I2 \I1 with minimum cost. Assume w.l.o.g. that f ∈ I1 . Clearly, I1 − f is an independent set and |I1 − f | < |I2 |. It follows that there exists an element g ∈ I2 \ I1 such that I1 − f + g is an independent set. By choice of f , c(I1 − f + g) = c(I1 ) − c(f ) + c(g) ≥ c(I1 ). But then I1 − f + g is also a maximum weight independent set. Since I2 and I1 were the only optimums, it follows that I2 = I1 − f + g, which implies that |I2 \ I1 | = |I2 \ I2 | = 1. To conclude that (iii) holds, we only need to show that I1 ∪ I2 6∈ I. But this is easy to see since, in other case, using that c(e) ≥ 0 for every e ∈ I1 ∪ I2 , we would have that c(I1 ∪ I2 ) ≥ c(I1 ). This implies that I1 ∪ I2 is another optimum (different from I1 and I2 ), which contradicts the adjacency condition of I1 and I2 .