Sei sulla pagina 1di 119

IE 400 - Principles of Engineering Management

Thanks to Niyazi Onur Bakır for the Slides

Fall 2010

IE 400 - Principles of Engineering Management Thanks to Niyazi Onur Bakır for the Slides Fall

Assumptions in LP problems

Three major assumptions are:

1 Proportionality and additivity The contribution of each decision variable to the objective function or to each constraint is proportional to the value of that variable. The

contribution from decision variables are independent from one another and the total contribution is the sum of the individual contributions.

2 Divisibility Each decision variable is allowed to take fractional values.

3 Certainty All input parameters (coefficients of the objective function and of the constraints) are known with certainty.

Other mathematical programming models may constructed relaxing one or more of the assumptions above at the expense of loosing tractability.

programming models may constructed relaxing one or more of the assumptions above at the expense of

Modeling Examples

Transportation Problem There are two power plants generating electricity and three factories that need electricity in their production.

1500
MWa+s
 1000
MWa+s
 F1
 PP1
 750
MWa+s
 F2
 2000
MWa+s
 PP2
 750
MWa+s
 F3

1500
MWa+s

1000
MWa+s

F1

PP1

750
MWa+s

F2

2000
MWa+s

PP2

750
MWa+s

F3


Capacity


Demand


F1
 PP1
 750
MWa+s
 F2
 2000
MWa+s
 PP2
 750
MWa+s
 F3
 Capacity
 Demand


Modeling Examples

Transmission costs per MWatt

 

F1

F2

F3

PP1

50

100

60

PP2

30

20

35

How should we satisfy the demand of each factory from the two power plants with minimum total cost?

The unknown values are the amount of electricity supplied from each power plant to each factory.

Let x ij denote the (unknown) # of MWatts of electricity

transmitted from PP i

to F j , i = 1, 2; j = 1, 2, 3.

denote the (unknown) # of MWatts of electricity transmitted from PP i to F j ,

Modeling Examples

Then the problem can be formulated as:

min 50x 11 + 100x 12 + 60x 13 + 30x 21 + 20x 22 + 35x 23 s.t. Demand constraints x 11 + x 21 = 1500 x 12 + x 22 = 750 x 13 + x 23 = 750 Capacity constraints x 11 + x 12 + x 13 1000 x 21 + x 22 + x 23 2000

and

x ij 0, i = 1, 2; j = 1, 2, 3.

3 ≤ 1000 x 2 1 + x 2 2 + x 2 3 ≤ 2000

Modeling Examples

Short-term Investment Planning You have 10, 000 TL at the beginning of 2008 and would like to invest your money. Your goal is to maximize your total amount of money at the beginning of 2011. You have the following options:

Option

Duration (yrs)

Total interest rate

Available at the beginning of

1 2

26%

2008, 2009

2 1

12%

2008, 2009, 2010

3 3

38%

2008

4 2

27%

2009

of 1 2 26% 2008 , 2009 2 1 12% 2008 , 2009 , 2010 3

Modeling Examples

2008
 2009
 2010

2008

2009

2010


2011


Let x t denote the total amount of money available for reinvestment at the beginning of year t, t = 0, 1, 2, 3.

Let y it denote the amount of money invested in option i at the beginning of year t, i = 1, 2, 3, 4, t = 0, 1, 2, 3.

the amount of money invested in option i at the beginning of year t , i

Modeling Examples

With this information, the problem can be formulated as:

max x 3 s.t.

x 0 = 10, 000,

x 0 = y 10 + y 20 + y 30 ,

x 1 = 1.12y 20 ,

x 1 = y 11 + y 21 + y 41 ,

x 2 = 1.26y 10 + 1.12y 21 ,

x 2 = y 22 , x 3 = 1.38y 30 + 1.26y 21 + 1.27y 41 + 1.12y 22

x 0 , x 1 , x 2 , x 3 0

y 10 , y 20 , y 30 , y 11 , y 21 , y 41 , y 22 0

, x 3 ≥ 0 y 1 0 , y 2 0 , y 3 0

Modeling Examples

Blending Problem XYZ oil company produces three types of gasoline by blending three types of crude oil:

Gas

Sales price per barrel

Crude oil

Purchase price per barrel

1 70

1 45

2 60

2 35

3 50

3 25

The company can purchase up to 5000 barrels of each type of crude oil daily. The production requirements are,

Gas

Octane rating

Sulfur content

1 at least 10

