simplex - Lecture notes ?: The simplex algorithm Vincent...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Lecture notes ?: The simplex algorithm Vincent Conitzer 1 Introduction We will now discuss the best-known 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 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 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 violatedthat 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 right-hand 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- . 25 w 1- . 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- . 25 w 1- . 5 x 2 ) + 2 x 2 = 12- . 75 w 1 + 0 . 5 x 2 . We rewrite the second constraint as w 2 = 8- x 1- 2 x 2 = 8- (4- . 25 w 1- . 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- . 25 w 1- . 5 x 2 )- x 2 = 1 + 0 . 25 w 1- . 5 x 2 . This results in the following linear program, which is equivalent to our original linear program: 1 maximize 12- . 75 w 1 + 0 . 5 x 2 subject to x 1 = 4- . 25 w 1- . 5 x 2 w 2 = 4 + 0 . 25 w 1- 1 . 5 x 2 w 3 = 1 + 0 . 25 w 1- . 5 x 2 w 1 , w 2 , w 3 , x 1 , x 2 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 left-hand side variables are called the...
View Full Document

This note was uploaded on 05/28/2011 for the course CO 350 taught by Professor S.furino,b.guenin during the Winter '07 term at Waterloo.

Page1 / 10

simplex - Lecture notes ?: The simplex algorithm Vincent...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online