Você está na página 1de 3

CSC373 Algorithm Design, Analysis, and Complexity Spring 2012

Solutions for Assignment 3: Network Flow

1. Critical Edges. For all parts below, let f be an integer-valued maximum ow on the network G = (V, E, c). Let this max ow value be (f ) = F , and let Gf be the residual graph. From the proof of the min-cut maxow theorem and the denition of A0 , it follows that (A0 , V \A0 ) is a minimum s-t cut of G with capacity cap(A0 , V \A0 ; G) = F . Here and below we use the notation cap(. . . ; G) and cap(. . . ; G ) to denote which ow problem G or G we are referring to. By the construction of the new ow problem G , it follows that (A0 , V \A0 ) is an s-t cut in the graph G , with / cap(A0 , V \A0 ; G ) F + 1. Moreover, the equality is satised here i u0 A0 and v0 A0 . Note that this s-t cut may or may not be minimal, as we see below. 1a) True. We prove this by contradiction. That is, suppose that (A, B) is an s-t min cut of G, with cap(A, B) = F . Suppose e0 = (u0 , v0 ), and it is not the case that u0 A and vo B. Recall that, by the denition of cut capacity, only the edges from A to B contribute to the capacity cap(A, B; G ). Since the only edge with modied capacity in G is e0 , and we are assuming e0 does not go from A to B, it follows that cap(A, B; G ) = cap(A, B; G) = F . Therefore the value of any ow on G must be bounded above by F , and cannot have increased by one. This contradicts the statement that e0 is a critical edge. 1b) True. The proof follows by construction, as follows. Note that since u0 A0 , we have u0 is reachable in the residual graph Gf . Therefore at least one more unit of ow could be placed on a s u0 path (ignoring, for the minute, the rest of the path to t). Similarly, since v0 B1 , the sink vertex t must reachable from v0 in the residual graph Gf . Therefore at least one more unit of ow could be placed on a v0 t path. Moreover, in the new ow problem G , the edge e0 = (u0 , v0 ) has the capacity c (e0 ) = c(e0 ) + 1 , and therefore one additional unit of ow could be placed on e0 in the new problem. Taken together, this gives a s u0 v0 t augmenting path on Gf , over which the ow can be increased by one. Therefore the value of this augmented ow f on G is F + 1. Since we showed in the preamble to this problem that cap(A0 , V \A0 ; G ) F + 1, this must be a maximum ow. 1c) True. The statement is equivalent to stating that if eo is critical then u0 A0 and vo B1 . We prove the contrapositive statement, namely that, if it is not the case that both u0 A0 and vo B1 , then e0 is not critical. We consider two cases. / Suppose u0 A0 . Consider the s-t cut (A0 , V \A0 ). Note the cut capacity cap(A0 , V \A0 ; G ) only involves the capacity of edges from A0 to V \A0 , none of which can be edge e0 = (u0 , v0 ). Therefore all edges in this cut have identical capacities to the corresponding edges in G, so cap(A0 , V \A0 ; G ) = cap(A0 , V \A0 ; G) = F . Therefore the value of the ow of both problems is bounded above by F . This shows e0 cannot be a critical edge. / Similarly, if v0 B1 , consider the s-t cut (V \B1 , B1 ). A similar argument shows that cap(V \B1 , B1 ; G ) = F , and therefore e0 cannot be a critical edge. 2. Greedy Flow in Jot Networks. The Jot-algorithm must terminate (with an integer valued ow) since it adds at least one to the ow each iteration, and an upper bound for the ow is cap({s}, V \{s}) < . To show that the algorithm terminates with a maximum ow, we follow the same idea as the proof of the Max-Flow Min-Cut Thm in the Network Flow lecture notes (p.28). That is, we wish to prove the following result: Lemma: Suppose f is a feasible ow on a Jot network G. Then the following are all equivalent: i) There exists a s-t cut (A, B) such that (f ) = cap(A, B).

ii) Flow f is a max ow. iii) There is no Jot-augmenting path P relative to f . That is, there is no s to t path P in G for which each edge e in P has a ow f (e) < c(e). (The key modication here from the Ford-Fulkerson alg. is that we are not considering the residual graph Gf , but rather only forward edges that are unsaturated.) The fact that the Jot algorithm terminates at a maximum ow follows from the lemma (which we prove below). In particular, the algorithm termination implies (iii) which, according to the lemma, is equivalent to (i). Then, by (i) and the min-cut max-ow theorem, we can conclude the ow must be maximal. Pf of Lemma: The same arguments in the lecture notes (p.29) apply here and show that both (i) implies (ii), and (ii) implies (iii). The key step is to show that (iii) implies (i) for this case. When the Jot-algorithm terminates, (iii) must be satised. Dene A to be the set of vertices in G that are reachable from s via paths on edges e that are not saturated, that is, along edges e E such that f (e) < c(e). We dene s to be reachable from itself. Let B = V \A. Then, s A. Moreover, by (iii), t A. Therefore / (A, B) is an s-t cut. By the Flow Value Lemma (lecture notes, p.14), (f ) equals the net ow out of A, namely Nf (A). This net ow consists of the dierence of two terms, the rst being the sum of the ows on all edges e = (u, v) with u A and v B. By the denition of A, these edges must all be saturated, so this term equals C =
e=(u,v)E,uA,vB

