$24
Graded
1. (15 pts) You are given the following graph G. Each edge is labeled with the capacity of that edge.
A
3
C
3
2
S
5
T
1
3
4 2
B D E
(a) Draw the residual graph Gf using the Ford-Fulkerson algorithm cor-responding to the max ow. You do not need to show all intermediate steps.
(b) Find the max- ow value and a min-cut.
2. (40 pts) USC students return to in person classes after a year long interval. There are k in-person classes happening this semester, c1, c2, ..., ck. Also there are n students, s1, s2, ..., sn attending these k classes. A student can be enrolled in more than one in-person class and each in-person class consists of several students.
(a) Each student sj wants to sign up for a subset pj of the k classes. Also, a student needs to sign up for at least m classes to be considered as a full time student. (Given: pj m) Each class ci has capacity for at most qi students. We as school administration want to nd out if this is possible. Design an algorithm to determine whether or not all students can be enrolled as full time students. Prove the correctness of the algorithm.
(b) If there exists a feasible solution to part (a) and all students register in exactly m classes, the student body needs a student representative from each class. But a given student cannot be a class representative for
1
more than r (where r < m) classes which s/he is enrolled in. Design an algorithm to determine whether or not such a selection exists. Prove the correctness of the algorithm. (Hint: Use part (a) solution as starting point)
3. (12 pts) The following statements may or may not be correct. For each statement, if it is correct, provide a short proof of correctness. If it is incorrect, provide a counter-example to show that it is incorrect.
(a) If each directed edge in a network is replaced with two directed edges in opposite directions with the same capacity and connect-ing the same vertices, then the value of the maximum ow remains unchanged.
(b) In the capacity-scaling algorithm, an edge e can be present in the residual graph Gf (D) in at most one D-scaling phase.
(c) If all edges are multiplied by a positive number ’k’ then the min-cut remains unchanged.
(d) Suppose the maximum (s,t)- ow of some graph has value f. Now we increase the capacity of every edge by 1. Then the maximum (s,t)- ow in this modi ed graph will have value at most f + 1.
4. (13 pts) You are given a ow network with unit-capacity edges: it consists of a directed graph G = (V, E) with source s and sink t, and ue = 1 for every edge e. You are also given a positive integer parameter k. The goal is delete k edges so as to reduce the maximum s t ow in G by as much as possible. Give a polynomial-time algorithm to solve this problem. In other words, you should nd a set of edges F E so that jF j = k and the maximum st ow in the graph G’ = (V, E-F) is as small as possible. Give a polynomial-time algorithm to solve this problem. What happens when the edges don’t have unit capacity?
Ungraded
5. A tourist group needs to convert their USD into various international currencies. There are n tourists t1, t2, ..., tn and m currencies c1, c2, ..., cm. Tourist tk has Fk Dollars to convert. For each currency cj , the bank can convert at most Bj Dollars to cj . Tourist tk is willing to trade as much as Skj of his Dollars for currency cj .(For example, a tourist with 1000 dollars might be willing to convert up to 200 of his USD for Rupees, up to 500 of his USD for Japanese’s Yen, and up to 200 of his USD for Euros). Assuming that all tourists give their requests to the bank at the same time, design an algorithm that the bank can use to satisfy the requests (if it is possible).
2
6. Trip Trillionaire is planning to give potential buyers private showings of his estate, which can be modeled as a weighted, directed graph G containing locations V connected by one-way roads E. To save time, he decides to do k of these showings at the same time, but because they were supposed to be private, he doesn’t want any of his clients to see each other as they are being driven through the estate.
Trip has k grand entrances to his estate, A = fa1; a2; :::; akg V . He wants to take each of his buyers on a path through G from their starting location ai to some ending location in B = fb1; b2; :::; bkg V , where there are spectacular views of his private mountain range.
Because of your prowess with algorithms, he hires you to help him plan his buyers’ visits. His goal is if there exists a path for each buyer i from the entrance they take, ai, to any ending location bj such that no two paths share neither any edges nor any of the locations, and no two buyers end in the same location bj . Prove the correctness of the algorithm.
7. A vertex cover of an undirected graph G = (V; E) is a subset of the vertices A V such that for every edge e 2 E, at least one of its incident vertices is in A (that is every edge has at least one of its ends in A). Design an algorithm that takes a bipartite graph G0 and a positive integer k, and decides if G0 has a vertex cover of size at most k.
3