at most 1%

2 at least 8

at most 2%

3 at least 6

at most 1%

Gas Octane rating Sulfur content 1 at least 10 at most 1% 2 at least 8

Modeling Examples

Crude oil specifications:

Crude oil

Octane rating

Sulfur content

1 12

0.5%

2 6

2.0%

3 8

3.0%

It costs $4 to transform one barrel of crude oil into one barrel of gasoline.

The company can process up to 14, 000 barrels of crude oil daily.

The company has to meet the daily demand as well:

Gas

Demand (barrels)

1 4000

2 5000

3 3000

barrels of crude oil daily. The company has to meet the daily demand as well: Gas

Modeling Examples

How can the company maximize total profit while satisfying demand and production requirements?

The decision variables are x ij : # of barrels of crude oil i used daily to produce gas j, i = 1, 2, 3, j = 1, 2, 3.

The objective function is more complicated than in previous examples. The objective function has 3 pieces. First, sales,

Sales = 70(x 11 + x 21 + x 31 ) + 60(x 12 + x 22 + x 32 ) +50(x 13 + x 23 + x 33 )

Purchase cost = 45(x 11 + x 12 + x 13 ) + 35(x 21 + x 22 + x 23 ) +25(x 31 + x 32 + x 33 )

+ x 1 2 + x 1 3 ) + 35( x 2 1 + x

Modeling Examples

Process cost = 4(x 11 +x 12 +x 13 +x 21 +x 22 +x 23 +x 31 +x 32 +x 33 )

Hence the objective is:

max 70(x 11 + x 21 + x 31 ) + 60(x 12 + x 22 + x 32 ) +50(x 13 + x 23 + x 33 ) 45(x 11 + x 12 + x 13 ) 35(x 21 + x 22 + x 23 ) 25(x 31 + x 32 + x 33 ) 4(x 11 + x 12 + x 13 + x 21 + x 22 + x 23 + x 31 + x 32 + x 33 )

s.t.

Demand constraints

x 11 + x 21 + x 31 = 4000, x 12 + x 22 + x 32 = 5000, x 13 + x 23 + x 33 = 3000,

1 + x 3 1 = 4000, x 1 2 + x 2 2 + x

Modeling Examples

Purchase constraints

x 11 + x 12 + x 13 5000, x 21 + x 22 + x 23 5000, x 31 + x 32 + x 33 5000,

Capacity constraint

x 11 + x 12 + x 13 + x 21 + x 22 + x 23 + x 31 + x 32 + x 33 14, 000

Octane requirements

Gas 1 12x 11 +6x 21 +8x 31

x 11 +x 21 +x 31

10

=

12x 11 + 6x 21 + 8x 31 10(x 11 + x 21 + x 31 ) 0

2x 11 4x 21 2x 31 0

3 1 − 10( x 1 1 + x 2 1 + x 3 1 )

Modeling Examples

Octane requirements (continued) Gas 2 12x 12 + 6x 22 + 8x 32 8(x 12 + x 22 + x 31 ) =4x 12 Gas 3 12x 13 + 6x 23 + 8x 33 6(x 13 + x 23 + x 33 )

2x 22 0

=6x 13 + 2x 33 0

Sulfur requirements Gas 1 0.005x 11 + 0.02x 21 + 0.03x 31 0.01(x 11 + x 21 + x 31 ) =⇒ −0.005x 11 + 0.01x 21 + 0.02x 31 0,

01( x 1 1 + x 2 1 + x 3 1 ) = ⇒ −

Modeling Examples

Sulfur requirements (continued) Gas 2 0.005x 12 + 0.02x 22 + 0.03x 32 0.02(x 12 + x 22 + x 32 ) =⇒ −0.015x 12 + 0.01x 32 0, Gas 3 0.005x 13 + 0.02x 23 + 0.03x 33 0.01(x 13 + x 23 + x 33 ) =⇒ −0.005x 13 + 0.01x 23 + 0.02x 33 0

. 01( x 1 3 + x 2 3 + x 3 3 ) = ⇒

Modeling Examples

Ex 5: Suppose that milk chocolate is produced with three ingredients. One kg. of milk chocolate contains 0.5 kg. of milk, 0.4 kg of cocoa, and 0.1 kg of sweetener. Each of these three ingredients needs to be processed before they can be used in the production of milk chocolate. The facility has two departments that can process these ingredients. The following table summarizes the processing requirements.

Dept. 1 (hrs./kg.)

Dept. 2 (hrs./kg.)

Milk

0.4

0.6

Cocoa

0.3

0.2

Sweetener

0.5

0.6

The available # of hours per week is 150 for each department. Formulate an LP problem that maximizes the total # of kg.’s of milk chocolate produced in a week.

for each department. Formulate an LP problem that maximizes the total # of kg.’s of milk

Modeling Examples

Let x ij denote the # of kg.’s of ingredient i processed in department j, i = 1 (milk), 2 (cocoa), 3 (sweetener), j = 1, 2.

Furthermore, let y : # of kg.’s of milk chocolate produced in a week. y satisfies:

y = min { x 11 +x 12

0.5

,

x 21 +x 22

0.4

,

x 31 +x 32

0.1

}

What is the problem here?

y = min { x 1 1 + x 1 2 0 . 5 , x

Modeling Examples

We need to maximize y , but we cannot use the equality provided in the previous slide.The equation is nonlinear! .

We could apply the common modeling trick below:

max y

s.t.

y

y

y

x 11 +x 12

0.5

x 21 +x 22

0.4

x 31 +x 32

0.1

What other constraints do we have?

y y ≤ x 11 + x 12 0 . 5 ≤ x 21 + x

Modeling Examples

We also have the following constraints:

Dept. 1

0.4x 11 + 0.3x 21 + 0.5x 31 150

Dept. 2

0.6x 12 + 0.2x 22 + 0.6x 32 150

x ij 0

i = 1, 2, 3

j = 1, 2

With this example completed, we are now in a position to start thinking about solution methodologies. The simplex method is the most popular and oldest approach to solve linear programs. However, before we start discussing the simplex method, we take a look at simpler linear programs that include only two variables and can be solved graphically.

simplex method, we take a look at simpler linear programs that include only two variables and

Graphical Solution of 2-variable LP Problems

Consider the following LP:

max 3x 1 + 2x 2 s.t.

2x 1 + x 2 100

x 1 + x 2 80

x 1 40 x 1 0 x 2 0

How do we solve this?

1 + x 2 ≤ 100 x 1 + x 2 ≤ 80 x 1 ≤

Graphical Solution of 2-variable LP Problems

The solution can be obtained very easily drawing the plot below:

Figure:

Graphical solution

of 2-variable LP Problems The solution can be obtained very easily drawing the plot below: Figure:

Graphical Solution of 2-variable LP Problems

Consider

the

following

linear

program,

min 50x 1 + 100x 2

s.t.

7x 1 + 2x 2 28

2x 1 + 12x 2 24

x 1 , x 2 0

min 50 x 1 + 100 x 2 s.t. 7 x 1 + 2 x 2
min 50 x 1 + 100 x 2 s.t. 7 x 1 + 2 x 2

Graphical Solution of 2-variable LP Problems

Now consider yet another problem,

max x 1 + 3x 2

s.t.

x 1 + x 2 7

x 1 + 2x 2 8

x 1 4

x 1 0

x 2 0

The graphical solution to this problem is provided in the classroom, but here is some discussion on how you could obtain the solution.

solution to this problem is provided in the classroom, but here is some discussion on how

Graphical Solution of 2-variable LP Problems

First, consider the coefficients of x 1 and x 2 in the objective function: 1 and 3, respectively. Now let:

c =

1

3

Note that as we move the isoprofit line in the direction of c , the total profit increases.

For a maximization problem, the vector given by the coefficients of

x 1 and x 2 in the objective function is called the improving direction.

To solve an LP problem in two variables, we should try to push isoprofit lines in the improving direction as much as possible while still staying in the feasible region.

try to push isoprofit lines in the improving direction as much as possible while still staying

Graphical Solution of 2-variable LP Problems

In this example, the best feasible point we can achieve in this direction is x (refer to the class notes). Note that x is given by the intersection of the lines:

x 1 + x 2 = 7

1/2x 1 + x 2 = 4

Solving this mini-system of linear equalities, we obtain:

x =

2

5

as the optimal solution! Then, the maximum achievable profit is given by:

1

x

2

+ 3x

= 2 + 3 · (5) = 17 TL

General Concepts in LP

Some properties and attributes of the feasible region are also important in the later stages of this course where we start discussing how to solve LPs involving more than 2 decision variables.

A set of points S is a convex set if the line segment joining any pair of points in S is wholly contained in S.

For any convex set S, a point P in S is an extreme point if each

line segment that lies completely in S and contains the point P has P as an endpoint of the line segment. Extreme points are sometimes called corner points, because if the set S is a polygon,

the extreme points of S will be the vertices, or corners of the polygon.

points, because if the set S is a polygon, the extreme points of S will be

Graphical Solution of 2-variable LP Problems

A company wishes to increase demand for its product through

advertising. Each minute of radio ad costs 1 units and each minute

of TV ad costs 2 units. Each minute of radio ad increases the daily

demand by 2 units and each minute of TV ad by 7 units. The company would wish to place at least 9 minutes of daily ad in total. It wishes to increase daily demand by at least 28 units. How can the company meet its advertising requirements at minimum total cost?

What are the decision variables?

28 units. How can the company meet its advertising requirements at minimum total cost? What are

Graphical Solution of 2-variable LP Problems

x 1 : # of minutes of radio ads purchased. x 2 : # of minutes of TV ads purchased.

The problem can be formulated as follows:

min x 1 + 2x 2 s.t.

2x 1 + 7x 2 28 x 1 + x 2 9 x 1 0, x 2 0

The geometric solution is provided in the classroom.

≥ 28 x 1 + x 2 ≥ 9 x 1 ≥ 0, x 2 ≥

Graphical Solution of 2-variable LP problems

Note that the vector given by the coefficients of decision variables in the objective function is

c =


1

2

Note that the total cost increases in this direction. Since we have a minimization problem, this is, hence, not the direction that we want to move. We should move in the opposite direction, i.e. in

the direction of c =

1

2

In other words, for a minimization problem, we go in the opposite direction of c (i.e. in the direction of c as much as possible while still remaining in the feasible region.

direction of c (i.e. in the direction of − c as much as possible while still

Graphical Solution of 2-variable LP problems

The optimal solution is given by the intersection of the following two lines:

2x 1 + 7x 2 = 28

x 1 + x 2 = 9

Solving for the system of two equations, we obtain x

x

= 7 and

1

2

= 2. Hence, the optimal solution is

x =

7

2

The optimal value is 7 + 2(2) = 11. Therefore, the total minimum cost is 11 units. Also, note that both constraints are binding at the optimum.

+ 2(2) = 11 . Therefore, the total minimum cost is 11 units. Also, note that

Graphical Solution of 2-variable LP Problems

Alternate or multiple optimal solutions Suppose in the previous example that it costs 4 units to place a minute of radio ad and 14 units to place a minute of TV ad. Then the formulation could be modified as:

min 4x 1 + 14x 2 s.t.

2x 1 + 7x 2 28 x 1 + x 2 9 x 1 0, x 2 0

Again, the graphical solution is provided in the classroom. After plotting the objective function as well as the constraints, one could readily see that any feasible point on the line segment between points A = (x 1 , x 2 ) = (7, 2) and B = (x 1 , x 2 ) = (14, 0) is an optimal solution with the same optimal value.

, x 2 ) = (7 , 2) and B = ( x 1 , x

Graphical Solution of 2-variable LP Problems

At point A, 4(7) + 14(2) = 56

At point B , 4(14) + 14(0) = 56

The optimal value is 56. This is also true for any feasible point between A & B . In this case, we say that LP has multiple or alternate optimal solutions.

Mathematically speaking, we could represent the set of optimum points as the convex combination of A & B , or the line segment [A, B]

{λ 7

2

+ (1 λ)

14

0

: λ [0, 1]}

combination of A & B , or the line segment [ A , B ] {

Graphical Solution of 2-variable LP problems

Alternative or Multiple Optimal Solutions An auto company manufactures cars and trucks. Each vehicle must be processed in the paint shop and body assembly shop. If the paint shop were only painting trucks, 40 per day could be painted. If the paint shop were only painting cars, 60 per day could be painted. If the body shop were only producing cars, it could process 50 per day. If the body shop were only producing trucks, it could process 50 per day. Each truck contributes $300 to profit, and each car contributes $200 to profit. Use linear programming to determine daily production schedule that will maximize the company’s profits.

Decision variables?

linear programming to determine daily production schedule that will maximize the company’s profits. Decision variables?

Graphical Solution of 2-variable LP problems

The company must decide how many cars and trucks should be produced daily.

x 1 : # of trucks produced daily. x 2 : # of cars produced daily.

The company maximizes profits. In hundreds of dollars, the objective function can be written as 3x 1 + 2x 2 .

There are two constraints based on the capacity of the paint and body shops. For both departments, the fraction of day allocated to truck and car production must not exceed 1. Hence the constraints are:

1

40

1

50

x 1 + x 1 +

1

60

1

50

x 2 1 x 2 1

not exceed 1. Hence the constraints are: 1 40 1 50 x 1 + x 1

Graphical Solution of 2-variable LP problems

Clearly, the LP problem is:

max 3x 1 + 2x 2

s.t.

1

40

1

50

x 1 + x 1 +

1

60

1

50

x 2 1 x 2 1

x 1 0, x 2 0

The plot of the objective function and the feasible region should reveal the fact that the objective function has the same slope with one of the constraints, and it intersects an entire line segment corresponding to the binding constraint.

same slope with one of the constraints, and it intersects an entire line segment corresponding to

Graphical Solution of 2-variable LP Problems

Unboundedness Consider the following LP problem,

max x 1 + 3x 2 s.t.

x 1 + 2x 2 8

x 1 0, x 2 0

After plotting the feasible region, one can observe that the objective function can be increased by the moving in the improving direction c as much as we want while still staying in the feasible region. In this case, we say that the LP is unbounded.

For unbounded LP max problems, there is no optimal solution and the optimal value is defined to be +. For a min problem, we say that the LP is unbounded if we can decrease the objective function as much as we want while staying in the feasible region. In this case, the optimal value is −∞.

objective function as much as we want while staying in the feasible region. In this case,

Graphical Solution of 2-variable LP problems

Unboundedness Another example of an unbounded feasible region is as follows:

max 2x 1 x 2 s.t.

x 1 x 2

1

2x 1 + x 2

6

x 1 0, x 2 0

Again, after shifting the plot of the objective function in the feasible region, one can observe that the objective function can be shifted to assume arbitrarily large values.

in the feasible region, one can observe that the objective function can be shifted to assume

Graphical Solution of 2-variable LP Problems

Infeasible LP problems Consider the following LP

max x 1 + 3x 2 s.t.

x 1 + x 2 6

x 1 + 2x 2 8 x 2 6

x 1 0, x 2 0

After plotting the constraints, one can readily observe that a feasible region does not exist. We say that the LP problem is infeasible.

the constraints, one can readily observe that a feasible region does not exist. We say that

Graphical Solution of 2-variable LP Problems

Infeasible LP problems Suppose in the previous auto manufacturing example that auto dealers require that the auto company produce at least 30 trucks and 20 cars. The the problem becomes,

max 3x 1 + 2x 2 s.t.

1

40

1

50

x 1 + x 1 +

1

60

1

50

x 2 1 x 2 1

x 1 30

x 2 20

x 1 0, x 2 0

x 1 + 1 6 0 1 5 0 x 2 ≤ 1 x 2 ≤

Graphical Solution of 2-variable LP variables

The plot should immediately warn us of an infeasible problem. We could also recognize that there is an infeasible solution by immediately checking the paint shop constraint at the point x 1 = 30 and x 2 = 20.

LP is infeasible because producing 30 trucks and 20 cars requires more paint shop time than is available.

x 2 = 20. LP is infeasible because producing 30 trucks and 20 cars requires more

General Characterization of LP Problems

Every LP problem falls into one of the four cases:

Case 1 The LP problem has a unique optimal solution.

Case 2 The LP problem has alternative or multiple optimal solutions. In this case, there are infinitely many optimal solutions.

Case 3 The LP problem is unbounded. There is no optimal solution in this case.

Case 4 The LP problem is infeasible. There is no feasible solution.

unbounded. There is no optimal solution in this case. Case 4 The LP problem is infeasible.

Summary So Far

So far, we have seen the solution of LP problems with only two decision variables.

Such problems can easily be solved graphically.

However, many LP problems include more than two variables. How can we solve them?

We will learn how to solve more complex linear programs using the simplex method. Simplex method is a solution algorithm that searches for the optimal solution checking the extreme points of the feasible region iteratively.

solution algorithm that searches for the optimal solution checking the extreme points of the feasible region

The Simplex Method

Last time, we began to solve linear programs using the graphical method. During our discussion, we observed that the optimal solution, if it exists, is either an extreme point or a linear combination of two extreme points. This characteristic of LP problems provide some analytical convenience in solving more complex LP problems involving more than 2 decision variables.

Simplex method is the first method, invented in late 1940s to exploit this characteristic of LP problems. Simplex method can be used to solve very large LPs, involving thousands of constraints and variables.

So far, we have seen simple LP problems with both equality and inequality constraints. The decision variables were allowed to take nonnegative values. However, in general, LP problems can also have variables that are required to be nonpositive or those allowed to be unrestricted in sign.

LP problems can also have variables that are required to be nonpositive or those allowed to

The Simplex Method

To use the simplex method, we need to convert the problem first into the standard form. To convert an LP problem into the standard form, each inequality constraint must be replaced by an equality constraint.

We will illustrate the simplex method step by step, using the example below,

max 5x 1 + 4x 2 + 3x 3

s.t.

2x 1 + 3x 2 + x 3

5

4x 1 + x 2 + 2x 3

11

3x 1 + 4x 2 + 2x 3

8

x 1 , x 2 , x 3 0

1 + x 2 + 2 x 3 ≤ 11 3 x 1 + 4 x

The Simplex Method

To convert this problem into its standard form, we need to define ”slack” variables. For each inequality constraint, we define a slack variable, as follows:

s 1 =

5 2x 1 3x 2 x 3

s 2 =

11 4x 1 x 2 2x 3

s 3 = 8 3x 1 4x 2 2x 3

Clearly, each slack variable corresponds to the difference between the right hand side (RHS) and the left hand side (LHS) of each of the first three constraints. This implies s 1 , s 2 , s 3 0 for every feasible solution of the LP problem. In summary, if constraint i of an LP is a ”” constraint, we convert it to an equality constraint by adding a slack variable s i to the i th constraint and adding the sign restriction s i 0.

by adding a slack variable s i to the i t h constraint and adding the

The Simplex Method

Similarly, let us denote the objective function by:

z = 5x 1 + 4x 2 + 3x 3 .

After the necessary conversions, we obtain what we call Dictionary

1:

Row 0

z

=

5x 1

+

4x 2

+

3x 3

Row 1

s 1

=

5

2x 1

3x 2

x 3

Row 2

s 2

=

11

4x 1

x 2

2x 3

Row 3

s 3

=

8

3x 1

4x 2

2x 3

To begin with, we need an initial feasible solution. How could you obtain one?

3 x 1 − 4 x 2 − 2 x 3 To begin with, we need

The Simplex Method

A simple initial feasible solution can be obtained by setting the original decision variables equal to 0. Hence, the first feasible solution is:

x 1 = 0, x 2 = 0, x 3 = 0, s 1 = 5, s 2 = 11, s 3 = 8.

The current value of the objective function is z = 0. Our goal is to look for another feasible solution that yields a larger objective function value (since this is a max. problem). To do so, we consider increasing x 1 , x 2 and x 3 from their current values. This also increases the current z value.

By looking at row 0 above, we the see that increasing x 1 by 1 increases z by 5. Similarly, increasing x 2 by 1 and x 3 by 1 increase z by 4 and 3 respectively.

1 by 1 increases z by 5. Similarly, increasing x 2 by 1 and x 3

The Simplex Method

Ratio Test It makes sense to increase the value of x 1 because it offers the highest amount of increase in z per unit of perturbation. As we increase x 1 , we keep x 2 and x 3 at their initial values of 0. In doing so, we need to pay attention to the constraints as well. We cannot perturb x 1 in violation of the constraints. So the question is: How much can we increase x 1 ?

The new solution will still be feasible as long as each of the original and slack variables is still non-negative. Now, going back to the first dictionary,

s 1 =

5 2x 1 3x 2 x 3 = 5 2x 1 0

=

x 1 5/2

s 2 =

11 4x 1 x 2 2x 3 =

11 4x 1 0

=x 1 11/4

s 3 = 8 3x 1 4x 2 2x 3 = 8 3x 1 0 =x 1 8/3.

11 / 4 s 3 = 8 − 3 x 1 − 4 x 2 −

The Simplex Method

Of the three bounds, the first one is the most restrictive. Therefore, we can increase the value of x 1 up to 5/2 while keeping x 2 and x 3 at 0 to ensure feasibility. Now, we obtain a new feasible solution at x 1 = 5/2. The second feasible solution is:

x 1 = 5/2, x 2 = 0, x 3 = 0, s 1 = 0, s 2 = 1, s 3 = 1/2.

And the current value of the objective function is:

z = 5 · ( 5 ) + 4 · (0) + 3 · (0) = 25

2

2

.

Note that the second feasible solution has indeed a larger objective function value than the first feasible solution.

However, our search for the optimal solution is probably not over!

function value than the first feasible solution. However, our search for the optimal solution is probably

The Simplex Method

Now, we shall look for an even better solution than the second feasible solution. Note that, in Dictionary 1, each of the variables x 1 , x 2 and x 3 was on the RHS and had a value of 0. As such, the same was true for the objective function.

This enabled us to quickly identify which variables should be increased from their current value of zero to obtain the largest increase in the objective function value.

To do the same, we shall rearrange dictionary 1, so that only the variables which are 0 in the second feasible solution will be on the RHS. In feasible solution #2, x 2 = 0, x 3 = 0 and s 1 = 0.

in the second feasible solution will be on the RHS. In feasible solution #2, x 2

The Simplex Method

In row 1 of dictionary 1, s 1 should move from the LHS to the RHS and x 1 should move from the RHS to the LHS. Mathematically speaking,

s 1 = 5 2x 1 3x 2 x 3

becomes

x 1 = 5/2 3/2x 2 1/2x 3 1/2s 1

(1)

The same should be repeated for other rows as well. Note that, s 2 and s 3 are still in the LHS and they should remain so. But x 1 should no longer be on the RHS of rows 2 and 3. To this end, we could substitute (??) in rows 2 and 3 of dictionary #1. In the end, only x 2 , x 3 and s 1 will appear on the LHS of rows 2 and 3.

rows 2 and 3 of dictionary #1. In the end, only x 2 , x 3

The Simplex Method

Substituting,

s 2 =

11 4x 1 x 2 2x 3

= 11 4( 5 2 3 2 x 2

= 1 + 5x 2 + 2s 1

1

1

2 x 3

2 s 1 ) x 2 2x 3

and

s 3 =

8 3x 1 4x 2 2x 3

1 1 = 8 − 3( 5 2 x 2 − 2 x 3 −
1
1
=
8 − 3( 5
2 x 2 −
2 x 3 −
2 s 1 ) − 4x 2 − 2x 3
2 − 3
1
1
1
=
2 x 2 −
2 x 3 + 3
2 +
2 s 1
We do the same for row 0 as well.

The Simplex Method

As a result,

z = 5x 1 + 4x 2 + 3x 3

= 5( 5 2 3 x 2 1

= 25

1

2 x 3 2 s 1 ) + 4x 2 + 3x 3

2 x 3 5

2 s 1 .

2

7 x 2 + 1

2

2

We are now ready to form the new dictionary (Dictionary #2):

Row 0

 

25

7

+

1 2 x 3

 

5

z

=

2

2

x 2

2

s

1

Row 1

5 2

 

3 x 2

 

1 2 x 3

 

1

 

x 1

=

s

 

2

 

2

1

Row 2

s 2

=

1

+

5x 2

+

2s 1

 

1 2

1

1 2 x 3

3

Row 3

s 3

=

+

2 x 2

+

2

s

1

1   1 2 1 1 2 x 3 3 Row 3 s 3 = +
1   1 2 1 1 2 x 3 3 Row 3 s 3 = +

The Simplex Method

Recall feasible solution #2:

x 1 = 5/2, x 2 = 0, x 3 = 0, s 1 = 0, s 2 = 1, s 3 = 1/2, z = 25

2

.

Observe that in dictionary #2, only variables with zero values are on the RHS of each of the four rows.

By looking at row 0, we see that only increasing x 3 from 0 yields an even larger objective function value. This is not the case for the other variables. As in the previous case, we first decide how much x 3 can be increased while keeping x 2 and s 1 at 0.

As in the previous case, we first decide how much x 3 can be increased while

The Simplex Method

To see this,

x 1 = 5

2

2 3

1

x 2 2 x 3

1

2 s 1 =

s 2 = 1 + 5x 2 + 2s 1 = 1 0

5

2

1

2 x 3 0

=

x 3 5.

=No restriction!

s 3 = 1 2 + 2 x 2

Note that row #2 imposes no restriction on how much x 3 can be increased. Clearly, the most restrictive bound is given by row 3. It says that you can increase x 3 at most by 1 without violating feasibility. With this in mind, the third feasible solution is:

1

1

1

2 x 3 + 3

2

s 1 =

1 2 2 x 3 0 =x 3 1

x 1 = 2, x 2 = 0, x 3 = 1, s 1 = 0, s 2 = 1, s 3 = 0,

with an objective function value of z = 25 + 1 2 x 3 = 13. This is an improvement!

2

1 , s 3 = 0 , with an objective function value of z = 2

The Simplex Method

We still need to continue because we can still observe an improvement. Note that, as we increased x 3 to 1, we forced s 3 down to 0. This suggests that we need to interchange the roles of s 3 and x 3 , i.e.,

s 3 =

1

2 +

1

2 x 2

1

2 x 3 + 3

2

s 1

=

x 3 = 1 + x 2 + 3s 1 2s 3 .

(2)

Substituting (??) in rows 1, 2 and 0, we get:

Row 1 =

3 1 1 x 1 = 5 − 2 x 2 − 2 x 3
3
1 1
x 1 = 5
2 x 2 −
2 x 3 −
2
2 s 1
1
= 5
x 2 − 1
2 (1 + x 2 + 3s 1 − 2s 3 ) −
2
− 2 3
2 s 1
x 1 = 2 − 2x 2 − 2s 1 + s 3 .

The Simplex Method

Row 2 =

Row 0 =

s 2 = 1 + 5x 2 + 2s 1 (x 3 does not appear, hence no change!)

z = 25

2

25

1

2 7 x 2 + 2 x 3 5

1

2 s 1

2 x 2 + 2 (1 + x 2 + 3s 1 2s 3 ) 5

7

2 s 1

=

=

2

13 3x 2 s 1 s 3 .

After all these arrangements, we end up with the following dictionary (Dictionary #3):

Row 0

z

=

13

3x 2

s 1

s 3

Row 1

x 1

=

2

2x 2

2s

1

+

s 3

Row 2

s 2

=

1

+

5x 2

+

2s

1

Row 3

x 3

=

1

+

x 2

+

3s

1

2s 3

= 1 + 5 x 2 + 2 s 1 Row 3 x 3 = 1

The Simplex Method

Now, with x 2 = 0, s 1 = 0 and s 3 = 0 we have a feasible solution that yields an objective function value of 13. Checking row 0, we immediately see that if we try to increase the values of any of these variables, we decrease the objective function value.

Therefore, we can no longer increase the objective function value among all feasible solutions. Hence, the third feasible solution obtained in this process is actually an optimal value, i.e.,

x

s

1

1

=

=

2

2, x

0, s

2

3

= 0, x = 1, s

3

= 1,

= 0.

Again, the optimal value z = 13.

1 ∗ 1 = = ∗ 2 ∗ 2 , x 0 , s 2 ∗

The Simplex Method

In the previous example, we observe the following,

With the exception of z, the variables that appear on the LHS of a dictionary are called basic variables. For example, in dictionary #3, x 1 , s 2 , and x 3 are basic variables.

All other variables that appear on the RHS of a dictionary are called non-basic variables. Note that non-basic variables necessarily have a value of 0 in a feasible solution corresponding to a dictionary. For example, in dictionary #3, x 2 , s 1 , and s 3 are non-basic variables and x 2 = s 1 = s 3 = 0.

Each of the three feasible solutions obtained above is called a basic feasible solution (bfs). Therefore, a bfs has the property that each non-basic variable has a value of 0. Moreover, two consecutive bfs’s share all but one basic variable, and as such they are called neighboring bfs’s.

0. Moreover, two consecutive bfs’s share all but one basic variable, and as such they are

The Simplex Method

The simplex method works only with bfs’s and ignores all other feasible solutions.

Note that, a basic feasible solution corner point.

works only with bfs’s and ignores all other feasible solutions. Note that, a basic feasible solution

The Simplex Method

More formally, let’s consider an LP with n variables in its standard form:

max c 1 x 1 + c 2 x 2 +

s.t.

+ c n x n

= b 1

a 21 x 1 +a 22 x 2 ··· +a 2n x n = b 2

a 11 x 1 +a 12 x 2 ···

+a 1n x n

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

.

a m1 x 1 +a m2 x 2 ··· +a mn x n = b m ···

x 1 ,

x 2 ,

x n

0

. a m 1 x 1 + a m 2 x 2 ··· + a m

The Simplex Method

Define,

A =

and,

a

a

.

11

21

.

.

.

a m1

.

a

a

.

12

22

.

.

.

a m2

.

···

···

.

.

.

.

···

.

.

a

a

.

1n

2n

.

.

a mn

c = c 1

x =

c 2

···

x

1

x

.

.

.

x

2

n

c n