Linear optimization: Phases of the Simplex method 1: Unterschied zwischen den Versionen

Aus Operations-Research-Wiki
Wechseln zu: Navigation, Suche
[unmarkierte Version][unmarkierte Version]
Zeile 22: Zeile 22:
  
 
In the new constraints there are no <math> y_i</math>. This means that this structure variable (slack variable) has become 0
 
In the new constraints there are no <math> y_i</math>. This means that this structure variable (slack variable) has become 0
 
 
  
  
Zeile 37: Zeile 35:
  
 
<math> x_1 </math> and <math> x_2 </math> are the variables which have to be optimized. In the last line, that represents the non negativity conditions, in the adjoining tableau only <math> x_1 </math> is mentioned and therefore restricted. Hence <math> x_2 </math> is a free variable.
 
<math> x_1 </math> and <math> x_2 </math> are the variables which have to be optimized. In the last line, that represents the non negativity conditions, in the adjoining tableau only <math> x_1 </math> is mentioned and therefore restricted. Hence <math> x_2 </math> is a free variable.
 
 
 
 
 
 
  
  
Zeile 60: Zeile 52:
  
 
<math> y_3: ~30x_1+30x_2 \ge 600 \Rightarrow -30x_1-30x_2\le -600 </math>  
 
<math> y_3: ~30x_1+30x_2 \ge 600 \Rightarrow -30x_1-30x_2\le -600 </math>  
 
 
 
  
  
Zeile 93: Zeile 82:
 
;By using the LP we create a first tableau
 
;By using the LP we create a first tableau
 
[[Datei:1k.jpg|center|]]
 
[[Datei:1k.jpg|center|]]
 +
 +
 +
 +
----
 +
 +
 
;Eliminate Phase 0:
 
;Eliminate Phase 0:
 
[[Datei:2k.jpg|center|]]
 
[[Datei:2k.jpg|center|]]
 +
 +
 
The equation in the spot of <math>y_3</math> has to be dealt with. The slack variable <math>y_3</math> has to leave the basis. It's row becomes the pivot row. The pivot coulumn has to be the coulumn where <math> x_1 </math> is located because it's the only worth that is possible. -2 or 0 are not allowed to be the pivot element so 1 is left and becomes the pivot element. (yellow hinted)
 
The equation in the spot of <math>y_3</math> has to be dealt with. The slack variable <math>y_3</math> has to leave the basis. It's row becomes the pivot row. The pivot coulumn has to be the coulumn where <math> x_1 </math> is located because it's the only worth that is possible. -2 or 0 are not allowed to be the pivot element so 1 is left and becomes the pivot element. (yellow hinted)
 +
 +
----
 +
  
  
 
;Simplex iteration with found Pivot element:
 
;Simplex iteration with found Pivot element:
 
[[Datei:3k.jpg|center|]]
 
[[Datei:3k.jpg|center|]]
 +
 +
 +
After the simplex iteration the tableau looks like this. When the slack variable is changed into the non basis it is blocked for the rest of the optimization. This fact is marked by the red font color.
 +
 +
----
 +
 +
 +
 +
;Eliminate Phase 0'
 
[[Datei:4k_1.jpg|center|]]
 
[[Datei:4k_1.jpg|center|]]
 +
 +
 +
By choosing the coulumn of <math>x_3</math> as a pivot coulumn you start eliminating the free variables and transport it to the basis. The only possible pivot element is -1760 in the row of <math>y_1</math>. Normally this pivot element should have a positive sign, but in this special case there is a negative one. A simplex iteration is still possible though.
 +
 +
----
 +
 +
 +
 +
;Simplex iteration with found Pivot element:
 
[[Datei:5k.jpg|center|]]
 
[[Datei:5k.jpg|center|]]
 +
 +
 +
After the iteration variable <math>x_3</math> is now in the basis. It's row also gets blocked and can not be used again in the optimization process. Also another negative right side is generated, which has to be dealt with in the step of eliminating phase 1.
 +
 +
----
 +
 +
 +
 +
;Eliminating Phase 1
 
[[Datei:6k.jpg|center|]]
 
[[Datei:6k.jpg|center|]]
 +
 +
 +
The row in that the negative right side is located, gets pivot row again. In this case we pick the row of <math>y_2</math>. It is useful to pick a pivot element with a negative sign to get rid of the negative sign of the right side. Therefore the pivot coulumn is the coulumn of <math>x_2</math> and the pivot element is -3.
 +
 +
----
 +
 +
 +
 +
;Simplex iteration with found Pivot element:
 
[[Datei:7k.jpg|center|]]
 
[[Datei:7k.jpg|center|]]
: <math>y_3</math> has to leave the basis
+
After the iteration one can recognize that the right side in the coulumn of <math>x_3</math> has a positive sign again. Therefore it has not to be dealt with in addition. The solution is already optimal because of the positive values in the non basis. This makes the optimization step (Phase 2) obsolete and the optimization is done in this point.
:it's row becomes the pivot row
+
:<math>y_1</math>
+
  
  

Version vom 25. Juni 2013, 19:33 Uhr

