The GGMC Problem

> with(plots): with(linalg):

Warning, the name changecoords has been redefined

Warning, the protected names norm and trace have been redefined and unprotected

Define and graph the region.  I include the optimal objective function line as well.

> G1:=inequal( {x+y<=70, 2*x+y<=100, x+2*y<=120, x>=0, y>=0}, x=-10..70, y=-10..70, optionsfeasible=(color=yellow), optionsexcluded=(color=white) ):

> G2:=implicitplot(5*x+4*y=310,x=-10..70,y=-10..70,color=black,thickness=3):

> display({G1,G2},scaling=constrained);

[Plot]

> mypivot:=(M,i,j)->pivot(mulrow(M,i,1/M[i,j]),i,j);

mypivot := proc (M, i, j) options operator, arrow; pivot(mulrow(M, i, 1/M[i, j]), i, j) end proc

Solve the GGMC problem by the simplex method.

> T0:=array([[1,2,1,0,0,0,120],[1,1,0,1,0,0,70],[2,1,0,0,1,0,100],[5,4,0,0,0,1,0]]);

T0 := matrix([[1, 2, 1, 0, 0, 0, 120], [1, 1, 0, 1, 0, 0, 70], [2, 1, 0, 0, 1, 0, 100], [5, 4, 0, 0, 0, 1, 0]])

> T1:=mypivot(T0,3,1);

T1 := matrix([[0, 3/2, 1, 0, (-1)/2, 0, 70], [0, 1/2, 0, 1, (-1)/2, 0, 20], [1, 1/2, 0, 0, 1/2, 0, 50], [0, 3/2, 0, 0, (-5)/2, 1, -250]])

> T2:=mypivot(T1,2,2);

T2 := matrix([[0, 0, 1, -3, 1, 0, 10], [0, 1, 0, 2, -1, 0, 40], [1, 0, 0, -1, 1, 0, 30], [0, 0, 0, -3, -1, 1, -310]])

>