Академический Документы
Профессиональный Документы
Культура Документы
Module 1b
Linear Programming Geometric Solution Simplex Method Revised Simplex Method
Linear Programming
A Linear Programme (LP) is of the following form
Minimize/Maximize
z = c1 x1 + c2 x2 + ...... + cn xn
Replace urs variable with difference of two non-negative variables. x1 0, x3, x4 0 5 x1 + 2 * (x3 - x4) = 10, C) Converting Minimization Problem to Maximization Problem and Vice Versa Maximize z1 = cx Minimize z2 = cx
z = x1 + 2 x2 = 10 1
2 1
z = x1 + 2 x2 = 0
3 1
x1 z = x1 + 2 x2 = 5
Dr. Gajendra Kumar Adil, SJMSOM
3 Unbounded region
0 2 1
Bounded region
0 1 3 2 1
0 1
x1
Unbounded region
3 1
2 1
4 1 An empty feasible i
Simplex Basics
Geometric solution is not possible beyond three dimensions for which simplex can be used. Therefore, we develop the following k id f ll i key ideas used in simplex algorithm: di i l l ith 1. Corner feasible points (CPFS). Concept of adjacent CFPS. p ( ) p j 2. Develop optimality criteria (a check if a CPFS is optimal, that is no adjacent CFPS is better) is, 3. How to move from one CPFC to better adjacent CPFS. j 4. The process of detecting situations, un-boundedness and infeasibility. infeasibility
Dr. Gajendra Kumar Adil, SJMSOM
p halfspaces (of form x1 > 0) ; and p associated hyper planes (of form xi = 0)
This can be geometrically interpreted in p dimensional space as follows. The feasible region is formed by the intersection of p+m half spaces. Hence, p+m associated hyperplanes or boundaries of half spaces. yp p p At Corner points, p independent hyperplanes (of dimension p) are binding or intersect. For example, (i) p=2, intersection of two hyperplanes (i.e. lines) defines a point; (ii) p=3, intersections of three hyperplanes (i.e planes) is a point and so on. Corner points where p hyperplanes are binding are called face of dimension zero. Edge is face with di Ed i a f ith dimension 1 and can b d fi d b i t i d be defined by intersection of p-1 h ti f 1 hyperplanes. l
Dr. Gajendra Kumar Adil, SJMSOM
P1
x2
x1=0 E x1+x2 =6
x2=3
x2=0 A B
x1
(Characterization of CPFS)
Algebraically: Al b i ll Consider the polyhedral set defined by the following equations and/ inequalities.
m halfspaces (of form ai1x1 ++aipxp < bi );
Represent p h lf R t halfspaces ( f f (of form xi > 0 1 < i < p) ; and 0, ) d p associated hyper planes (of form xi = 0) for structural variables. and m half spaces (xp+i > 0, 1 < i < m) and m hyper planes for slack variables.
Solution:
Number of variables, n = p + m Number of equations = m Basic Solution (all variables have unique values): ( q ) Number of basic variables = m Number of variables required to be nonbasic = p from p+m (these indicate the binding hyperplane) Corner Point (unique values for each variable): intersection of p hyperplanes i e basic solution hyperplanes., i.e., gives a corner point.
Dr. Gajendra Kumar Adil, SJMSOM
Given B, the solution of the form xB = B1b and xN = 0 is called a basic solution.
Example Problem 2: Consider polyhedral set of Example Problem 1 (P1) and convert them
into standard form. Constraints Ax = b are two (=m) equations in four (n=m+p) unknowns. =6 (1) x1 + x2 + x3 x2 + x4 =3 (2) x1 0, x2 0, x3 0, x4 0 (3-6)
1 1 1 0 A = , x = [x1, x2, x3, x4]T , b = [6, 3] T . 0 1 0 1
It is possible to express any two (=m) basic variables in terms of other two (p=n-m) non-basic variables, assuming that equations 1 and 2 are independent (there are a maximum of 4C2 = 6 ways to select basis). The following illustrates the enumeration.
1.
*Indicating Variable having value 0 on the hyperplane ** for technology constraint of other type the indicating variable is chosen as follows: type (introduce x6 surplus and x7 artificial variable) = type (introduce x8 artificial variable) x1 x2 + x3 20 x1 x2 + x3 = 20 x6 + x7
x1 x2 - x3 = 30
x1 x2 - x3 =
30
x8
z x1
+ x2 +x2 x2 x2
= -6 =6 =3 =3
The above can be re-written as a problem reduced in terms of nonbasic variables ( (xN) as the basic variables (xB) just act as slack variables (i.e., they appear in ( j ( y pp just one equation with coefficient 1).
A = [a1 cB = [ cB1 B = [a B1
xN 1 xB1 b1 0 x b 0 xN 2 xB = B 2 , x N = , 0 = ,b = 2 M M M M xN ( m n ) 0 xBm bm
xB +
y
jR
xj = b
(T1 - Tm )
(where R is the current set of indices of the nonbasic variable) xB1 y1, N 1 x y B 2 + 2, N 1 M M xBm ym , N 1 y1, N 2 y2, N 2 M ym , N 2 y1, N ( m n ) y2, N ( m n ) M M L ym , N ( m n ) L L xN 1 b1 x N 2 = b2 M M xN ( m n ) bm
Dr. Gajendra Kumar Adil, SJMSOM
L B 11m b1 L B 12 m b2 M M M L B 1mm bm
Dr. Gajendra Kumar Adil, SJMSOM
jR
(cB B aj cj ) xj = cB B b
jR
(zj cj ) xj = z0
1
(0)
and
z0 = cB B b is a constant)
Thus, Reduced Problem (RP) in Non-basic Variable Space is: Minimize z = z0 - jR (zj cj ) xj ( Subject to jR yj xj b , xj > 0 jR
Dr. Gajendra Kumar Adil, SJMSOM
x B1 0 x B1 0 : : x Bm 0
: y m,Np
:
bm
Feasibility condition: The basic solution is feasible if, xB = B1b 0 (should satisfy non-negativity constraints to be a bfs). Optimality condition: If reduced cost (zj cj) 0 for all jR the jR, current basic feasible solution (cbfs) is optimal for a minimization problem.
Note that at the current bfs there are p hyperplanes (including xk=0) are binding. When we set xk > 0, we have only p-1 binding hyperplanes which defines the edge along which we travel until we hit the hyperplane xBr =0, at the next corner point and we again have p binding hyperplanes. Or if we cannot find xBr =0 the we hit unboundness and in that case the edge is an extreme direction).
Dr. Gajendra Kumar Adil, SJMSOM
x1 2 1 x = 1 0 x3 2
Maximum value of x3 is 2 (any larger value of x3 will force x1 to be negative). Which hyperplane it hits first? x1= 0. New bfs [x1, x2, x3, x4] = [0,1,2,0] (Note: old bfs =[2, 1, 0, 0]. Thus the direction of travel along the edge is: [0-2,1-1, 2-0, 2-0 0-0]) x3 enters basis improvement in z = (z3-c3)*x3 = 2.
Dr. Gajendra Kumar Adil, SJMSOM
Simplex for p =1
Simplex for p =2 2
Simplex for p =3
Infeasibility
Solution does not improve with artificial variable(s) still in the basis.
Termination: Unboundedness
Unboundedness: There is no blocking hyperplane from the current solution along the simplex or simplices. Or one moves from the current vertex along an extreme direction. Example Problem 9: Minimize z = -x1 3x2 x Subject to x1 2x2 + x3 =4 -x1 + x2 + x4 = 3 x1, x2, x3, x4 > 0 0.
Coefficient Iteration BV z 1 x3 x4 z 2 x3 x2 z 1 0 0 1 0 0 x1 1 1 (-1) 4 (-1) (-1) x2 3 (-2) 1 0 0 1 x3 0 1 0 0 1 0 x4 0 0 1 (-3) ( ) 2 1 RHS 0 4 3 (-9) ( ) 10 3 0 3 .... .... x2 enters x4 leaves x1 can enter soln unbounded Ratio Remarks
Direction of Unboundedness
In case x1 is increased and x4 is kept at 0, the solution is unbounded. We can represent a direction along which the solution is unbounded in terms of current bfs (cbfs) as vertex as shown next.
Direction of Unboundedness
x1 x2 x3 x4 xB xN xB xj xk x1 x2 x3 x4 =
k
x1 x2 = x3 x4 xB = xN xB = 0 0 0 3 10 0 + x1 bfs
bfs
d1 + bfs d2 d3 d4 dB + xk dN -yk + xk 0 1 1 1 1 0
Extreme direction d = (1, 1, 1, 0). For minimization problem the condition for unboundedness, cd < 0.
Extreme direction
As can be seen, for a given basis and hence B and B-1, we can generate the information on RHS column and column of nonbasic variables to conduct optimality check and ratio test using the following formulas:
Let simplex multipliers (shadow prices) (Row 0 ) w = cB B-1 Column of a nonbasic variable xj: (Not stored) The reduced costs of xj = cB B-1 aj cj = w aj cj cB B-1 b =wb = B-1b
Dr. Gajendra Kumar Adil, SJMSOM
(Constraint rows) Column of xj in the constraints = yj = B-1 aj Right hand side column(Row 0 ) (Constraint rows)
Not required
0 0 1
Row No R1 R2 R3
Solution
Varble RHS
0 1 0 0 0 0 1 0 0 0 0 1 z= 0 9 2 4
X4 = X5 = X6=
3 X3
1 1 -1 -1 1
1
1 1 1 -1 1
1
2 -1 1 4
-4 X3
Step 3
i Basis X4 X5 X6 Column for Entering -1 Variable, yk = B ak 2 -1 1 RHS Column Ratio ( bi /yik) 4.5 --4 Leaving Variable
b
9 2 4
1 2 3
X6
Solution
VarbleValue (RHS)
0 1 0 0 0 0 1 0 4 z= -2 16 1 6 4
X4 = 1 X5= 1 X3=
6 X6
1 1 -1 1 -1
-3 X1
1 1 1 -1
5
0 0 1 0
4
Step 3
i Basis 1 X4 2 X5 3 X3 Column for Entering -1 Variable, yk = B ak 3 0 -1 RHS Column
b =B b
1 6 4
-1
1 0 0.3333
0 0 1 0
2 -0.667 0.667
5 X4
2 X2
6 X6
1 0 0 0
4
1 1 1 -1
1
0 clarity
2