Uer ID (NOT he 9 igi numer): gurell4 CS351 Deign & Anlyi of Algorihm Fll 17 Seion A Te 3 Soluion Inruor: Rihr Peng In l, Weney, Nov 15, 17 Do no open hi quiz ookle unil you re iree o o o. Re ll he inruion fir. You hve 7 minue o ern up o 6 poin, he e i gre ou of 5. Wrie your nme n uer i ( inie on T-qure) on he op of every pge Thi ookle onin 3 queion on 6 pge, inluing hi one. You n ue he k of he pge for rh work. Wrie your oluion in he pe provie. If you run ou of pe, oninue your nwer on he k of he me hee n mke noion on he fron of he hee. You my ue hee wih noe on oh ie. You my ue lulor, u no ny evie wih rnmiing funion, epeilly one h n e he wirele or he Inerne. You my ue ny of he heorem/f/lemm/lgorihm/home-work h we overe in l wihou re-proving hem unle expliily e oherwie. If neery mke reonle umpion u plee e ure o e hem lerly When we k you o give n lgorihm in hi e, erie your lgorihm in Englih or peuooe, n provie hor rgumen for orrene n running ime. You o no nee o provie igrm or exmple unle i help mke your explnion lerer. Do no pen oo muh ime on ny one prolem. Generlly, wie prolem poin vlue i n iniion of how mny minue o pen on i. Goo luk! Prolem Tile Poin Pr Gre Iniil of Grer Nme & ID on op of every pge 1 1 1 Formuling Liner Progrm 9 1 The For-Fulkeron Algorihm 1 3 3 Spor Eliminion 6 Tol 5 1
Uer ID (NOT he 9 igi numer): gurell4 ( /1 poin) Wrie your nme n uer i on op of every pge. 1. ( /9 poin) Formuling Liner Progrm An oil refinery h wo oure of rue oil: ligh rue h o $35/rrel hevy rue h o $3/rrel The refinery proue goline, heing oil, n je fuel from rue in he following moun: eh rrel of ligh rue proue.3 rrel of goline,. rrel of heing oil, n.3 rrel of je fuel. eh rrel of hevy rue proue.3 rrel of goline,.4 rrel of heing oil, n. rrel of je fuel. (noe h hee numer on up o 1 ue o proeing ineffiienie) The refinery nee o upply: 9, rrel of goline 8, rrel of heing oil 5, rrel of je fuel n wn o minimize he ol o purhing o of he wo ype of rue oil. Formule he prolem of fining he moun of ligh n hevy rue o purhe o o e le o mee i oligion minimum o. You my ue ny ype of vrile / onrin / ojeive, long hey re liner. Noe h he moun of rrel ough n e negive (here i no exiing orge o ell), n you n exee he moun onre. Le x 1 n x e he moun of ligh n hevy rue ough repeively. The LP i: min 35x 1 + 3x uje o:.3x 1 +.3x 9.x 1 +.4x 8.3x 1 +.x 5 x 1, x
Uer ID (NOT he 9 igi numer): gurell4 Alerne oluion: we n ree 6 more vrile, g 1, h 1, j 1 for he moun of goline, heing oil, n jefuel oming from hevy rue, n g, h, j for he moun of goline, heing oil, n jefuel oming from ligh rue. Then we ge he progrm min 35x 1 + 3x uje o: g 1 + g 9 h 1 + h 8 j 1 + j 5 g 1.3x 1 h 1.x 1 j 1.3x 1 g.3x h.4x j.x x 1, x There re ome flexiiliie wih he g i, h i, n j i onrin: hem eing i no neery, n heir inerion wih x i n e equliy (e.g. g 1 =.3x 1 ). 1 poin eh for: () wo vrile, one for eh moun proue () o funion () vrile eing non-negive. poin eh for he hree onrin, 1 per iue in hem. If he progrm omie he ie h pr of prou my e from hevy rue, pr from ligh rue, poin. If he requiremen inequlie re e o =, (e.g. nee o proue exly hi muh goline), 1 poin. 3
Uer ID (NOT he 9 igi numer): gurell4. ( /1 poin) The For-Fulkeron Algorihm Conier he mximum flow on he following grph G wih piie on ege. 1 5 3 7 8 1 long wih he flow f: whih i wh hppen fer rouing uni of flow long he ph. () ( /3 poin) give he reiul grph hi poin (G f ): 4
Uer ID (NOT he 9 igi numer): gurell4 () (.5 per ege ifferene. Cpiie on ege of reiul grph re ignore, only he ireion/exiene of ege re mrke. /3) Your reiul grph from pr ) houl mi he ph. Conier rouing uni of flow long hi ph, in iion o he flow f peifie he r of hi prolem. Give he reuling flow, n he upe reiul grph (eprely). flow: reiul grph:.5 per ege ifferene, for up o 1.5 poin per pr. Cpiie on ege of reiul grph re ignore, only he ireion/exiene of ege re mrke. () ( /4 poin) provie mximum flow n minimum u on hi grph. Mke ure o peify he u vi e of verie. 5
Uer ID (NOT he 9 igi numer): gurell4 A flow of vlue 7 i: 4 3 5 5 A u wih piy 7 i given y {S,, }. 6
Uer ID (NOT he 9 igi numer): gurell4 3. ( /6 poin) Spor Eliminion Conier he following iuion in por ournmen involving n em, numere 1... n: () Eh em lrey h x i win. () There i li of m gme o e plye eween hee em, eh hving he vlue {i, j} for ome em 1 i < j n. For impliiy, ume h eh pir of em hve mo 1 gme lef, o m O(n ). We wn o hek wheher noher em, whih oul poily ge up o z win, n ill win he ournmen. Th i, we wn o know wheher here exi n ouome of he remining m gme o h no em win more hn z x i gme. Of oure, hi men we nee o hve z x i for every i. For exmple, if em,, n hve, 1, n 1 win repeively, n here re hree gme lef eween,, n, hen i poile for eh of hem o hve mo 3 win: em oul loe ll of i remining gme, n em oul win he gme eween, reuling in, 3, n win repeively. () ( /3 poin) By uing eiher mximum flow or mhing in lk-ox mnner (you o no nee o give eil of hoe lgorihm), give n O(n 1 ) ime lgorihm o eermine wheher i poile for ll em o finih wih mo z win. Conru nework wih verie Super oure uper ink verie for gme V gme = {g 1... g m } verie for em V em = { 1... n }. Then we pie ege: For eh gme g j, n ege from o g j wih piy 1. For eh em i, n ege from i o wih piy z x i. For eh gme g j, involving em i1 n i, ege from g j o i1 n i wih infinie piie. A flow on hi nework orrepon igning gme o one of he em involve. So long we n roue ll m uni of flow, here i wy o ign he gme o h eh em oe no ge oo mny win. There i lo noher oluion h ju ege eween he em verie. Th oluion lo reeive full poin. 7
Uer ID (NOT he 9 igi numer): gurell4 () ( /3 poin) Show (uing eiher he mxflow-minu heorem, or Hll heorem) h houl i e impoile for ll em o finih wih mo z win, here exi ue of em S em o h he numer of gme lef o e plye eween hem i more hn (z x i ), i S em k. he ol numer of win h hee em oul hve wih none of hem going over z. Coninuing wih he exmple from pr ), i no poile for ll em o hve mo win eue he ol numer of win eween hem i le + 1 + 1 + 3 = 7 whih verge ou o.333... >. By he mx-flow min-u heorem, uh n ignmen i no poile only if here i u S in he grph peifie in pr ) whoe piy i le hn m. The oure verex i in S, n le i inereion wih he gme / em verie e S gme n S em repeively. A ll ege leving he gme verie hve infinie piy, he only ege leving S gme mu e o S em. Ak. he gme elee in S g me mu only e eween em in S em. The ize of hi u i (z x i ) + V gme \ S gme = (z x i ) + r S gme. i S em i S em For hi o e le hn r, we mu hve i S em (z x i ) < S gme, whih men h here re le hi mny gme lef o e plye eween he em in S em. 1 poin for giving he orre e from S. 1 poin for ing no ege leve S gme. 1 poin for eriving he finl oun. 8