Itroduktio til Optimerig DIKU, 4 timers skriftlig eksame, 13. april 2007 Ket Aderse, David Pisiger Alle hjælpemidler må beyttes dog ikke lommereger eller computer. Besvarelse ka udarbejdes med blyat eller kuglepe. Opgavesættet består af 19 opgaver, avgivet Q1-Q19. Opgavere Q2-Q8, Q10-Q11 og Q14-Q18 er multiple-choice opgaver, som har etop ét korrekt svar. For at besvare e såda opgave skal ma, ude yderligere forklarig, skrive opgaves ummer samt de korrekte svarmulighed. For eksempel ka opgave Q2 besvares med 2A. Q1, Q9, Q12 og Q19 er sædvalige tekstopgaver, som skal besvares tilstrækkeligt detaljeret til at løsigsmetode ka følges. Hvert korrekt svar til e multiple-choice opgave giver 4 poit. Hvert korrekt svar til e tekstopgave giver 10 poit. Ma ka samlet opå 100 poit. The questio paper cosists of 19 questios amed Q1-Q19. The questios Q2-Q8, Q10-Q11 ad Q14-Q18 are multiple-choice questios, which have exactly oe correct aswer. To aswer such a questio simply write the umber of the questio ad the correct aswer. For example questio Q2 ca be aswered with 2A. Q1, Q9, Q12 og Q19 are ordiary text questios, which should be aswered sufficietly detailed to make it possible to follow the solutio method. Each correct aswer to a multiple-choice questio gives 4 poits. Each correct aswer to a text questio gives 10 poits. You ca obtai 100 poits i total. 1
2 Liear Programmig Cosider the followig liear program (LP) maximize 3x 1 +4x 2 +2x 3 subject to x 1 +x 2 +x 3 20 x 1 +2x 2 +x 3 30 x 1,x 2,x 3 0 Let x 4 deote the slack variable i the first costrait of LP, ad let x 5 deote the slack variable i the secod costrait of LP. Q 1: (text questio). Write dow the dual of LP. Solve LP with the primal simplex method startig from the basis cosistig of x 4 ad x 5. I every iteratio: a) Give the eterig o-basic variable ad the leavig basic variable. b) Give the reduced costs o the o-basic variables. c) Give both the primal ad the dual basic solutio. Q 2: If the objective fuctio coefficiet o x 2 is chaged from 4 to 4 δ, for which values of δ does the optimal basis for LP remai optimal? 2A) δ 1 2D) δ 3 2B) δ [ 2,1] 2E) δ [1,3] 2C) δ 2 2F) δ 1 Q 3: If the right had side i the secod costrait is chaged from 30 to 30 µ, for which values of µ does the optimal basis for LP remai optimal? 3A) µ 0 3D) µ [ 20,10] 3B) µ 10 3E) µ 20 3C) µ [ 10,10] 3F) µ 10 Now cosider the followig liear program (LP 2 ) maximize 5x 1 + 8x 2 +7x 3 + 4x 4 +6x 5 subject to 2x 1 + 3x 2 +3x 3 + 2x 4 +2x 5 20 3x 1 + 5x 2 +4x 3 + 2x 4 +4x 5 30 x 1,x 2,x 3,x 4,x 5 0 Let x 6 deote the slack variable i the first costrait of LP 2, ad let x 7 deote the slack variable i the secod costrait of LP 2.
3 Q 4: How may bases of LP 2 are dual ifeasible? (Also cout bases that ivolve the two slack variables i the two costraits). 4A) 7 4D) 3 4B) 5 4E) 9 4C) 6 4F) 4 Q 5: How may bases of LP 2 that have x 1 as a basic variable are primal feasible? (Also cout bases that ivolve the two slack variables i the two costraits). 5A) 1 5D) 4 5B) 3 5E) 5 5C) 6 5F) oe Fially cosider the followig liear program (LP 3 ) maximize 2x 1 +4x 2 subject to 2x 1 +x 2 2 x 1 x 2 2 x 1,x 2 0 Q 6: Let DLP 3 deote the dual of LP 3. Which of the followig statemets are true. 6A) Both LP 3 ad DLP 3 are feasible ad bouded. 6B) Both LP 3 ad DLP 3 are ifeasible. 6C) Both LP 3 ad DLP 3 are ubouded. 6D) LP 3 is ifeasible ad DLP 3 is ubouded. 6E) LP 3 is ubouded ad DLP 3 is ifeasible. Cuts Cosider the followig IP-problem miimize x 1 x 2 subject to 3x 1 + 12x 2 30 6x 1 3x 2 8 x 1,x 2 Z + By addig slack variables s 1,s 2 0 to the two costraits, ad solvig the LP-relaxed problem by use of the Simplex algorithm the followig two costraits appear: x 1 + 21 1 s 1 + 21 4 s 2 = 21 62 x 2 + 21 2 s 1 + 21 1 s 2 = 21 68 Derive a Gomory cut (Wolsey calls it Chvatal-Gomory cut) from the first Simplex equatio i which the basis variable is fractioal
4 Q 7: Which iequality appears after the slack variables have bee elimiated? 7A) x 1 2 7D) 2x 1 + 2x 2 7 7B) x 2 3 7E) x 1 + x 2 1 7C) x 1 3 1 7F) 3x 1 + 4x 2 4 Q 8: Derive the iequality x 2 3 as a Chvatal cut. Which multipliers (u 1,u 2 ) should be used: 8A) (2,-1) 8D) (3,0) 8B) (4,3) 8E) (0,1) 8C) (3,2) 8F) (2,1) Model buildig The followig puzzle is take from The Lady or the Tiger by Raymod Smullya: A prisoer is faced with a decisio where he must ope oe of two doors. Behid each door is either a lady or a tiger. They may be both tigers, both ladies or oe of each. Each of the doors has a sig bearig a statemet that may be either true or false. The statemet o door oe says, Both rooms cotai ladies. The statemet o door two says, Both rooms cotai ladies. If a lady is i room oe the the statemet o that door is true, otherwise it is false. If a lady is i room two the the statemet o that door is false, otherwise it is true. Q 9: (text questio) (Hit: read the whole puzzle carefully.) a) If we let the biary variable t i be 1 iff the sig of room i is true, ad the biary variable x i be 1 iff room i cotais a lady, formulate the above costraits as a iteger-liear model. (The raw iequalities expressig the relatios should be reported.) b) What is the dimesio of the solutio space X defied by the model. c) Is the iequality x 1 + x 2 1 a facet-defiig valid iequality?
5 Multiple-choice kapsack problem We are give classes N 1,...,N of items. Each item j N i has a associated profit p i j ad a weight w i j. The objective of the problem is to choose exactly oe item from each class N i such that the profit sum of the chose items is maximized, while the weight sum of the chose items caot exceed a give capacity c. If we itroduce the biary variables x i j to idicate if item j is chose i class N i, the problem ca be formulated as the followig iteger-liear model: max s.t. i=1 j N i p i j x i j w i j x i j c i=1 j N i x i j = 1, i = 1,...,k j N i x i j {0,1}, i = 1,...,, j N i (1) I the followig istace we have = 3 classes, ad the capacity is c = 9. N 1 = {1,2,3} N 2 = {1,2,3} N 3 = {1,2} j 1 2 3 p 1, j 0 4 6 w 1, j 0 2 3 j 1 2 3 p 2, j 1 2 3 w 2, j 2 3 4 j 1 2 p 3, j 0 2 w 3, j 1 3 Q 10: Solve the above problem to iteger optimality. What is the optimal solutio value z? 10A) z = 7 10D) z = 10 10B) z = 8 10E) z = 11 10C) z = 9 10F) z = 12 We will solve the multiple-choice kapsack problem through dyamic programmig. Let f k (d) be a optimal solutio to (1), where the capacity is limited to d ad where oly the first k classes are cosidered. I other words k f k (d) = max{ p i j x i j : i=1 j N i } k w i j x i j d; x i j = 1,i = 1,...,k; x i j {0,1} i=1 j N i j N i for k = 0,..., og d = 0,...,c. For k = 0 oe ca oly obtai the profit sum 0 for ay value of d so we have f 0 (d) = 0 for d = 0,...,c (3) If we kow the optimal solutio for f k 1, we ca fid the optimal solutios for f k by usig a dyamic programmig recursio. (2)
6 Q 11: What is the correct recursio? (We assume that f k 1 (d) = if d < 0) 11A) f k (d) = f k 1 (d w k j )+ p k j 11B) f k (d) = max j N k { f k 1 (d)} 11C) f k (d) = max j N k { fk 1 (d)+ p k j } 11D) f k (d) = max j N k { fk 1 (d w k j )+ p k j } Usig the recursio we get the followig (icomplete) table: d\k 1 2 3 0 0 1 0 2 4 1 3 6 2 1 4 6 5 2 5 6 7 6 6 8 7 6 9 8 6 9 9 6 9 Q 12: What are the five missig etries i colum k = 3 12A) (5,7,8,9,9) 12D) (5,7,8,9,10) 12B) (5,6,7,8,10) 12E) (5,5,9,9,10) 12C) (7,9,10,11,11) 12F) (7,9,10,11,12) Q 13: (text questio) a) Assume that we for each item j i class N 3 wish to fid the smallest ad largest value of p i j such that the curret IP-solutio is uchaged. Derive a formal criteria which ca be used to determie the limits. It ca be advatageous to distiguish betwee the cases where x 3 j = 0 or x 3 j = 1 i the optimal solutio. b) Use the above formal criteria for all j N 3 to determie the smallest ad largest value of p i j such that the curret IP-solutio is uchaged.
7 Bi Packig The bi packig problem is to pack items i the smallest umber of bis, such that the capacity c of each bi is respected. Each item j = 1,..., has a associated weight w j. If we use the biary variables x i j to idicate whether item j is placed i bi i, ad v i to idicate whether bi i is used, we get the formulatio: miimize subject to i=1 j=1 i=1 v i (4) w j x i j cv i, i = 1,..., (5) x i j 1, j = 1,..., (6) x i j {0,1}, i, j = 1,..., (7) v i {0,1}, i = 1,..., (8) I the followig example we have capacity c = 9 ad = 5 items with the followig weights: j 1 2 3 4 5 w j 2 4 6 7 8 Q 14: Solve the LP-relaxatio of the above problem. What is the optimal solutio value? 14A) z = 1 14D) z = 4 14B) z = 2 14E) z = 5 14C) z = 3 14F) z = 6 Q 15: Fid the most violated cover iequality correspodig to costrait (5) for i = 1 if we i the primal solutio have v 1 = 1 ad x 11 = 1, x 12 = 1 2, x 13 = 1 3, x 14 = 1 7, x 15 = 1 4 (the remaiig variables have some other values). 15A) x 11 + x 12 + x 13 + x 14 3 15D) x 11 + x 13 + x 14 + x 15 3 15B) x 11 + x 21 + x 31 2 15E) x 11 + x 15 1 15C) x 11 + x 12 + x 13 + x 14 + x 15 4 15F) x 11 + x 12 + x 13 2 To fid a tighter lower boud we cosider the Datzig-Wolfe decomposed problem. Let R be the set of packigs of a sigle bi. Moreover, let a i j be a biary value which idicates whether item j is used i packig i. If we use the biary variable x i to determie whether packig i R is used, we get the followig model: mi x i i R s.t a i j x i 1 j = 1,..., (9) i R x i {0,1} i R
8 As the above model may be expoetially large, we solve the LP-relaxed problem through colum geeratio. We start with the trivial formulatio: mi x 1 + x 2 + x 3 + x 4 + x 5 s.t. x 1 1 x 2 1 x 3 1 x 4 1 x 5 1 (10) where all variables x j 0. Let y j be the dual variable correspodig to costrait (10) for item j. Q 16: Fid the dual variables correspodig to the above problem 16A) y 1 = 0,y 2 = 0,y 3 = 0,y 4 = 0,y 5 = 0 16D) y 1 = 2,y 2 = 1,y 3 = 0,y 4 = 2,y 5 = 0 16B) y 1 = 2,y 2 = 0,y 3 = 1,y 4 = 0,y 5 = 2 16E) y 1 = 1,y 2 = 1,y 3 = 1,y 4 = 1,y 5 = 0 16C) y 1 = 1 5,y 2 = 1 5,y 3 = 5 1,y 4 = 5 1,y 5 = 1 5 16F) y 1 = 1,y 2 = 1,y 3 = 1,y 4 = 1,y 5 = 1 Q 17: Which of the followig colums is the ext to be added to the model (10)? The colums are specified by the ivolved set of items j 17A) {1} 17E) {5} 17B) {2} 17F) {1, 2} 17C) {3} 17G) {1, 5} 17D) {4} 17H) {2, 3} Add the colum to the formulatio (10). Solvig the LP-model the dual variables become y 1 = 0,y 2 = y 3 = y 4 = y 5 = 1. Q 18: What is the ext colum to be added to (10) 18A) {1} 18F) {5} 18B) {2} 18G) {1, 2} 18C) {3} 18H) {1, 5} 18D) {4} 18I) {2, 3} 18E) oe (colum geeratio termiates)
9 If we istead Lagrage relax costraits (6) i the simple formulatio of the bi packig problem usig multipliers λ = (λ 1,...,λ ) we get a relaxed problem. Q 19: (text questio) a) What is the Lagragia relaxed problem, ad the domai of the multipliers λ? Hit: check that we get a valid lower boud whe statig the domai of λ. b) What is the best choice of Lagragia multipliers λ, i.e. the solutio to the Lagragia dual problem for the cosidered istace. Hit: use your kowledge of the stregth of the Lagragia dual problem. c) What is the solutio value of the Lagragia relaxed problem for this choice of Lagragia multipliers?