Illustrating the Simplex Method with Maple

> 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);


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

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]]);

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

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