c(e) = cap(A, B).

(1)

The second term in the dierence Nf (A) is the sum of ows on edges from B to A. We use contradiction to show that, for a Jot-network, no such edge can exist. Suppose e = (u, v) is such an edge with u B and v A. Note that, since v A, v must be reachable in G from s using only edges that are not saturated by the ow f . Also s has no incoming edges, so v cannot be s. And since v A, v cannot be t. Therefore v is a non-root vertex in the tree Gt (dened in the problem handout). By the directed tree property of Gt , v must have a unique incoming edge, say (w, v) E. We now arrive at the following contradiction. First w must be in A, since w is on the unique path from s to v, and v is in A. Second, w must equal u, where the edge e = (u, v) is as described in the previous paragraph, since v has a unique incoming edge. But that means w B, which contradicts A B = { }. Therefore there cannot be any edges from B to A. It follows that the net ow Nf (A) equals C in equation (1) above. Therefore, we have cap(A, B) = C = Nf (A) = (f ), as desired. This completes the proof of the lemma. 3. Sales Manager. Draw a bipartite graph, with vertices {pn }N for sales people on the left, and vertices n=1 for cities c C on the right. Let M be an integer bigger than the total number of hours the sales sta is N willing to work, so M > n=1 hn cC Hc . In addition, we dene the following edges and capacities. For each n = 1, . . . , N , and each c Dn , there is a directed edge (pn , c) E with capacity M . Add a source node s, with no incoming edges, and the only outgoing edges are those to each pn . The edge (s, pn ) has capacity equal to sales person pn s maximum number of hours, hn . Add a sink node t, with no outgoing edges, and the only incoming edges are from each c C. The edge (c, t) has capacity equal to the demand, Hc , of city c. This completes the denition of the network ow problem G = (V, E, c). Let f (e) be an integer-valued maximum ow on G. First, suppose the value of this maximum ow satises v(f ) = cC Hc . We claim that in this case our algorithm should return the empty set, S = { }. To show this, note cC Hc is the capacity of the s-t cut 2

(A1 , B1 ) with B1 = {t} and A1 = V \B1 , so v(f ) = cC Hc implies each edge into t must be saturated by the ow f . Therefore the ow f provides a feasible assignment of hours from sales people to cities and, in this case, we can return the empty set of cities, S = { }. Note that cC Hc = cap(A1 , B1 ), so the only other possibility for the value of the max ow is for (f ) < cap(A1 , B1 ). In this case it follows that the demands of all the cities cannot be met by the distribution of the sales sta (otherwise we would have found a larger max ow). So we need to determine a suitable non-empty set S to return. Use the above max ow f to compute a min s-t cut (A, B), using the approach described in the lecture notes (i.e., dene A to be the set of vertices reachable from s in Gf ). In this case, (f ) = cap(A, B) < cap(A1 , B1 ) = cC Hc . Moreover, by the construction of the graph G, we have A = {s, PA , CA }, B = {t, PB , CB } (2)

where the set of all sales people is the disjoint union of PA and PB and the set of all cities C is the disjoint union of CA and CB . Claim: If the value of max-ow satises v(f ) < cC Hc , then the set S = CB satises inequality (1) of the assignment handout. That is, the desired algorithm can return CB as the set S. Pf: Let (A, B) be a min s-t cut, as in (2). For any two disjoint subsets of vertices I and J, we abuse notation and dene cap(I, J) = (u,v)E,uI,vJ c(u, v), which is sum of the capacity of edges from I to J. (This generalizes the denition of capacity to any pair of disjoint sets of vertices.) Since the only edges in the graph G are either from s to sales sta, sales sta to city, or city to t, we have: cap(A, B) = cap({s, PA , CA }, {PB , CB , t}) = cap({s}, PB ) + cap(PA , CB ) + cap(CA , {t}) <
cC

(3)

Hc .

Here we have used the fact that, by the denition of capacity, edges from PB to CA do not contribute cap(A, B). With the construction of the graph G, the sales sta to city edges (where they exist) have capacities M > cC Hc , so none of these edges can be in the minimum cut (A, B). That is cap(PA , CB ) = 0. This means that no sales sta in PA has a city c CB in their district. In other words, all the sales sta who have cities in CB in their districts must be in PB . For for any city c, the capacity of the edge (c, t) is Hc , and therefore cap(CA , {t}) =
cCA

Hc =
cC

Hc
cCB

Hc .

Using this and cap(PA , CB ) = 0 in equation (3), we have: Hc > cap(A, B) = cap({s}, PB ) +
cC cC

Hc
cCB

pc .

Or, equivalently, Hc > cap({s}, PB ) =


cCB nPB

hn .

Recall that we have shown that all sales people pn with a city in CB in their district Dn must be in PB , and therefore PB contains the set of sales people summed over in the inequality (1) of the handout. Since the hours hn are non-negative, the desired inequality follows for S = CB . (Although we didnt need it here, we can show PB is exactly the set of sales people whose districts include at least one city in CB .)

Você também pode gostar