Линейное программирование. Практикум. Учебное пособие для бакалавриата
.pdf
5. Method of artificial variables
a12 =1
is the pivot (x3 ↔ x2 ) .
After recalculation we have the following table.
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
y1 |
x2 |
1 |
−1 |
1 |
1 |
0 |
0 |
0 |
y1 |
16 |
4 |
0 |
−3 −1 0 |
1 |
||
x5 |
32 |
4 |
0 |
−1 |
0 |
1 |
0 |
f |
−11 |
4 |
0 |
−3 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
F |
−16 |
−4 |
0 |
3 |
1 |
0 |
0 |
|
|
|
|
|
|
|
|
In this table we have only one the negative evaluation
γ1 = −4 < 0 .
So, the first column is a pivot column. In this column we find the minimal ratio. We obtain
|
|
|
|
|
16 |
|
32 |
|
= 4 . |
|
|
||
|
|
|
|
min |
|
, |
|
|
|
|
|||
|
|
|
|
|
|
|
|
||||||
|
|
|
|
|
4 |
|
4 |
|
|
|
|
|
|
Thus, |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
a21 = 4 |
|
|
|
|
|||
is a pivot (y1 ↔ x1) . |
|
|
|
|
|
|
|
|
|
|
|||
After recalculation we obtain. |
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
basis |
bi |
|
x1 |
x2 |
|
x3 |
|
|
x4 |
x5 |
y1 |
|
|
x2 |
5 |
|
0 |
1 |
1/4 |
|
−1/4 |
0 |
1/4 |
|||
|
x1 |
4 |
|
1 |
0 |
−3/4 |
−1/4 |
0 |
1/4 |
||||
|
x5 |
16 |
|
0 |
0 |
|
2 |
|
|
1 |
1 |
−1 |
|
|
f |
−27 |
|
0 |
0 |
|
0 |
|
|
1 |
0 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
F |
0 |
|
0 |
0 |
|
0 |
|
|
0 |
0 |
1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
— 51 —
5. Method of artificial variables
In this table all evaluations are non-negative, so the maximum is attained.
Fmax = 0
and
y1 = 0 .
So, the initial linear programming problem is feasible, and we have found its basic solution. We can begin the second phase. We get.
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
x2 |
5 |
0 |
1 |
−1/ 4 1/ 4 0 |
||
x1 |
4 |
1 |
0 |
−3/ 4 −1/ 4 0 |
||
x5 |
16 |
0 |
0 |
2 |
1 |
1 |
f |
−27 |
0 |
0 |
0 |
1 |
0 |
|
|
|
|
|
|
|
In this table all evaluations are non-negative, so the maximum is attained.
X1max* = (4, 5, 0, 0, 16) ,
fmax = f (X1max* )= −27 .
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 only one positive number
a33 =2 .
Thus, a33 is a pivot (x5 ↔ x3 ) ..
After recalculation we get the table.
— 52 —
5. Method of artificial variables
basis |
bi |
x1 |
x2 |
x3 |
x4 |
x5 |
x2 |
3 |
0 |
1 |
0 |
−3/ 8 −1/ 8 |
|
x1 |
10 |
1 |
0 |
0 |
1/ 8 |
3/ 8 |
x3 |
8 |
0 |
0 |
1 |
1/2 |
1/2 |
f |
−27 |
0 |
0 |
0 |
1 |
0 |
|
|
|
|
|
|
|
So,
X2max* = (10, 3, 8, 0, 10) .
And the optimal solution of the initial problem is
X = (1−t)X1 +tX2 = |
|
|
|
) |
|
|||||||
( |
|
−t |
)( |
|
) |
( |
|
|
|
= |
||
1 |
|
4, 5, 0, 0, 16 |
|
+t 10, 3, 8, 0, 0 |
|
|||||||
= |
( |
4 +6t, 5 −2t, 8t, 0, 16 −16t |
) |
[ |
|
|
] |
|||||
|
|
|
, t |
0,1 . |
||||||||
fmax = −27 .
Example. Find the solution of the linear programming problem f = x1 +2x2 +9 → max
x1 +x2 −x3 =2,x1 +4x2 +x4 =1,−x1 +x2 −x5 = 3,
xi ≥ 0.
Solution.
We have the basis variable x4 in the second equation. Therefore, we need to add an artificial variable y1 and y2 in the first and third equations. We obtain
F = −y1 −y2 → maxx1 +x2 −x3 +y1 =2,
x1 +4x2 +x4 =1,
−x1 +x2 −x5 +y2 = 3,
f −x1 −2x2 = 9xi ≥ 0,yj ≥ 0.
— 53 —
5. Method of artificial variables
We find from the main constraints
y1 =2 −x1 −x2 +x3,
y2 = 3 +x1 −x2 +x5.
Using these expressions, we have
F= −y1 −y2 = −(2 −x1 −x2 +x3 )−(3 +x1 −x2 +x5 )= ,
=−5 +2x2 −x3 −x5.
Or
F −2x2 +x3 +x5 = −5 .
And get the following simplex table.
basis |
bi |
x1 |
x2 |
x3 x4 |
x5 |
y1 |
y2 |
|
y1 |
2 |
1 |
1 |
−1 0 0 |
1 |
0 |
||
x5 |
1 |
1 |
4 |
0 |
1 |
0 |
0 |
0 |
y2 |
3 |
−1 1 |
0 |
0 |
−1 |
0 1 |
||
f |
9 |
−1 −2 0 |
0 |
0 |
0 |
0 |
||
|
|
|
|
|
|
|
|
|
F |
−5 |
0 |
−2 1 |
0 |
1 |
0 |
0 |
|
|
|
|
|
|
|
|
|
|
We have only one negative estimation
γ2 = −2 < 0 .
So, the second column is a pivot column. From this column we obtain
|
2 |
|
1 |
|
3 |
|
= |
1 |
. |
min |
|
, |
|
, |
|
|
|
||
|
|
|
|
||||||
|
1 |
|
4 |
|
1 |
|
|
4 |
|
Thus,
a22 = 4
is the pivot (x5 ↔ x2 ) .
After recalculation we have.
— 54 —
5. Method of artificial variables
basis |
bi |
x1 |
x2 x3 |
x4 |
x5 |
y1 |
y2 |
|
y1 |
7 / 4 |
3/ 4 0 −1 −1/ 4 0 |
1 0 |
|||||
x2 |
1/ 4 |
1/ 4 |
1 |
0 |
1/ 4 |
0 |
0 |
0 |
y2 |
11/ 4 |
−5/ 4 0 |
0 |
−1/ 4 −1 |
0 |
1 |
||
f |
19 /2 |
−1/2 |
0 |
0 |
1/2 |
0 |
0 |
0 |
|
|
|
|
|
|
|
|
|
F |
−9 /2 |
1/2 |
0 |
1 |
1/2 |
1 |
0 |
0 |
|
|
|
|
|
|
|
|
|
In the table all evaluations are non-negative, so
Fmax = −9 /2 < 0 .
It shows us that the initial linear programming problem is infeasible.
Questions for self-control
1)For which linear programming problems do we use the method of artificial variables?
2)How we use the artificial variables?
3)What is the artificial objective function?
4)How to determine using the method of artificial
variables |
that |
the |
initial |
linear |
programming |
problem |
is feasible? |
|
|
|
|
|
|
5) How to determine using the method of artificial |
||||||
variables |
that |
the |
initial |
linear |
programming |
problem |
is infeasible?
Exercises for independent work
Find the solution of the linear programming problems by using the method of artificial variables.
f = −x1 −x2 −4x3 +5x4 → max
1) 4x1 +x2 = 4,
12x1 +3x2 −x3 +x4 =12,xi ≥ 0.
— 55 —
5. Method of artificial variables
f =2x1 −x2 −2x3 +x4 +12 → max
+4x2 +x3 =10,
2)7x1 +x3 +4x4 = 42,x1 +3x2 −x5 =14,x ≥ 0.
i−x1
f = x1 −3x2 −5x3 −x4 +6 → max
3)x1 +x2 =1,
2x1 +11x2 +12x3 +3x4 =14,
xi ≥ 0.
f = x3 +x4 +x5 → max2x1 +3x2 −x3 =23,
4)x1 −2x2 −x4 =1,2x1 −x2 +x5 =1,x ≥ 0.
i
f = x2 +x3 +x5 −14 → max
+4x2 −x4 = 9,
5)−3x1 +x2 +3x4 = 3,x1 +5x2 +x3 +2x4 = 4,x ≥ 0.
i2x1
f = −6x1 +x3 +3 → max
−x3 = 3,
6)5x2 +x3 +x4 = 30,3x1 −x3 −x5 = 6,x ≥ 0.
i3x1 −x2
— 56 —
6.DUALITY
6.1.Symmetric Dual problems
Example. Consider the planning problem
f = CT X → max
AX ≤ B,
X ≥ 0.
where A = (aij )isthetechnologicalmatrix, C = (c1,c2, ,cn )T is the price vector, B = (b1,b2, ,bm )T –is the vector of supply of the resources, X = (x1,x2, ,xn )T is the production plan vector. The alternative of the production is the selling
the resources at |
the prices p = (p1, p2, , pm )T . Subject |
to the constraint |
pT A ≥ CT and the cost of the resources |
pT B = BT p to be minimizing. Thus, we have the linear
programming problem
g = BT p → min
AT p ≥ C,p ≥ 0.
Definition. The linear programming problems
|
The primal problem |
The dual problem |
||
|
|
|||
f (X)= CT X +c0 → max |
g(Y)= BTY +c0 → min |
|||
|
AX ≤ B, |
|
T |
Y ≥ C, |
|
A |
|
||
|
|
|
≥ 0. |
|
X ≥ 0. |
Y |
|||
|
|
|
|
|
are called the symmetric dual problems.
— 57 —
6. DUALITY
Example. Construct the dual problem for the linear programming problem
f = −10x1 +6x2 +3x3 +4 → max
8x1 −7x2 −2x3 ≤1,−9x1 +5x2 +2x3 ≤ 4,
x1 ≥ 0,x2 ≥ 0,x3 ≥ 0,
Solution.
g = y1 +4y2 +4 → min |
||
|
|
≥ −10, |
8y1 −9y2 |
||
|
|
|
−7y1 +5y2 ≥ 6, |
||
−2y +2y ≥ 3, |
||
|
1 |
2 |
y |
≥ 0, y |
≥ 0. |
1 |
2 |
|
6.2. Asymmetric Dual problems
Definition. The linear programming problems
The primal problem |
The dual problem |
|
|
|
|
f (X)= CT X → max |
g(Y)= BTY → min |
|
AX = B, |
||
|
||
|
ATY ≥ C |
|
X ≥ 0. |
|
are called the asymmetric dual problems
Remark. This formulation is consistent with the symmetric dual problems if the equation AX = B will be written as the system of inequalities
AX ≤ B,
AX ≥ B,
— 58 —
6. DUALITY
or
AX ≤ B,
−AX ≤ −B.
Example. Construct the dual problem for the linear programming problem
z = 4x1 −5x2 +8x3 +1 → max
x1 −2x2 +7x3 = 3,−4x1 −7x2 +6x3 = −8,
x1 ≥ 0,x2 ≥ 0,x3 ≥ 0.
Solution.
f = 3y1 −8y2 +1 → min
y1 −4y2 ≥ 4,−2y1 −7y2 ≥ −5,
7y1 +6y2 ≥ 8.
6.3. General formulation of the dual problems
Let the primal linear programming is defined by the augmented matrix
|
a11 |
a12 |
a1n |
|
≤ |
|
b1 |
||
|
|
|
|||||||
|
a21 |
a22 |
a2n |
|
= |
|
b2 |
||
A |
|
|
|
|
|
|
|
|
|
= |
|
|
|
||||||
|
am1 am2 |
amn |
|
≥ |
|
bm |
|||
|
|
|
|
|
|
|
|
|
|
|
≥ |
~ |
≤ |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
c1 |
c2 |
cn |
|
|
|
c0 |
|
|
|
|
|
|
|
|
|
|
→max |
|
|
|
|
|
|
|
|
||
— 59 —
6. DUALITY
Then the dual problem has the matrix
|
a11 a21 |
am1 |
|
≥ |
|
c1 |
|||
|
|
|
|||||||
|
a12 a22 |
am2 |
|
= |
|
c2 |
|||
A |
|
|
|
|
|
|
|
|
|
′ = |
|
|
|
||||||
|
a1n a2n |
amn |
|
≤ |
|
cn |
|||
|
|
|
|
|
|
|
|
|
|
|
≥ |
~ |
≤ |
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
b1 |
b2 |
bm |
|
|
|
c0 |
|
|
|
|
|
|
|
|
|
|
→min |
|
|
|
|
|
|
|
|
||
Algorithm (general case)
1)The non-trivial constraint of the type of equality in the primal problem corresponds to the condition of the absence of constraints in the primal problem and vice versa.
2)The row of inequalities of the maximum problem goes into the column of inequalities of the minimum problem with the changing of sign on the opposite, and the column of inequalities goes into the row of inequalities with preserving of the sign.
3)And conversely: the row of inequalities of the minimum problem goes into the column of inequalities of the maximum problem with the preserving of sign and the column of inequalities goes into the row of inequalities with changing of the sign on the opposite.
Example. Construct the dual problem for the linear programming problem
f = 4x1 −5x2 +8x3 −10x4 +x5 +14 → min |
||||
x −2x +7x −x ≤ 37, |
||||
|
1 |
2 |
3 |
5 |
|
|
−7x2 |
+4x4 −9x5 ≥ −28, |
|
−4x1 |
||||
2x +6x −4x +x = 48, |
||||
|
1 |
3 |
4 |
5 |
x ≥1,x ≥ 0,x ≤ 0,x ≥ 0. |
||||
|
1 |
2 |
3 |
4 |
— 60 —
