artificial variables web
PDF · 9 pages · 246.5 KB
Open PDF file
A document saved by Phil from a web page by Prof. Lobos (Industrial Engineering, Arizona State University), with Phil's introductory note dated 12.1.04. It explains adding slack and artificial variables for Type II and equality constraints to get a starting identity matrix. It then works one example by the Big-M method and again by the Two Phase method, noting the drawbacks of Big-M. Equations and tableaus were lost in extraction.
AI-written summary; may contain errors.
Extracted text (machine-read; may contain errors)
Artificial Variables
[ This is an excellent presentation I found on the web at
eal.asu.edu/lobos/iee476/Instructor's%20Section/ Others/Support%20Modules/Artificial.doc
It even comments on handling equality constraints. Author is Mr. Lobos, a Professor of
Industrial Engineering with the Electronics Assembly Lab at Arizona State University.
The EAL research does sound very simplex oriented! -PhL 12.1.04 ]
The previous example problem contained only Type I () inequalities. When
other constraint types are present (Type II and equality constraints), the set-up is
necessarily different. Recall earlier the need for an identity matrix embedded within the
original tableau was indicated. When the problem involves only Type I inequalities, the
slack variables automatically form this identity matrix. When other types of
constraints are present this may be untrue so you must add “artificial variables” to form
a starting basic solution (identity matrix). The complete set-up of the simplex method
including artificial variables follows.
For Type I inequalities of the form
1
2
2
1
1
B
X
A
X
A
+
you need only add a slack
variable to form a constraint equation of the form
1
1
2
2
1
1
B
S
X
A
X
A
=
+
+
. For equality
constraints you add an “artificial variable”, thus a constraint of the form
2
2
2
1
1
B
X
A
X
A
=
+
becomes
2
1
2
2
1
1
B
R
X
A
X
A
=
+
+
where
1
R is the artificial variable.
For Type II inequalities you subtract a slack variable and add an artificial
variable. Thus a constraint of the form
3
2
2
1
1
B
X
A
X
A
+
becomes
3
2
2
2
2
1
1
B
R
S
X
A
X
A
=
+
−
+
, where
2
S is the slack and
2
Rr is the artificial variable.
For equality constraints we simply add a slack variable.
Key insight Note that the slack variables added to Type I constraints and
the artificials added to Type II and equality constraints have two important
properties. They are unique to that equation (don’t appear anywhere else!), and
they have a +1 coefficient. As a result a collection of their coefficient columns is
always an identity matrix.
The variables added to Type II inequalities and equality constraints are called
“artificial variables” because they have no real physical meaning. Their only purpose
is to provide a convenient starting basic solution. Note that the only value they can take
on is zero if the equations are to truly represent the actual constraints. Thus the original
basic solution (in which the artificial variables are positive) is not really feasible in terms
of the original constraints. Therefore, in the subsequent iterations of the simplex method
the artificial variables must be forced to become zero so that the solution becomes
feasible in terms of the true problem constraints. There are several ways to do this. The
classical method is referred to as the “Big-M method”, which will be discussed next.
The Big-M Method
Returning to the problem of forcing the artificial variables to be zero, one way
which you could insure that these variables become zero is to attach a large penalty in the
objective function for positive values. To do this we simply assign these artificial
variables large negative coefficients (-M) in maximization problems and a large positive
coefficients (+M) in minimization problems. Thus the objective function becomes in the
maximization case:
Max:
=
=
−
m
i
i
j
n
j
j
MR
X
C
1
1
And in the minimization case:
Min:
=
=
+
n
j
m
i
i
j
j
MR
X
C
1
1
Where the M is some large number in comparison to the
jc .
To illustrate, consider the following example problem:
Max:
3
2
1
0
5
3
2
X
R
X
X
−
+
=
St:
7
3
2
1
=
+
+
X
X
X
10
5
2
3
2
1
+
−
X
X
X
0
,0
,0
3
2
1
X
X
X
.
Introducing slack and artificial variables, the constraints become:
7
1
3
2
1
=
+
+
+
R
X
X
X
10
5
2
2
1
3
2
1
=
+
−
+
+
R
S
X
X
X
The objective should then be modified to become:
Max:
2
1
3
2
1
0
5
3
2
MR
MR
X
X
X
X
−
−
−
+
=
.
Putting the problem in tableau format it becomes:
Basic
0
X
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
X
1
-2 -3 5 0
M M
0
1
R
0
1 1 1 0
1 0
7
2
R
0
2 -5 1 -1
0 1
10
Note that this tableau is not in the proper form; the objective row
0
X must be in terms of
only non-basic variables; i.e. the objective row coefficients of the basic variables must
be zero. The M’s in the
1
R and
2
R columns must then be changed to zeros using row
operations. So you multiply Row 1 and Row 2 by –M and add them to Row 0 to obtain:
Basic
0
X
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
X
1
-2 -3 5
-3M +4M -2M M
0 0
-17M
1
R
0
1 1 1 0
1 0
7
2
R
0
2 -5 1 -1
0 1
10
Now proceed as normal to get the next tableau
− = MIN {7/1, 10/2}=5.
Basic
0
X
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
X
1
-8 6 -1
0 -7M/2 -M/2 -M/2
1
0 +3M2
10-2M
1
R
0
0 7/2 1/2 1/2
1 -1/2
2
1
X
0
1 -5/2 1/2 -1/2
0 1/2
5
In the next iteration
2
X enters and
1
R leaves, yielding:
Basic
0
X
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
X
1
0 0 50/7 1/7
16/7 -1/7
+M +M
102/7
2
X
0
0 1 1/7 1/7
2/7 -1/7
4/7
1
X
0
1 0 6/7 -1/7
5/7 1/7
45/7
which is optimal since all
0
0
~
X
.
The Big-M method suffers from two important shortcomings.
1. You must go all the way to the final tableau before discovering that the
problem has no feasible solutions (artificial variables at positive level in final
tableau).
2. The use of the constant M is cumbersome and if a very large number is
substituted for M it can cause numerical round-off problems on the digital
computer.
Two Phase Method
Another artificial variable technique called the Two Phase Method removes
these difficulties. The title of the method comes from the fact that computations proceed
in two distinct phases. The first phase merely attempts to drive the artificials out of the
basic solution using the simplex method and thereby form a feasible starting solution
without artificials for the second phase. The second phase merely moves from this new
feasible starting solution to optimality using the simplex method. The two phase method
is summarized as follows:
Phase I – Formulate the problem as you did for the Big-M method, i.e., adding
artificials to Type II and equality constraints, however you replace the actual
objective function with:
Minimize:
=
=
K
i
iR
R
1
0
Where the
i
R are the K artificial variables. Now you solve this “artificial
problem” by the simplex algorithm. If the optimal objective function is greater
than zero when the simplex method terminates, stop! This indicates the problem
has no feasible solution. However, if the objective function is zero when the
simplex method terminates, then all the artificials have all been driven to zero (a
true feasible solution) and you proceed to Phase II.
Phase II – You now restore the original objective function into the
0
X row of
the tableau and drop all non-basic artificial variables (and their columns) from the
tableau. Then you obtain zeros for all basic variables in the
0
X row using row
operaitons. Finally, you again apply the simplex method to move to the optimal
solution which must exist.
To illustrate, the prior example is resolved using the two phase method. Recall the
problem was:
Max:
3
2
1
0
5
3
2
X
X
X
X
−
+
=
St:
7
3
2
1
=
+
+
X
X
X
10
5
2
3
2
1
+
−
X
X
X
Phase I: The phase one problem is
Min:
2
1
0
R
R
R
+
=
St:
7
1
3
2
1
=
+
+
+
R
X
X
X
10
5
2
2
3
2
1
=
−
+
−
R
X
X
X
Putting in the tableau form:
Basic
0
R
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
R
1
0 0 0 0
-1 -1
0
1
R
0
1 1 1 0
1 0
7
2
R
0
2 -5 1 -1
0 1
10
Since
1
R and
2
R are the initial basic variables you must first get 0’s in the
0
X row for
them before beginning the simplex method. You do this by row operations just like we
did in the Big-M method (add row 1 and 2 to row 0).
Adding the first and second rows to the
0
R row gives us:
Basic
0
R
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
R
1
3 -4 2 -1
0 0
17
1
R
0
1 1 1 0
1 0
7
2
R
0
2 -5 1 -1
0 1
10
Now use the simplex method to minimize
0
R so select largest positive coefficient which
is
1
X ’s and
−
=
MIN
5
2
/
10
,1
/
7
=
(
2
R leaves).
Performing row operations the next tableau is:
Basic
0
R
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
R
1
0 7/2 1/2 1/2
0 -3/2
2
1
R
0
0 7/2 1/2 1/2
1 -1/2
2
1
X
0
2 -5/2 1/2 -1/2
0 1/2
5
Next select
2
X as the entering variable since it has the largest
0
X row coefficient,
−
=
MIN
),
2
/
7
/(
2
4/7 and
1
R leaves. Performing the row operations yields the next
tableau.
Basic
0
R
1
X
2
X
3
X
1
S
1
R
2
R
Solution
0
R
1
0 0 0 0
-1 -1
0
2
X
0
0 1 1/7 1/7
2/7 -1/7
4/7
1
X
0
1 0 6/7 -1/7
5/2 1/7
45/7
Inspecting the
0
R row, note that this solution is optimal. Since the value of the objective
function is zero, you know this problem has a feasible solution so proceed to Phase II.
Phase II: First you rewrite the tableau with the true original objective function, note that
you drop
1
R and
2
R and their columns.
Basic
0
X
1
X
2
X
3
X
1
S
Solution
0
X
1
-2 -3 5 0
0
2
X
0
0 1 1/7 1/7
4/7
1
X
0
1 0 6/7 -1/7
45/7
Again, this tableau is not in correct form since you do not have zeros for the basic
variables in the
0
X row. So you must apply row operations (multiply first row by 3 and
second by 2 and add to the
0
X row).
Basic
0
X
1
X
2
X
3
X
1
S
Solution
0
X
1
0 0 5 0/7 1/7
102/7
2
X
0
0 1 1/7 1/7
4/7
1
X
0
1 0 6/7 -1/7
45/7
When you examine the
0
X row you find this is optimal (if it were not you would
continue with the simplex method).
Question
What if there were Type I equalities, since they don’t have artificial variables,
could they be left out of Phase I? e.g., say the constant
6
2
1
+ X
X
was also included in
the model.
Answer
All constraints must be included in Phase I, otherwise the solution obtained in
Phase I may not be feasible. Note that would be the case here, since the solution has
7
2
1
=
+ X
X
! So whether they have artificial variables or not ALL constraints are
included in Phase I.