This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: UNIVERSITY OF WATERLOO
MIDTERM EXAMINATION
SPRING TERM 2006 Surname: M First Name:
Name:(Signature) ‘ Id.#: Course Number C&O 351 I
Course Title Network Flows Instructor Professor Bertrand Guenin Date of Exam June 13th, 2006 Time Period 5:00 PM — 7:00 PM and 7:00 PM  9:00 PM
Number of Exam Pages (including cover page) 11+1 pages
Exam Type Closed Book Additional Materials Allowed Value Mark Awarded
2 14
3 l4
_____l_
4 20
5 16
6 20
Total 1 00 1 Exercise 1. (16pts) You just moved to Waterloo and bought a new car. You will need to have a car during
each of the next 5 years. The cost of maintaining a car during a year depends on its age, as given in the following table:
Age (in years) Annual Maintenance Cost (3) 0—1 2,000
1—2 4,000
23 5,000
3—4 9,000
45 12,000 To avoid the high maintenance cost, you can trade in your car and purchase a new one at the start of each year. The price you receive for trading in your old car depends on its age at the time you trade it in: To simplify the computations, we assume that at any time, it costs $12,000 to purchase a new car. We are
interested in minimizing our net—cost (purchasing cost + maintenance cost  money received in tradeins)
during years 1, 2, 3, 4 and 5. As an example you could keep your new car for 3 years with maintenance costs of $2,000+ $4,000+
$5,000, and trade it in for $3,000. Then you could buy a new one (at the beginning of year 4) for $12,000,
keep it for two year with maintenance costs of $2,000+$4,000 and trade it in for $6,000 after two years (at
the end of the 5 year period). This would give you a total cost of: $20,000. (1) Model the problem of ﬁnding the minimum netcost as a shortest path problem. (2) What is the best algorithm to solve the corresponding shortest path problem? 44 3 l El La ‘ t
\' : (3‘13 Cour at“ bcgi V! V03 0‘, «a v‘ Auk‘
OWL Nb I K¢¢P w»er (M 0} gearg { ~ \ \
K . *“ s n 0 PAGE LEFT INTENTIONALLY BLANK
3 a A ev i 191$ Dr‘” ea TBS
Cd, 0;. Q V‘ r 4: Cos‘r o.\w w1h4'znnugz. [rah/Clo ‘m tvUO’s) 3 Exercise 2. (14pts) Use Dijkstra’s algorithm (the algorithm for nonnegative weights) to ﬁnd a tree of shortest
dipaths rooted at s. The number next to each arc is its length. INDICATE EVERY STEP OF THE ALGORITHM. 9 m Q’qv A are; 4 Exercise 3. (14pts) Using the FordFulkerson algorithm, ﬁnd a maximum stﬂow and a minimum st—cut, starting from the initial ﬂow given in the ﬁgure. The ﬁrst value next to each arc 1w is its capacity cm, the second number is the ﬂow new. INDICATE EVERY STEP OF THE ALGORITHM. Exercise 4. (20pts) Consider a digraph D = (N , A) with nodes 3, t and capacities c 6 RA. (1) Let a: be an stﬂow prove that for any stcut 6(3) we have Mt) = a115(5))  9605(3)) Note your proof should be self contained.
(2) Let x be a maximum stﬂow and consider any S g N such that s E S and t ¢ S. Prove that 6(8) is
a minimum stcut if and only if 6;; (S) = (0 (i.e. in the residual digraph there are no arcs leaving 5). Hint: Use part (1). [42) (Km; 2 350’) m
u e s Cmsldu earl. am Mr owl» $42.6, Low XW appears \\n at): Case, \t on? as
XV“, lieu) wi‘ x \r E
(ﬂawl U’ & Kvw “Wham. wiH’) 4’1 "‘4' gang“ 0!, 4K”) va— n u l “ “ “ ix”) 3) («Xv“s Cm [email protected]\» Ca“, ‘5'. V63, we? K (P «ppm: “Alia kl Cur—i. iucw/Se 9* 4x W’) Ca“, 4‘. V6 Eur65 Xuxr' appear “NH” " M4. Lacwu’ al— L/ W) 6 07:05 DI THIS PAGE LEFT INTENTIONALLY BLANK 6 TLA SD’CS):¢’ mm» ><( scs/H : L (5cm
W
Mg m ‘ ' ~ v“.
MA erm : 45(9)) 4! 5“) K a WWW. 5L c
(015 X :S a Mbk"¥luw MA “has kl"; “FAQ Wartmy‘ Exercise 5. (16pts) (1) Find a topological ordering of the nodes in the digraph given below using the algorithm described in class (indicate all steps). (2) The digraph is a PERT digraph. The dashed arcs do not represent tasks but are only there to indicate
some precedence constraints. Using the algorithm for shortest dipath in acyclic digraphs, ﬁnd for
every node ’U the earliest time 615(1)) at which all tasks with head 11 can be completed. Deduce the
makespan. (3) What is the latest time task E can be completed without increasing the makespan of the project.
Justify your answer. “A ‘91 :0
9,1: Max 20 *4} = 4
t4} :May'1047—(4403:4 1pm,): 9 .
03* aMAY £9+‘/4+t3=5 V
L95 1 M,“ £4f2 ’47.;‘319rt0317 2.) MAkLSan=y (0‘ 2 MAY is“; 7‘13: 9 C37 oli‘l,w= 1/ waiﬁccpma 9
2:) ‘k‘h‘ll. G meet/ks *0 b; cowpbqu £0 9' 2 a THIS PAGE LEFT INTENTIONALLY BLANK 9 Exercise 6. (20pts) Consider a digraph D = (N, A) with weights w E 3?". Consider the linear program (P):
min
such that f$(u)=0 uEN
L120 (LEA a A wax“ (1) Write the dual (D) of (P). Explain how it is obtained (simply writing the dual is not sufﬁcient).
(2) Write the complementary slackness conditions for (P) and (D). (3) Show that if there is a negative dicycle then (P) is unbounded. (4) Deduce from (3) that if there is a negative dicycle then there are no feasible potentials. (5) Show that if there is no negative dicycle then ma = O for all a E A is an optimal solution of (P). (i) Max 040 (obv>/ w V (D\ K210 :3.) } (gr (D)
(I v (I) wa >0 =J'9¢’°‘f)\r >/ ‘41.“;—
m Let c, be “Tim din (,
be that) V
Thu +x¢(\l\ ; 0 VV 6 N as) LAXQL >\
ml V/\7/0 ,,\><“”7/0 hul‘ wkxaz>z~£
1) vnbOVVWl‘A <0 (5‘) BO (33 AkaOak Winn/H.144 a) inimgjiaip
2:) Vto lrekSA’h’ ()A'ewhinlﬁ Mo W¢§A¥;VL A‘LOOk “‘3 3 voltmkais (proM :4 45“»
1’) 34¢“?le $J» ai— Cb) leaL lML Nut 0 1"“) O is lchr hwwA on (F)
a) X; o :s u‘plhmgl W (P) ...
View
Full Document
 Fall '05
 various
 Shortest path problem, new car, maintenance cost, negative dicycle, Course Number C&O

Click to edit the document details