Download Chapter 5.6

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

System of linear equations wikipedia , lookup

System of polynomial equations wikipedia , lookup

Canonical normal form wikipedia , lookup

Transcript
5.6 No-Standard Formulations
1
 What
do you do if your problem formulation
does not have the Standard Form?
 This is an important issue because the simplex
procedure we described relies very much on
the standard form, eg
– the RHS coefficients are non-negative
–
–
–
availability of m slack variables
opt=max
and so on.
2
Standard Form
n
max Z   c j x j
x
j 1

• opt=max
• ~ 
• bi ≥ 0 , for all i. a11x1  a12 x2  ...  a1n xn  b1
a21 x1  a22 x 2  ...  a2 n x n  b2
.....
.....
...
....
.....
.....
...
....
am1 x1  am 2 x2  ...  amn xn  bm
x j  0 , j  1,...,n
3
Violation # 1
Minimization
 Observe
that the problem
z*:= minxX f(x)
is equivalent to the problem
z’:= maxxX -f(x)
in that both have the same set of optimal
solutions. Also, z’= -z*.
4
 1.
Remedies
Multiply the coefficients of the objective
function by -1 and maximize the new
objective function.
 2. Change a bit the simplex algorithm.
 Remark:
 Australia is a free country so in principle
you can use either of these two approaches.
 In 620-261 we (=I) prefer the second
approach.
5
5.6.1 Example
min Z  x1 - x2 - 2 x3
x
x1  2 x2 - x3  10
-2 x1  4 x 2 - 2 x 3  40
2 x1  3x2 - x 3  30
x1, x2 , x3  0
6
The coefficients of the objective function
are
c1=1 ; c2=-1 ; c3 = -2
so using the first appraoch, we multiply
them by -1 to obtain
c’1= -1 ; c’2= 1 ; c’3 = 2
We now use these new coefficients with
opt=max. Thus the equivalent form is:
7
max Z'  - x1  x 2  2 x 3
x
x1  2 x 2 - x3  10
-2 x1  4 x 2  2 x 3  40
2 x1  3x 2  x 3  30
x1 , x 2 , x3  0
BV
Eq. #
x4
8
x1
x2
1
0
x3
2
x1
Z'
x3
x4
x5
x6
RH S
4
0
1
1 /2
0
30
0
7 /3
1
0
1 /3
1 /3
7 0 /3
3
1
1 /3
0
0
- 1 /6
1 /3
1 0 /3
Z'
0
1 0 /3
0
0
5 /6
1 /3
1 3 0/3
After setting the simplex tableau and
conducting two pivot operations we obtain
the above final tableau.
The optimal solution is thus:
x*=(10/3,0,70/3,30,0,0)
The optimal value of the modified objective
function is: Z’ = 130/3
Thus the optimal value of the original
9
Thus the optimal value of the
original objective function is equal
to
Z* = - Z’ = - 130/3.

10
Preferred Approach
 Modification
in the Simplex Algorithm for
opt=min:
 1. Optimality Test:
– Stop if all the reduced costs are
nonpositive.
 2. Greedy Rule:
– Select the variable with the most positive
reduced cost.
11
Example
(Continued)
min Z  x1 - x2 - 2 x3
x
x1  2 x2 - x3  10
-2 x1  4 x 2 - 2 x 3  40
2 x1  3x2 - x 3  30
x1, x2 , x3  0
12
 We
do not change the data, only modify
the optimality test and greedy rule.
Thus, the initial tableau is the same for
opt=max and opt=min.
 Step 2 (Optimality Test):
Since there are positive reduced costs, we
continue.
 Step 3 (Variable in):
We select x3 as the new basic variable
because its reduced costs is the largest.
13  Step
4 (Variable out):
 The (usual) Ratio Test identifies x5 as the
leaving basic variable.
 Step 5 (Pivoting):
 As usual
 New tableau:
BV
Eq. #
x4
x1
x2
x3
x4
x5
x6
RH S
1
0
4
0
1
1 /2
0
30
x3
x6
2
- 1
2
1
0
1 /2
0
20
3
3
1
0
0
- 1 /2
1
10
Z
Z
1
- 3
0
0
- 1
0
- 40
14
BV
Eq. #
x4
x1
x2
x3
x4
x5
x6
RH S
1
0
4
0
1
1 /2
0
30
x3
x6
2
- 1
2
1
0
1 /2
0
20
3
3
1
0
0
- 1 /2
1
10
Z
Z
1
- 3
0
0
- 1
0
- 40
BV
Eq. #
x4
x1
x2
x3
x4
x5
x6
RH S
1
0
4
0
1
1 /2
0
30
x3
2
0
7 /3
1
0
1 /3
1 /3
7 0 /3
x1
3
1
1 /3
0
0
- 1 /6
1 /3
1 0 /3
Z
Z
0
- 1 0 /3
0
0
- 5 /6
- 1 /3
- 1 3 0 /3
 All
the reduced costs are nonpositive, so
we stop.
 Optimal solution: x=(10/3,0,70/3,30,0,0)
 Optimal value of the objective function:
