Lineare Optimierungsmodelle Simplex-Methode Vortragender: Michael Schneider
Agenda Motivation Operations Research Aufbau linearer Optimierungsmodelle Simplex-Methode Ausblick 2
Problemstellung Futtermischung Sojamehl Mais Anforderung Anteil im Futter in % 60 50 40 30 20 10 0 Ballaststoffe (max) Protein (min) Futterbestandteile Futter / kg Sojamehl 0,90 Mais 0,30 Mindestmenge / Tag 800 kg Frage: Welche Mischung erfüllt die Anforderung und verursacht minimale Kosten? 3
Lösung (1) Lineares Optimierungsmodell min 0,9x s + 0,3x m so dass x s + x m 800 (a) 0,17x s + 0,04x m 0,14(x s +x m ) (b) 0,56x s + 0,13x m 0,30(x s +x m ) (c) x s, x m 0 wobei:x s Menge an Sojamehl in kg x m Menge an Mais in kg 4
Lösung (2) Graphische Lösung x s 1000 (b) zulässiger Bereich (a) (c) optimale Lösung Isogewinngerade (z) 1000 2000 Ergebnis: ca. 484 kg Mais, 316 kg Sojamehl x m (z) bei 0,9x s + 0,3x m = 0 5
Agenda Motivation Operations Research Aufbau linearer Optimierungsmodelle Simplex-Methode Ausblick 6
Begriff Operations Research Teilgebiet der Wirtschaftsinformatik Lösung von Optimierungsproblemen Entscheidungsunterstützung Problembeschreibung Lösungsmethode 7
Optimierungsmodelle Problem formalisierbar Gefestigte Datenbasis Endscheidungsvariablen, Zielfunktion, Restriktionen Exakt, Heuristiken, Metaheuristiken Beispiele: Gleichungssystem, Graphen a A b B Depot f c d C e 8
Simulationsmodelle Unzureichende Datenbasis Ineffiziente Algorithmen Enthalten Zufallskomponenten Experimentelles Verfahren Kontinuierlich, diskret Beispiel: Warteschlangensystem Warteschlange Kasse A Warteschlange A Kasse A Erscheinen Kasse B Verlassen Erscheinen Warteschlange B Kasse B Verlassen 9
Agenda Motivation Operations Research Aufbau linearer Optimierungsmodelle Simplex-Methode Ausblick 10
Entscheidungsvariablen Bestimmen Entscheidungsraum Unter-, Obergrenze Formal: n Entscheidungsvariablen x j [o j,u j ] für alle 1 j n x j,u j,o j R für alle 1 j n Sojamehl Mais Anforderung Anteil im Futter in % 60 50 40 30 20 10 Futter Sojamehl Mais / kg 0,90 0,30 x s =x 1 [0, ] x m =x 2 [0, ] 0 Ballaststoffe (max) Futterbestandteile Protein (min) 11
Zielfunktion Linearkombination von Entscheidungsvariablen Minimieren / Maximieren 1 Zielfunktion je Optimierungsmodell n Formal: min bzw. max j=1 c j x j c j R für alle 1 j n Futter Sojamehl Mais / kg 0,90 0,30 min 0,9x 1 + 0,3x 2 12
Restriktionen Abhängigkeiten zwischen Entscheidungsvariablen,, oder = Gleichung Formal: m Restriktionen n j=1 a ij x j =b i für alle 1 i m b i,a ij R für alle 1 i m, 1 j n 60 Sojamehl Mais Anforderung Anteil im Futter in % 50 40 30 20 10 0,17x 1 + 0,04x 2 0,14(x 1 +x 2 ) 0,03x 1 0,10x 2 0 0 Ballaststoffe (max) Futterbestandteile Protein (min) 13
Regeln: Umwandeln ins Standardformat min-zielfunktion max-zielfunktion min 3x 1 + 4x 2 max 3x 1 4x 2 -Ungleichung -Ungleichung 2x 1 +x 2 7 2x 1 x 2 7 Ungleichung Gleichung mit Schlupfvariable 2x 1 +x 2 7 2x 1 +x 2 + x 3 = 7 mit x 3 0 Variable nach unten unbeschränkt Ersatz x j [,o j ] + + x j =x j x j mit x j,x j [0, ] 14
Beispiel: Transformation min 0,9x 1 + 0,3x 2 so dass x 1 + x 2 800 0,03x 1 0,10x 2 0 0,26x 1 0,17x 2 0 x 1, x 2 0 n Strukturvariablen m Schlupfvariablen max 0,9x 1 0,3x 2 so dass x 1 x 2 + x 3 = 800 0,03x 1 0,10x 2 +x 4 = 0 0,26x 1 + 0,17x 2 +x 5 = 0 x 1, x 2, x 3, x 4, x 5 0 15
Lineare Optimierungsmodelle Simplex-Methode Eigenschaften des Standardformats (1) Lösungsraum: R n x j [0, ] für alle 1 j m+n x j -Hyperebene (R n 1 ): x j = 0 x j -Halbraum (R n ): x j 0 16
Eigenschaften des Standardformats (2) zulässiger Bereich: Schnitt aller Halbräume Ecke: Schnitt von n Hyperebenen Basis: m unabhängige Spaltenvektoren Basisvariablen (BV) Nichtbasisvariablen (NBV) Basislösung: NBV = 0 BV = konstanter Term 17
Agenda Motivation Operations Research Aufbau linearer Optimierungsmodelle Simplex-Methode Ausblick 18
Allgemeine Vorgehensweise Standardformat bilden Ausgangsbasis: all-logical-basis Phase I: Zulässige Basislösung berechnen neue Zielfunktion erstellen Iteration über neue Zielfunktion Phase II: Verbesserung der Lösung Iteration über ursprüngliche Zielfunktion 19
Iterationsschritt in Phase I und II Gleichungssystem umformen Aufnahmeregel Pivot-Variable auswählen NBV mit positiven Koeffizient in Zielfunktion Eliminationsregel Wert der Pivot-Variable erhöhen bis erste BV = 0 Basistausch Pivot-Variable BV 20
Beispiel 1: Ausgangssituation Lineares Optimierungsmodell max 2x 1 + 1,5x 2 = z so dass 2x 1 + x 2 + x 3 = 1000 (a) x 1 + x 2 + x 4 = 800 (b) x 1 + x 5 = 400 (c) x 2 + x 6 = 700 (d) x 1, x 2, x 3, x 4, x 5, x 6 0 Ausgangsbasis NBV:x 1 = 0,x 2 = 0 BV: x 3 = 1000,x 4 = 800,x 5 = 400,x 6 = 700 z = 0 21
Phase II Iteration 1 1. Umformen z = 0 + 2x 1 +1,5x 2 Zielfunktionszeile x 3 = 1000 2x 1 x 2 x 1 ր 500 x 4 = 800 x 1 x 2 x 1 ր 800 x 5 = 400 x 1 x 1 ր 400 x 6 = 700 x 2 x 1 ր + NBV: x 2 = 0,x 5 = 0 BV: x 1 = 400,x 3 = 200,x 4 = 400,x 6 = 700 z = 800 2. Pivot-Spalte (Aufnahmeregel) min 3. Eliminationsregel 22
Phase II Iteration 2 Umformen: x 1 = 400 x 5 z = 0 + 2x 1 +1,5x 2 x 5 = 400 x 1 x 3 = 1000 2x 1 x 2 x 4 = 800 x 1 x 2 x 6 = 700 x 2 23
Phase II Iteration 2 Umformen: x 1 = 400 x 5 z = 0 + 2(400 x 5 ) + 1,5x 2 x 1 = 400 x 5 x 3 = 1000 2(400 x 5 ) x 2 x 4 = 800 (400 x 5 ) x 2 x 6 = 700 x 2 24
Phase II Iteration 2 Umgeformt: x 1 z = 800 2x 5 +1,5x 2 x 1 = 400 x 5 x 3 = 200 +2x 5 x 2 x 4 = 400 + x 5 x 2 x 6 = 700 x 2 x 2 ր + x 2 ր 200 x 2 ր 400 x 2 ր 700 min NBV:x 3 = 0,x 5 = 0 BV: x 1 = 400,x 2 = 200,x 4 = 200,x 6 = 500 z = 1100 25
Phase II Iteration 3 Umgeformt z = 1100 + x 5 1,5x 3 x 1 = 400 x 5 x 2 = 200 + 2x 5 x 3 x 4 = 200 x 5 + x 3 x 6 = 500 2x 5 + x 3 x 5 ր 400 x 5 ր + x 5 ր 200 x 5 ր 250 min NBV:x 3 = 0,x 4 = 0 BV: x 1 = 200,x 2 = 600,x 5 = 200,x 6 = 100 z = 1300 26
Phase II Iteration 4 Umformen: x 5 = 200 +x 3 x 4 z = 1300 x 4 0,5x 3 x 1 = 200 + x 4 x 3 x 2 = 600 2x 4 + x 3 x 5 = 200 x 4 + x 3 x 6 = 100 + 2x 4 x 3 nur negative Koeffizienten optimale Lösung gefunden: x 1 = 200,x 2 = 600 z = 1300 27
Beispiel 2: Ausgangssituation Modell aus dem Abschnitt Motivation max 0,9x 1 0,3x 2 =z so dass x 1 x 2 + x 3 = 800 (a) 0,03x 1 0,10x 2 + x 4 = 0 (b) 0,26x 1 +0,17x 2 + x 5 = 0 (c) x 1, x 2, x 3, x 4, x 5 0 Ausgangsbasis NBV:x 1 = 0,x 2 = 0 BV: x 3 = 800,x 4 = 0,x 5 = 0 z = 0 unzulässige Lösung Besonderheit: entartete Ecke 28
Phase I Vorbereitung neue Zielfunktion: Max Summe aller negativen BV max s =x 3 = 800 +x 1 +x 2 negative Variablen auf untere Grenze überführen Iterationsschritte 29
Phase I Iteration 1 Umgeformt Pivot-Spalte s = 800+ x 1 + x 2 z = 0,9x 1 0,3x 2 x 3 = 800+ x 1 + x 2 x 4 = 0,03x 1 + 0,10x 2 x 5 = + 0,26x 1 0,17x 2 x 1 ր 800 x 1 ր 0 x 1 ր + min NBV: x 2 = 0,x 4 = 0 BV: x 1 = 0,x 3 = 800,x 5 = 0 s = 800, z = 0 Eliminationsregel 30
Phase I Iteration 2 Umgeformt s = 800 33,3x 4 + 4,33x 2 z = + 30x 4 3,3x 2 x 1 = 33,3x 4 + 3,33x 2 x 3 = 800 33,3x 4 + 4,33x 2 x 5 = 8,56x 4 + 0,69x 2 x 2 ր + x 2 ր 184,7 x 2 ր + min (x 3 = 0) NBV:x 3 = 0,x 4 = 0 BV:x 1 = 615,x 2 = 184,7,x 5 = 127,4 s = 0, z = 609,5 Phase I beendet 31
Phase II Iteration 1 Umgeformt z = 609,5 + 4,63x 4 0,76x 3 x 1 = 615 7,69x 4 + 0,77x 3 x 2 = 184,7 + 7,69x 4 0,23x 3 x 5 = 127,4 3,25x 4 + 0,16x 3 x 4 ր 79,97 x 4 ր + x 4 ր 39 min NBV:x 3 = 0,x 5 = 0 BV: x 1 = 316,3,x 2 = 483,7,x 4 = 39 z = 430 32
Phase II Iteration 2 Umgeformt z = 430 1,39x 5 0,53x 3 x 1 = 316,3 + 2,38x 5 + 0,39x 3 x 2 = 483,7 2,38x 5 + 0,15x 3 x 4 = 39 + 0,31x 5 + 0,05x 3 nur negative Koeffizienten optimale Lösung gefunden x 1 = 316,6,x 2 = 483,7 z = 430 Zielfunktionswert = 430 33
Ökonomische Interpretation Letzte Zielfunktion liefert reduzierte Kosten Zielfunktion: z =... +cx j... z =... dx j... x ist Strukturvariable: x j ր 1 zցd (*) c րd x j in Basis x ist Schlupfvariable: x j ր 1 zրd (*) (*) Auswirkungen nur innerhalb einer Basis 34
Ökonomische Interpretation Letzte Zielfunktion liefert reduzierte Kosten Zielfunktion: z =... +cx j... z =... dx j... x ist Strukturvariable: x j ր 1 zցd (*) c րd x j in Basis x ist Schlupfvariable: x j ր 1 zրd (*) (*) Auswirkungen nur innerhalb einer Basis 35
Ökonomische Interpretation Letzte Zielfunktion liefert reduzierte Kosten Zielfunktion: z =... +cx j... z =... dx j... x ist Strukturvariable: x j ր 1 zցd (*) c րd x j in Basis x ist Schlupfvariable: x j ր 1 zրd (*) (*) Auswirkungen nur innerhalb einer Basis 36
Optimierungssoftware Excel-AddIn ClipMOPS 37
Danke Danke für euer Interesse. 38
Anhang Graphische Veranschaulichung der Simplex-Schritte am Linearen Optimierungsmodell aus dem Beispiel 1 x 2 1000 a: Phase II Iteration 1 b: Phase II Iteration 2 c: Phase II Iteration 3 500 optimale Lösung c 100 zulässiger Bereich b Isogewinngerade 100 a 500 x 1 39
Anhang Graphische Veranschaulichung der Simplex-Schritte am Linearen Optimierungsmodell aus dem Beispiel 2 x 1 1000 zulässiger Bereich c optimale Lösung a: Phase I Iteration 1 b: Phase I Iteration 2 c: Phase II Iteration 1 b Isogewinngerade a 1000 2000 x 2 40