>> %%%%%%%%%%%%%% Solutions to CS525 May 11, 1999 Final %%%%%%%%%%%%% >> %%%%%%%%%%%%%%%%%%%%%%%%% Problem 1 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> Q=[4 2;2 1];p=[-1;-2];A=[2 2;1 -1];b=[1;-3];M=[Q -A';A zeros(2,2)];q=[p;-b]; >> H=lemketbl(M,q);H=addcol(H,ones(4,1),'z0',5); z1 z2 z3 z4 z0 1 ------------------------------------------------------------------ w1= | 4.0000 2.0000 -2.0000 -1.0000 1.0000 -1.0000 w2= | 2.0000 1.0000 -2.0000 1.0000 1.0000 -2.0000 w3= | 2.0000 2.0000 0.0000 0.0000 1.0000 -1.0000 w4= | 1.0000 -1.0000 0.0000 0.0000 1.0000 3.0000 >> H=ljx(H,2,5); z1 z2 z3 z4 w2 1 ------------------------------------------------------------------ w1= | 2.0000 1.0000 0.0000 -2.0000 1.0000 1.0000 z0= | -2.0000 -1.0000 2.0000 -1.0000 1.0000 2.0000 w3= | 0.0000 1.0000 2.0000 -1.0000 1.0000 1.0000 w4= | -1.0000 -2.0000 2.0000 -1.0000 1.0000 5.0000 >> H=ljx(H,2,2); z1 z0 z3 z4 w2 1 ------------------------------------------------------------------ w1= | 3.0000 z2= | 2.0000 w3= | 3.0000 w4= | 1.0000 >> %Complementary tableau at x1=z1=0;x2=z2=2;u1=z3=0;u2=z4=0.Minimum= -2. >> %%%%%%%%%%%%%%%%%%%%%%%%%% Problem 2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> A=[1 -1 1;1 -2 1;-1 1 1;-1 2 1];b=[2 4 -2 -4]';c=[0 0 1]'; >> H=totbl(A,b,c); x1 x2 x3 1 -------------------------------------------- x4= | 1.0000 -1.0000 1.0000 -2.0000 x5= | 1.0000 -2.0000 1.0000 -4.0000 x6= | -1.0000 1.0000 1.0000 2.0000 x7= | -1.0000 2.0000 1.0000 4.0000 -------------------------------------------- z= | 0.0000 0.0000 1.0000 0.0000 >> %Dual feasible. Hence use dual simplex. >> H=ljx(H,2,1); x5 x2 x3 1 -------------------------------------------- x4= | 1.0000 1.0000 0.0000 2.0000 x1= | 1.0000 2.0000 -1.0000 4.0000 x6= | -1.0000 -1.0000 2.0000 -2.0000 x7= | -1.0000 0.0000 2.0000 0.0000 -------------------------------------------- z= | 0.0000 0.0000 1.0000 0.0000 >> H=ljx(H,3,3); x5 x2 x6 1 -------------------------------------------- x4= | 2.0000 x1= | 3.0000 x3= | 1.0000 x7= | 2.0000 -------------------------------------------- z= | 0.5000 0.5000 0.5000 1.0000 >> %Optimal tableau. Solution x1=3;x2=0, min z=x3=1 >> %%%%%%%%%%%%%%%%%%%%%% Problem 3 %%%%%%%%%%%%%%%%%%%%%%%%%%%%% >> A=[1 -1;-1 2];b=[0 -3]';p=[1 1]';q=[-1 0]'; >> H=totbl(A,b,p);H=addrow(H,[q' 0],'z0',3); x1 x2 1 --------------------------------- x3= | 1.0000 -1.0000 -0.0000 x4= | -1.0000 2.0000 3.0000 z0= | -1.0000 0.0000 0.0000 --------------------------------- z= | 1.0000 1.0000 0.0000 >> %1-t>=0 implies optimal tableau for -infinity> H=ljx(H,2,1); x4 x2 1 --------------------------------- x3= | -1.0000 1.0000 3.0000 x1= | -1.0000 2.0000 3.0000 z0= | 1.0000 -2.0000 -3.0000 --------------------------------- z= | -1.0000 3.0000 3.0000 >> %-1+t>=0 and 3-2t>=0 imply optimal tableau for 1=> %Unbounded tableau for t>1.5 because column x2 is nonnegative in rows 1 & 2 >> %Summary >> %-infinity> %1=> %1.5> %%%%%%%%%%%%%%%%%%%%%%%%%% Problem 4 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Min = 0. Becuase: (1/2)x'Qx+p'x=-(1/2)x'Qx+b'u=-(1/2)x'Qx-p'x, % where the first equality follows from strong duality and the second from % b'u=-p'x. Hence: x'Qx+2p'x=0. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%