Lecture notes ?: The simplex algorithm
Vincent Conitzer
1
Introduction
We will now discuss the bestknown algorithm (really, a family of algorithms) for solving a linear
program, the
simplex algorithm
. We will demonstrate it on an example. Consider again the linear
program for our (unmodified) painting example:
maximize
3
x
1
+ 2
x
2
subject to
4
x
1
+ 2
x
2
≤
16
x
1
+ 2
x
2
≤
8
x
1
+
x
2
≤
5
x
1
≥
0;
x
2
≥
0
To run the simplex algorithm, we introduce a slack variable
w
i
for each constraint
i
, so that we
can rewrite the linear program in equality form, as follows:
maximize
3
x
1
+ 2
x
2
subject to
w
1
= 16

4
x
1

2
x
2
w
2
= 8

x
1

2
x
2
w
3
= 5

x
1

x
2
w
1
, w
2
, w
3
, x
1
, x
2
≥
0
If we set
x
1
=
x
2
= 0, we get a feasible solution to this linear program. (Of course, this is not
the case for every linear program, and we will see what to do if this is not the case later on.) Our
goal is to improve this solution. If we increase either
x
1
or
x
2
, then the objective value will increase.
Let us start by increasing
x
1
. At some point, one of the constraints will be violated—that is, one of
the slack variables will become negative. Specifically, if we increase
x
1
to 4, then the first constraint
4
x
1
+ 2
x
2
≤
16 will be just barely satisfied, that is,
w
1
will be 0, so we cannot increase
x
1
further.
(The other constraints are still satisfied at this point.) The objective value at this current solution
of
x
1
= 4
, x
2
= 0 is 12, a good start but we are not yet at optimality.
The key trick of the simplex algorithm is that at this point, we rewrite the linear program, chang
ing the roles of some of the original and slack variables. After we do so, the current solution will
once again correspond to the origin. Specifically, we remove
x
1
, whose value is no longer 0, from the
objective and the righthand sides of the equalities; we replace it with an expression involving
w
1
,
whose value is now 0. Specifically, from the first constraint, we know that
w
1
= 16

4
x
1

2
x
2
, or
equivalently,
x
1
= 4

0
.
25
w
1

0
.
5
x
2
. We replace the first constraint with this new equality. We also
rewrite the objective as 3
x
1
+ 2
x
2
= 3(4

0
.
25
w
1

0
.
5
x
2
) + 2
x
2
= 12

0
.
75
w
1
+ 0
.
5
x
2
. We rewrite
the second constraint as
w
2
= 8

x
1

2
x
2
= 8

(4

0
.
25
w
1

0
.
5
x
2
)

2
x
2
= 4 + 0
.
25
w
1

1
.
5
x
2
,
and the third constraint as
w
3
= 5

x
1

x
2
= 5

(4

0
.
25
w
1

0
.
5
x
2
)

x
2
= 1 + 0
.
25
w
1

0
.
5
x
2
.
This results in the following linear program, which is equivalent to our original linear program:
1
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
maximize
12

0
.
75
w
1
+ 0
.
5
x
2
subject to
x
1
= 4

0
.
25
w
1

0
.
5
x
2
w
2
= 4 + 0
.
25
w
1

1
.
5
x
2
w
3
= 1 + 0
.
25
w
1

0
.
5
x
2
w
1
, w
2
, w
3
, x
1
, x
2
≥
0
Our current solution consists of setting
w
1
= 0
, x
2
= 0. Because both of these are 0, the other
values are easy to read off: the current objective value is 12,
x
1
is 4,
w
2
is 4, and
w
3
is 1. We call
a linear program written in this way a
dictionary
; the lefthand side variables are called the
basic
variables, and the righthand side variables (which are set to 0 in the current solution) the
nonbasic
variables. When we moved from the first dictionary to the second dictionary, we performed a
pivot
;
in this pivot
x
1
was the
This is the end of the preview.
Sign up
to
access the rest of the document.
 Winter '07
 S.Furino,B.Guenin
 Linear Programming, Optimization, Simplex algorithm, linear program

Click to edit the document details