A linear optimization tableau can be systemized in different Phases that have to be dealt with before the actual optimization step can be used, which is explained by the method of using the simplex algorithm.

Different Phases:

Phase 0 Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \Rightarrow

Phase 0' Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \Rightarrow 
Phase 1 Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \Rightarrow 
Phase 2

Phase 0: equations

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden
Phase 0

The locked variables are identifyable where equations are written as constraints. This means that the structure variable (slack variable) has to become 0 to solve the equation (locked variable). This structure variable must not stand in the basis, therefore it is urgent for it to leave the basis. The row where this blocked variable is findable becomes the pivot-row . Those coulumns that do not contain blocked variables as a non basis variable become the pivot coulumn. After the pivot element is found, a simplex iteration follows by the simple rules of simplex algorithm.


old constraints:

Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \sum_{j}a_{ij}x_j \le b_i \Rightarrow y_i+\sum_{j}a_{ij}x_j =b_i ;~~y_i \ge 0


new constraints:

Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): \sum_{j} a_{ij}x_j = b_i


In the new constraints there are no . This means that this structure variable (slack variable) has become 0


Phase 0': Free variables

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden
Phase 0'

Free variables are variables for which the not negativity conditions are not valid respectivly are not defined. They have to be transfered to the basis as well. As long as free variables are located in the non-basis, the coulumn they stand in becomes a pivot-coulumn. If a free variable is relocated to the basis, it is blocked for the rest of the optimization procedure. This means the basis-row it stands in after the relocation cannot become a pivot-row again. Again a simplex iteration follows the search of the pivot element in this phase.


and are the variables which have to be optimized. In the last line, that represents the non negativity conditions, in the adjoining tableau only is mentioned and therefore restricted. Hence is a free variable.



Phase 1: Minimizing the infeasibility

Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden
Phase 1

Constraints that contain a ≥ operator in it form an infeasible initial solution. In the simplex tableau this fact is dealt with a multiplication by -1. This means also that a negative right side is generated (infeasible). This often appears in constraints whereas the profit should be higher than a special value for example. The pivot row becomes the row where the negative right side is located. If possible the pivot-coulumn should be a coulumn where the pivot element has a negative sign. A simplex iteration is again required after finding the pivot element.


In the given example the third constraint is representing the actual phase. The restriction has a negative sign for each value, because this line was multiplicated by -1 due to the infeasible initial solution.


Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): y_3: ~30x_1+30x_2 \ge 600 \Rightarrow -30x_1-30x_2\le -600



Phase 2: Optimization

If an optimal solution is not found by correcting the three Phases above, more simplex iterations are probably required to reach the optimal solution, where not negative values stand in the non-basis.


Example

The following example illustrates the different phases of the simplex.

Linear Program:

costs
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): 10x_1 + 20x_2 + 40000x_3 \rightarrow min!


constraints
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): x_1+ 2x_2-1760x_3 \le 8800
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): x_1+x_2 \ge 1200
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): x_1-2x_2=0
not negativity condition
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): x_1 \ge 0
Fehler beim Parsen (http://mathoid.testme.wmflabs.org Serverantwort ist ungültiges JSON.): x_2 \ge 0



Step by Step solution
By using the LP we create a first tableau
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden




Eliminate Phase 0
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden


The equation in the spot of has to be dealt with. The slack variable has to leave the basis. It's row becomes the pivot row. The pivot coulumn has to be the coulumn where is located because it's the only worth that is possible. -2 or 0 are not allowed to be the pivot element so 1 is left and becomes the pivot element. (yellow hinted)



Simplex iteration with found Pivot element
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden


After the simplex iteration the tableau looks like this. When the slack variable is changed into the non basis it is blocked for the rest of the optimization. This fact is marked by the red font color.



Eliminate Phase 0'
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden


By choosing the coulumn of as a pivot coulumn you start eliminating the free variables and transport it to the basis. The only possible pivot element is -1760 in the row of . Normally this pivot element should have a positive sign, but in this special case there is a negative one. A simplex iteration is still possible though.



Simplex iteration with found Pivot element
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden


After the iteration variable is now in the basis. It's row also gets blocked and can not be used again in the optimization process. Also another negative right side is generated, which has to be dealt with in the step of eliminating phase 1.



Eliminating Phase 1
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden


The row in that the negative right side is located, gets pivot row again. In this case we pick the row of . It is useful to pick a pivot element with a negative sign to get rid of the negative sign of the right side. Therefore the pivot coulumn is the coulumn of and the pivot element is -3.



Simplex iteration with found Pivot element
Fehler beim Erstellen des Vorschaubildes: Die Miniaturansicht konnte nicht am vorgesehenen Ort gespeichert werden

After the iteration one can recognize that the right side in the coulumn of has a positive sign again. Therefore it has not to be dealt with in addition. The solution is already optimal because of the positive values in the non basis. This makes the optimization step (Phase 2) obsolete and the optimization is done in this point.


Sources

OR-script,OR-wiki,OR-tutorium

Authors

Lucas Bertram, Niklas Drawert, Simon Liesenfeld