LP Simplex CAS Functions(GAUS,PIVOT)
CAS Functions
Qb(Pivotzeile des Tableaus berechnen: DIV Element der Pivotspalte, EE Element der b-Vektor-Spalte: EE/DIV)
(Muss ggf. bei Abweichungen der Nebenbedingungen von den Standard-Simplex-Vorgaben angepasst werden)
PIVOT(Liste {Pivotzeile, Pivotspalte} berechnen)
GAUS(Gauß'sche Elimiationsschritte mit der Pivotzeile ausführen)
maxIL(Auslesen des End-Tableaus eines Max Programm)
minIL(Auslesen des dualen End-Tableaus für Min-Programme)
Zmin:={First(Flatten(Last(Transpose(Start))), n)} -
Letzte Zeile im Start-Tableau = (-1)Koeffizienten der Ziel-Funktion (Zmin/Zmax).
Last Row in Start-Tableau = (-1)*Coefficients of Target/Objective-Function(Zmin/Zmax) .
Terminate LP all Coefficients of line of Target/Objective-Function positiv.
Beispiel:
https://sagecell.sagemath.org/?q=uiivwn
load("simplex");
maximize_lp( 22*x+28*y+19*z, [
x<=300, y<=300, z<=250, 3*x+4*y+2*z<=2100 ]), nonegative_lp=true;
[16250,[z=250,y=175,x=300]]
Start:={{3,4,2,1,0,0,0,2100},{1,0,0,0,1,0,0,300},{0,1,0,0,0,1,0,300},{0,0,1,0,0,0,1,250},{-22,-28,-19,0,0,0,0,0}}
Beispiel max Start

Minimize with dual tableau
| minimize_lp( 35*x1+30*x2+20*x3+15*x4+20*x5+25*x6, [ x1+x4>=80, x2+x5>=40, x3+x6>=45, x1+x2+x3<=90, x4+x5+x6<=75 ]), nonegative_lp=true; [3400,[x6=0,x3=45,x5=0,x2=40,x4=75,x1=5]] https://sagecell.sagemath.org/?q=rptevc | DUALTAB |
LP min Programm Duales Tableau und Max Algorithmus

Beispiele für Start-Tableau
tab max
((3 * x1) + (2 * x2) + (2 * x3),
[x1 + x3 + x4 <= 8,
x1 + x2 + x5 <= 7,
x1 + (2 * x2) <= 12])
Start:={{1,0,1,1,0,0,8},{1,1,0,0,1,0,7},{1,2,0,0,0,1,12},{-3,-2,-2,0,0,0,0}};
((2 * x1) + (2 * x2) + (6 * x3),
[(-2 * x1) + (2 * x2) + x4 <= 20,
(-2 * x1) + (2 * x3) >= 24,
(2 * x1) - (2 * x2) - (2 * x3) <= 16,
(4 * x1) - (2 * x2) + (2 * x3) <= 12])
Start:={{-2, 2, 0, 1, 0, 0, 0,20}, {2, 0, -2, 0, -1, 0, 0,24}, {2, -2, -2, 0, 0, 1, 0,16}, {4, -2, 2, 0, 0, 0, 1,12},{-2,-2,-6,-0,0,0,0,0}}
(x1 + (3 * x2) + (2 * x3),
[x1 + (4 * x2) + (2 * x3) <= 200,
x1 + (3 * x2) + (4 * x3) <= 160,
(2 * x1) + x2 + (6 * x3) <= 300]),
{{1, 4, 2, 1, 0, 0, 200}, {1, 3, 4, 0, 1, 0, 160}, {2, 1, 6, 0, 0, 1, 300}, {-1, -3, -2, 0, 0, 0, 0}};
((20 * x1) + (15 * x2) + (7 * x3),
[x1 - (2 * x2) <= 30,
(3 * x1) + x2 - (5 * x3) <= 47,
(3 * x2) + x3 <= 20, x3 <= 5])
{{1,-2,0,1,0,0,30}, {3,1,-5,0,1,0,47}, {0,3,1,0,0,0,20},{0,0,1,0,0,1,5}, {-20,-15,-7,0,0,0,0}};
dualtab min
35*x1+30*x2+20*x3+15*x4+20*x5+25*x6, [
x1+x4>=80,
x2+x5>=40,
x3+x6>=45,
(x1+x2+x3)<=90,
(x4+x5+x6)<=75])
{{1,0,0,−1,0,1,0,0,0,0,0,35},{0,1,0,−1,0,0,1,0,0,0,0,30},{0,0,1,−1,0,0,0,1,0,0,0,20},{1,0,0,0,−1,0,0,0,1,0,0,15},{0,1,0,0,−1,0,0,0,0,1,0,20},{0,0,1,0,−1,0,0,0,0,0,1,25},{−80,−40,−45,90,75,0,0,0,0,0,0,0}};