Z* = -130/3.
15
Violation #2
Varaibles allowed to be negative
 Use
the following fact:
 Any number (positive or negative) can be
expressed as the difference of two positive
numbers.
 Thus, if say xj is not required to be
nonnegative, we can introduce two
additional variables, say x’j and x”j and set

xj = x’j-x”j
 with x’j,x”j >= 0.
16
 Clearly,
if x’j > x”j then xj>0, whereas if
x’j<x”j then xj<0. And if x’j=x”j then
xj=0.
 Thus, xj is indeed unrestricted in sign
(URS)
17
Example 5.6.3
max Z  4 x1  3 x2
x
2 x1  x2  40
x1  x2  30
x1
x1, x2 urs
 15
max 4 x1, - 4 x1,,  3 x,2 - 3x ,,2
18
where
x
,
,,
,
,,
2 x1 - 2 x1  x2 - x2  40
x1, - x1,,  x ,2 - x ,,2  30
,
,,
x1 - x1
 15
x1, , x1,, , x2, x,,2  0
x1  x1, - x1,,
,
,,
x 2  x 2 - x2
19
Violation #3
Negative RHS
 This
is handled by multiplying the
respective constraint by -1 and taking care
of the inequality sign if necessary (changing
<= to >= and >= to <=).
20
Example 5.6.4
4 x1 - 3 x2  x3  -13
-4 x1  3x 2 - x3  13
 Observe
that in fixing this violation we
created another one!
21
Violation # 4
<= constraint
 We
convert a “>=“ constraint to a “=“
constraint by introducing a surplus
variable.
 Im many respects surplus variables are
similar to slack variables.
22
Example 5.6.5
-4 x1  3x 2 - x3  13
= 13
-4 x1  3x 2 - x3 - x 4 
x4  0
(a)
}
Correction
(old notes)
 Convince
(b).
yourself that (a) is equivalent to
(b)
23
Violation #5
 There
= constraint
are two strategies to handle this
violation:
 1. Use the “=“ constraint to eliminate one
of the variables (Assignment # 3 !!!!)
 2. Use artificial variables.
 In 620-261 only the second approach is
allowed.
24
These variables are called “artificial”
because they are used temporarily, and
ultimately will disappear
 from the model (be set to zero).
Their sole purpose in life is to facilitate the
construction of a basic feasible solution.

Example 5.6.6
25
2 x1  x2  40
2 x1  x2  x 3  40 ,
 Convince
x3  0
yourself that the first is equivalent
to the second provided the artificial variable
(x3) is equal to zero!!!!!
 If you are not convinced see your
ophthalmologist!
 How do we force x3 to be equal to zero ??
 This is a good question that will be addressed
shortly.
26
An OverALL Example 5.6.7
min Z  3x1  5 x2
x
x1
4
- 2 x2  - 12
3x1  2 x2  18
x1, x2  0
27
 There
are a number of violations here!
 Opt = min
 An equality constraint
 A >= constraint
 A negative RHS
28
 To
fix the “min” violation, we consider a
modified objective function, namely

Z’ = - Z = -3x1 - 5 x2
so the objective now is:
max -3x1 - 5 x2
Constraints:
The first is in standard form (x1 <= 4). To
bring it to the canonical form we simply
use a slack variable, say x3, and write
x1 + x3 = 4
29
The second constraints (-2x2 = -12) has two
violations. The negative RHS is handled by
a multiplication by -1 to produce 2x2 = 12.
So we just have to deal with the “=“
violation.
30
 The
“=“ violation is handled by an
artificial variable, say x4. The resulting
canonical form of the constraint is thus
2x2 + x4 = 12
The third constraint (3x1 + 2x2 >= 18)
violates the “<=“ condition. It is handled
by a surplus variable and an artificial
variable. The surplus variable, say x5,
will produce an “=“ constraint:
3x1 + 2x2 - x5 = 18
31
The “=“ violation” is then handled by an
artificial variable, say x6. This yields the
following canonical form:
3x1 + 2x2 - x5 + x6 = 18
32
Complete Reformulation
max Z  -3x1 - 5x 2
x
x1 
2 x2 
3x1  2 x2 -
4
x3
x4
 12
x 5  x 6  18
x1, x2 , x3 , x 4 , x5 , x 6  0
33
 We
Important Remark
(all of us!) shall adopt the convention
that the auxiliary variables (slack, surplus,
artificial) are “named” in such a way that
the initial basis appears in the last m
columns of the “LHS”.
 Observe that the initial basis consists of:
Slack variables
Artificial variables
Example
34
x1 
4
x3
2x2 
3x1  2 x2 -
x4
 12
x 5  x 6  18
x1, x2 , x3 , x 4 , x5 , x 6  0
x1 
x4
2x2 
x5
(5.39)
x5  x3
x3  x4
4
 12
3x1  2 x2 - x 3 
x 6  18
x1, x2 , x3 , x4 , x 5 , x 6  0
x 4  x5
(5.40)