Линейное программирование. Ч.1. Учебное пособие для бакалавриата
.pdf
4. Simplex method
The basic solution X1 is a corner point (a vertex) of the feasible region.
Example. Find the basic solution of the linear programming problem.
f =2x3 +x4 +3 →max
x1 +4x3 −2x4 =4,x2 +5x3 +3x4 =5,
xi ≥0, i =1;2;3;4.
Solution.
If we substitute in the main constraints that
x3 =0,
x4 =0.
We get
x1 =4,
x2 =5.
So
X1 =(4,5,0,0)≥0.
And
f (X1 )= f (4,5,0,0)=3 .
Remark. From a geometric point of view the main idea of the simplex method is moving from one corner point (a basic solution) of the feasible region to another corner point to improve the value of the objective function until it will be reached the optimum.
Remark. The objective function can be reduced to the form
f +γr +1xr +1 +γr +2xr +2 + +γnxn = γ0
The data of the linear programming problem (1.5) can be written in the table (called the simplex table) as follows.
— 31 —
4. Simplex method
Fig. 6
x1 |
|
b1 |
|
1 |
0 |
0 |
0 a1,r +1 |
a1j |
a1n |
|
|
|
|||||||||
x2 |
|
b2 |
|
0 |
1 |
0 |
0 |
a2,r +1 |
α2j |
α2n |
|
|
|
|
|
|
|||||
xk |
|
bk |
|
0 |
0 |
1 |
0 |
ak,r +1 |
akj |
akn |
|
|
|
|
|
|
|||||
xr |
|
br |
|
0 |
0 |
0 |
1 |
ar,r +1 |
arj |
arn |
f |
|
γ0 |
|
0 |
0 |
0 |
0 |
γr +1 |
γj |
γn |
Definition. The coefficient γj in the row corresponding objective function (the index row) at the intersection with the column corresponding to the free variable xj is called the evaluation of the free variable xj .
— 32 —
4. Simplex method
Algorithm of the simplex method (maximum)
1)Choose j-th pivot column from the condition: the evaluation γj <0 and at least one element aij >0 ;
2)Choose k-th pivot row from the condition:
b |
|
|
|
b |
|
||
k |
= min |
i |
for aij >0 ; |
akj |
|
||
aij |
|||
|
|
|
|
3)Recalculate the elements of the simplex table by using the Jordan-Gauss algorithm.
4)Repeat step 1.
Remark. The pivot akj is positive.
Remark. All elements of the simplex table are recalculated by using «the rectangle rule»:
a)
aim aij
akm akj
aim′ = akjaima−kjaijakm ; i ≠ k
akm′ = akm ≥0 . akj
b)
bi aij
bk akj
bi′ = akjbia−kjaijbk ; i ≠ k
— 33 —
4. Simplex method
bk′ = bk ≥0 .
akj
After the recalculation or before it there are possible three variants.
1) All evaluations are nonnegative (γj ≥0) then the optimum is attained.
Indeed
f = γ0 −(γ +1x +1 +γ +2x +2 + +γ x )≤ γ0
r r r r n n
≥0
Hence
Xmax = X1 =(b1,b2, ,br ,0,0, ,0)
and
fmax = f (Xmax )= γ0 .
2) There exists evaluation γj <0 and all elements of j-th column αij ≤0 (i =1, ,r) then the objective function is not bounded f → +∞ .
Indeed, if all the free variables except xj are equal to zero we get
x = b −a x ≥ b ≥0 .
i i ij j i
≤ 0
So, the vector
X =(b1 −a1jxj,b2 −a2jxj, ,br −arjxj,0, 0,xj,0, ,0)
is feasible and if xj → +∞ , then
f = γ0 −γ x → +∞
j j
<0
3) There exists evaluation γj <0 and at least one element of the j-th column aij >0 then the value of the objective function can be improved by the next iteration.
Indeed,
— 34 —
|
|
aijbk |
|
|
b |
|
|
b |
|
4. Simplex method |
||||
|
′ = b − |
|
= a |
− |
|
≥0; i ≠ k |
|
|||||||
b |
|
|
|
|
|
i |
|
k |
|
|
||||
a |
|
|
|
|
a |
|
||||||||
i |
i |
|
ij a |
|
|
|
|
|||||||
|
|
kj |
|
|
|
|
ij |
|
|
kj |
|
|
||
|
|
|
b ′ = |
bk |
|
≥0 . |
|
|
|
|||||
|
|
|
|
|
|
|
|
|||||||
|
|
|
|
k |
akj |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Thus, the new basic solution |
X′≥0 |
|
||||||||||||
|
′ |
|
|
|
|
|
bkγj |
|
|
|
|
|
||
|
f(X ) = γ0′ = γ0 − |
|
|
|
|
≥ γ0 = f(X) . |
(5) |
|||||||
|
|
akj |
|
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Remark. It follows from (5) that if γj =0 then f(X′) = f(X).
Thus, if we have found the optimal solution X1* and there is the evaluation γj =0 then there exists the alternative optimal solution X2* , To find it we must make new iteration choosing the j-th column as the pivot column. In this case the linear programming problem has infinite solutions
X* =tX1* +(1−t)X2*; t [0;1] .
Similarly, the algorithm of the simplex method for the minimum problem can be formulated.
Algorithm of the simplex method (minimum)
1)Choose j-th pivot column from the condition: the evaluation γj >0 and at least one element aij >0 ;
2)Choose k-th pivot row from the condition:
b |
|
|
|
b |
|
||
k |
= min |
i |
for aij >0 ; |
akj |
|
||
aij |
|||
|
|
|
|
— 35 —
4.Simplex method
3)Recalculate the elements of the simplex table by using the Jordan-Gauss algorithm.
4)Repeat step 1.
Example. Find the solution of the liner programming problem by the simplex method.
f =3x1 +3x2 +21 →max
−2x1 +x2 ≤1,x1 −x2 ≤3,x1 +x2 ≤7,
xi ≥0.
Solution
The problem is written in the standard form. To apply the simplex method, we have to transform it to a canonicals form. Using the slack variables x3,x4,x5 we get
f =3x1 +3x2 +21 →max
−2x1 +x2 +x3 =1,x1 −x2 +x4 =3,x1 +x2 +x5 =7,
xi ≥0.
Now let us form a simplex table.
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
|
|
|||
x3 |
1 |
−2 |
|
1 |
|
1 |
0 |
0 |
|
1/1 =1 |
|
−1 |
|||||||||||
x4 |
3 |
1 |
0 |
1 |
0 |
|
|
||||
x5 |
7 |
1 |
1 |
0 |
0 |
1 |
|
7/1 =7 |
|||
f |
21 |
−3 |
−3 |
0 |
0 |
0 |
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
We have the basic solution that is the starting corner point of the feasible region
— 36 —
4. Simplex method
X1 =(0,0,1,7,3),
And
f (X1 )=21 . We have the negative evaluation
γ2 = −3 <0 .
So, the second row is a pivot column. In this column we must find the minimal ratio
bk
akj
We obtain
Thus,
|
|
|
b |
|
|
= min |
i |
for aij >0 . |
|
||
aij |
||
|
|
|
min 1,7 =1.
1 1
a12 =1
is a pivot.
Now we can recalculate the elements of the simplex table by using the Jordan-Gauss algorithm.
After recalculation we get the following simplex table.
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
x2 |
1 |
−2 |
1 |
1 |
0 |
0 |
x4 |
4 |
−1 |
0 |
1 |
1 |
0 |
x5 |
6 |
3 |
0 |
−1 |
0 |
1 |
f |
24 |
−9 |
0 |
3 |
0 |
0 |
|
|
|
|
|
|
|
Note that in the new table the variable x2 has become a basic one and the variable x3 has become a free one
( x3 ↔ x2 ).
We have new the basic solution
X2 =(0,1,0,4,6).
— 37 —
4. Simplex method
And
f (X2 )=24 > f (X1 )=21.
Note that the value of the objective function at the new corner point X2 is greater than the value at the starting point X2
In the new simplex table, we have only one negative evaluation
γ1 = −8 .
So, the first column is a pivot one. There is only one positive number in this column
a31 =3 .
Thus, a31 is a pivot. In the new table the variable x1 will be a basic one and the variable x5 will be a free one ( x5 ↔ x1 ).
After recalculation by using the Jordan-Gauss algorithm we obtain the following simplex table.
basis |
bi |
x1 |
x2 |
x3 |
x4 x5 |
|
x2 |
5 |
0 |
1 |
1/3 |
0 |
2/3 |
x4 |
6 |
0 |
0 |
2/3 |
1 |
1/3 |
x1 |
2 |
1 |
0 |
−1/3 0 |
1/3 |
|
f |
42 |
0 |
0 |
0 |
0 |
3 |
|
|
|
|
|
|
|
In this table all evaluations are non-negative, so the maximum is attained.
X1max* =(2,5,0,6,0),
fmax = f (X1max* )=42.
But the evaluation
γ3 =0 .
So, we the alternative optimum. To find another optimal solution we need to select the third column as the pivot column. In this column we have the following minimal positive ratio,
— 38 —
4. Simplex method
|
5 |
|
6 |
|
= |
6 |
min |
|
, |
|
|
|
|
|
2/3 |
2/3 |
||||
1/3 |
|
|
|
|||
Thus, a23 =2/3 is a pivot (x4 ↔ x3) After recalculation we get the table.
.
.
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
x2 |
2 |
0 |
1 |
0 |
−1/2 |
1/2 |
x3 |
9 |
0 |
0 |
1 |
3/2 |
1/2 |
x1 |
5 |
1 |
0 |
0 |
1/2 |
1/2 |
f |
42 |
0 |
0 |
0 |
0 |
3 |
It follows from this table that another optimal solution
is X2max* =(5,2,9,0,0).
Now by using the convex combination we can find the set of all solutions of the problem (the general solution):
X =(1−t)X1max* +tX2max* =
=(1−t)(2, 5, 0, 6, 0)+t(5, 2, 9, 0, 0); t [0,1].
Or
X =(2+3t, 5−3t, 9t, 6 −6t, 0); t [0,1].
Taking into account, that the initial problem has two variables, we finally get
X =(2+3t, 5−3t); t [0,1].
fmax =42 .
The geometrical interpretation
The intersections of the of boundaries of the feasible region give us the following corner points
O(0,0), A(0,1), B(2,5), C(5,2), D(4,0).
— 39 —
4. Simplex method
f =3x1 +3x2 +21 → max
−2x1 +x2 ≤1,x1 −x2 ≤3,x1 +x2 ≤7,
x ≥0.
Fig. 7
So we start at point O (f (O)=21), then we move to point A (f (A)=24). From it we get to point B (f (B)=42), which gives us the optimal solution, and then we move to another optimal point C (f (C)=42). Thus, the optimal solution is determined by the side CB.
Example. Find the solution of the linear programming problem by using the simplex method.
f =2x1 −x2 +3x3 −2x4 +x5 →max−x1 +x2 +x3 =1,
x1 −x2 +x4 =1,x1 +x2 +x5 =2,
x ≥0.i
— 40 —
