Operations Research 1: Introduction To Operations Research Hillier & Liebermann Eighth Edition Mcgrawhill

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 33

Operations Research 1

Chapter 4 Introduction to Operations Research Hillier & Liebermann Eighth Edition McGrawHill
Operations Research 1 06/07 Chapter 4 1

Contents
Simplex method: Graphical Algorithm Simplex method: Algebraic Algorithm Differences between the graphical and the algebraic algorithm Simplex method: Tabular Form Simplex method: Tie breaking Simplex method: Other model forms

Operations Research 1 06/07 Chapter 4

The Simplex Method Graphical algorithm


10

x1 = 4

For any linear= 3x1 + 5x2 Maximize Z programming problem with n decision variables, two CPF solutions are adjacent subject to to each other if they share n 1 x1 4 constraint boundaries. The two adjacent 12 solutions 2x2 CPF are connected by a line segment that3x1 + 2x2 lies on these 18 shared same constraint boundary. Such a line and segment is referred to as an edge of the feasible region.

x2

2x2 = 12 two adjacent CPF-solutions Feasible region 3x1 + 2x2 = 18


x1 1 2 3 4 5 6 7 8 9 10

x1 0; x2 0 = Corner-point solution (not feasible)

= Corner-point feasible solution (CPF solution) = Edge

Operations Research 1 06/07 Chapter 4

The Simplex Method Graphical algorithm


10

x1 = 4

CPF solution

Its Adjacent CPF solution

x2

(0, 0) (0, 6) (2, 6)


2x2 = 12 two adjacent CPF-solutions Feasible region 3x1 + 2x2 = 18
x1 1 2 3 4 5 6 7 8 9 10

(0, 6) and (4, 0) (2, 6) and (0, 0) (4, 3) and (0, 6) (4, 0) and (2, 6) (0, 0) and (4, 3)

(4, 3) (4, 0)

= Corner-point solution (not feasible) = Corner-point feasible solution (CPF solution) = Edge

Operations Research 1 06/07 Chapter 4

The Simplex Method Graphical algorithm


Maximize Z = 3x1 + 5x2
x2 10

Initialization: Optimality test: Iteration 1: 1.

2.

Feasible region

3. Optimality test:

Choose (0,0) as the initial CPF solution Is (0,0) an optimal CPF solution? No (Z = 0), adjacent solutions are better. Move to a better CPF solution in three steps: Choose the direction with the highest rate of increasing Z. Z increases with a rate of 3 by moving up the x1 axis. Z increases with a rate of 5 by moving along the x2 axis. We choose to move up the x2 axis. Stop at the first new constraint boundary: 2x2 = 12 (We have to stay in the feasible region). Solve for the intersection of the new set of constraints boundaries: (0, 6). Z = 3 * 0 + 5 * 6 = 30 Is (0, 6) an optimal CPF solution? No, an adjacent solution is better. x1
10

Operations Research 1 06/07 Chapter 4

The Simplex Method Graphical algorithm


Maximize Z = 3x1 + 5x2
10 x2

Iteration 2: 1.

2.

3. Optimality test:

Feasible region

Move to a better CPF solution in three steps: Choose the best direction. Z will increase by moving to the right. Rate = 3. Z will decrease by moving down the x2 axis. We choose to move to the right. Stop at the first new constraint boundary: 3x1 + 2x2 = 12 (We have to stay in the feasible region). Solve for the intersection of the new set of constraints boundaries: (2, 6). Z = 3 * 2 + 5 * 6 = 36 Is (2, 6) an optimal CPF solution? Yes, there is no better CPF solution!

x1 1 2 3 4 5 6 7 8 9 10

Operations Research 1 06/07 Chapter 4

Graphical algorithm: The Key Solution Concepts


Solution concept 1
Method focuses solely on CPF-solutions If there are CPF-solutions, find the best.

Solution concept 2
Iterative algorithm:
Initialization: Set up, find a initial CPF-solution Optimality test: Is the solution optimal? If no, continue. If yes, stop. Iteration: Perform an iteration to find a better CPF solution. Then go back to the optimality test.

Solution concept 3
Whenever possible, choose the origin as the initial CPF-solution at initialization. This eliminates the use of algebraic procedures to find and solve for an initial CPF solution.
Operations Research 1 06/07 Chapter 4 7

Graphical algorithm: The Key Solution Concepts


Solution concept 4
At iteration, only adjacent CPF solutions are considered. The path to find the optimal solution is along the edges of the feasible region.

Solution concept 5
After identification of the current CPF solution, examine all the edges that emanate from that CPF solution. The edges lead to other CPF solution. Choose the edge with the (highest) positive rate of improvement in Z.*

Solution concept 6
If the rate of improvement in Z is positive, the next adjacent CPF solution is better than the current CPF solution.* If the rate of improvement in Z is negative, the next adjacent CPF solution is worse.* If there are no positive rates of improvement, the current CPF solution is optimal.*

* Only if the objective function is to maximize Z


Operations Research 1 06/07 Chapter 4 8

Notion of the Simplex Method


Besides the graphical algorithm, there is an algebraic algorithm. This algorithm is based on solving systems of equations. We need to translate inequality constraints to equality constraints. Therefore we introduce slack variables.
Original Form of the Model Maximize Z = 3x1 + 5x2 subject to x1 4 2x2 12 3x1+ 2x2 18 and x1 0; x2 0 Augmented Form of the Model Maximize Z = 3x1 + 5x2 subject to x1 + x3 2x2 + x4 3x1 + 2x2 +x5 and xj 0 for j = 1, 2, 3, 4, 5.

=4 = 12 = 18
9

Operations Research 1 06/07 Chapter 4

Slack values
Slack variable > 0 Slack variable = 0 Slack variable < 0

Feasible Region

Infeasible Region

Constraint corresponding with slack variable


Operations Research 1 06/07 Chapter 4 10

Terminology Graphical & Algebraic


Graphical Algorithm Solution Solution Algebraic Algorithm Augmented solution Basic solution Augmented corner point solution Basic Feasible (BF) solution Augmented CPF solution (0, 6, 4, 0, 6) (Slack included)

Solution on a corner Corner point point solution Solution on a feasible CPF solution corner point Example of a solution (0,6)

Operations Research 1 06/07 Chapter 4

11

Basic and non-basic variables


Number of variables (in augmented form)

- Number of equations

Number of degrees = of freedom

Thus, we can choose a number of variables (= number of degrees of freedom) to be set equal to any arbitrary value. These variables are called nonbasic variables. (Together they are the basis.) The other variables are called basic variables.
Maximize Z = 3x1 + 5x2 subject to x1 + x3 2x2 + x4 3x1 + 2x2 +x5 and xj 0 for j = 1, 2, 3, 4, 5.
Operations Research 1 06/07 Chapter 4

=4 = 12 = 18

In this example there are 5 3 = 2 degrees of freedom. For example, we choose x1 = 4 and x4 = 2 (x1 and x4 are nonbasic vars) then this must be true: x3 = 0; x2 = 5; x5 = -4 (x3, x2 and x5 are basic vars)
12

Properties of a Basic Solution


1. Each variable is designated as either a nonbasic variable or a basic variable. 2. The number of basic variables equals the number of functional constraints. 3. The nonbasic variables are set to equal. 4. The values of the basic variables are obtained as the simultaneous solution of the system of equations. 5. If the basic variables satisfy the nonnegativity constraints, the basic solution is a BF solution (feasible).

Operations Research 1 06/07 Chapter 4

13

Method Sequence Graphical Interpretation Initialization

Solving the Simplex Method Graphical & Algebraic Interpretations


Algebraic Interpretation Choose (0, 0) to be the initial CPF solution. Not optimal, because moving along either edge from (0, 0) increases Z. Choose x1 and x2 to be the nonbasic variables (= 0) for the initial BF solution (0, 0, 4, 12, 18) Not optimal, because increasing either nonbasic variable (x1 or x2) increases Z.

Optimality test

Iteration 1 step 1

Move up the edge lying on the x2 Increase x2 while adjusting other variable axis. values to satisfy the system of equations. Stop when the first new Stop when the first basic variable (x3, x4 constraint boundary (2x2 = 12) is or x5) drops to zero (x4). reached. Find the intersection of the new With x2 now a basic variable and x4 now a pair of constraint boundaries: (0, nonbasic variable, solve the system of 6) is the new CPF solution. equations: (0, 6, 4, 0, 6) is the new BF solution.

Iteration 1 step 2

Iteration 1 step 3

Operations Research 1 06/07 Chapter 4

14

Method Sequence Optimality test

Solving the Simplex Method Graphical & Algebraic Interpretations (continued)


Graphical Interpretation Algebraic Interpretation Not optimal, because moving along the edge from (0, 6) to the right increases Z. Move along this edge to the right. Not optimal, because increasing one nonbasic variable (x1) increases Z. Increase x1 while adjusting other variable values to satisfy the system of equations.

Iteration 2 step 1

Iteration 2 step 2

Stop when the first new Stop when the first basic variable (x2, x3, constraint boundary (3x1 + 2x2 = or x5) drops to zero (x5). 18) is reached. Find the intersection of the new With x1 now a basic variable and x5 now a pair of constraint boundaries: nonbasic variable, solve the system of (2, 6) is the new CPF solution. equations: (2, 6, 2, 0, 0) is the new BF solution. (2, 6) is optimal, because (2, 6, 2, 0, 0) is optimal, because moving along either edge from increasing either nonbasic variable(x4 or (2, 6) decreases Z. x5) decreases Z.

Iteration 2 step 3

Optimality test

Operations Research 1 06/07 Chapter 4

15

Simplex Method Tabular Form


Besides the graphical and algebraic forms, there is a tabular form, which is more convenient to use for solving a problem by hand.
Algebraic Form: (0) Z - 3x1 - 5x2 (1) x1 + x3 (2) 2x2 + x4 (3) 3x1 + 2x2 +x5 Tabular Form Basic Eq variable Z x3 x4 x5 (0) (1) (2) (3) Coefficient of: Z 1 0 0 0 x1 -3 1 0 3 x2 -5 0 2 2 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 =0 =4 = 12 = 18 Right side 0 4 12 18
16

Operations Research 1 06/07 Chapter 4

Tabular Form: The algorithm


Initialization
Just like the algebraic algorithm, introduce slack variables. Select the decision variables to be the initial nonbasic variables (= 0). Select the slack variables to be the initial basic variables.

Optimality Test
The current BF solution is optimal if and only if every coefficent in row 0 is nonnegative ( 0). If it is, stop. Otherwise go to an iteration.

Iteration See next slides

Operations Research 1 06/07 Chapter 4

17

Tabular Form: The algorithm


Tabular Form Basic Eq. variable Z x3 x4 x5 (0) (1) (2) (3) Coefficient of: Z 1 0 0 0 x1 -3 1 0 3 x2 -5 0 2 2 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 Right side 0 4 12 18

Iteration

Pivot column

Step 1. Determine the entering basic variable by selecting the variable with the most negative coefficient in Eq. (0). Put a box around the column and call this the pivot column.
Operations Research 1 06/07 Chapter 4 18

Tabular Form: The algorithm


Tabular Form Basic Eq. variable Z x3 x4 x5 (0) (1) (2) (3) Coefficient of: Z 1 0 0 0 x1 -3 1 0 3 x2 -5 0 2 2 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 1 Right side 0 4 12 18 infinite Ratio

12 = 6 2 18 = 9 2

minimum

Iteration

Pivot number

Operations Research 1 06/07 Chapter 4

Step 2. Determine the leaving basic variable by applying the minimum ratio test. Put a box around the row with the minimum ratio, this is the pivot row. Call the number in both boxes the pivot number.

19

Tabular Form: The algorithm


Tabular Form Iteration Basic variable Eq. Z 0 Z x3 x4 x5 1 Z x3 x2 x5 (0) (1) (2) (3) (0) (1) (2) (3) 1 0 0 0 1 0 0 0 x1 -3 1 0 3 -3 1 0 3 Coefficient of: x2 -5 0 2 2 0 0 1 0 x3 0 1 0 0 0 1 0 0 x4 0 0 1 0 5/2 0 1/2 -1 x5 0 0 0 1 0 0 0 1 0 4 12 18 30 4 6 6 Right side

Iteration: Step 3.
Solve for the new BF solution by changing the column of the entering basic variable (-5, 0, 2, 2) to the column of the leaving basic variable (0, 0, 1, 0) by using elementary row operations: 1. Divide the pivot row by the pivot number. Use this new pivot column in steps 2 and 3. 2. For each other row (including row 0) that has a negative coefficient in the pivot column, add to this row the product of the absolute value of this coefficient and the new pivot row. 3. For each other row that has a negative coefficient in the pivot column, substract from this row the product of this coefficient and 20 the new pivot row.

The operations in this example: 1. New row (2) = Old row (2) / 2 2. New row (0) = Old row (0) + 5 * New row (2) 3. New row (3) = Old row (3) 2 * New row (2)

Operations Research 1 06/07 Chapter 4

Tabular Form: The algorithm


Tabular Form Iteration Basic variable Eq. Z 0 Z x3 x4 x5 1 Z x3 x2 x5 2 Z x3 x2 x1 (0) (1) (2) (3) (0) (1) (2) (3) (0) (1) (2) (3) 1 0 0 0 1 0 0 0 1 0 0 0 x1 -3 1 0 3 -3 1 0 3 0 0 0 1 Coefficient of: x2 -5 0 2 2 0 0 1 0 0 0 1 0 x3 0 1 0 0 0 1 0 0 0 1 0 0 x4 0 0 1 0 5/2 0 1/2 -1 3/2 1/3 1/2 -1/3 x5 0 0 0 1 0 0 0 1 1 -1/3 0 1/3 30 4 6 6 0 4 12 18 Right side

4 = 4 1 6 = 2 3

36 2 6 2

Optimality test: Still not optimal because there is a negative coefficient in row (0). So at least one more iteration is needed. Iteration 2: - Determine the pivot row (and entering basic variable). - Run a minimum ratio test. - Determine the pivot column (and leaving basic variable). - Perform elementary operations:
- New row (3) = Old row (3) / 3 - New row (0) = Old row (0) + 3 * New row (3) - New row (1) = Old row (1) 1 * New row (3)

Optimality test: There is no negative coefficient in row (0), so the solution is optimal! Solution: Z = 36; x1 = 2; x2 = 6
Operations Research 1 06/07 Chapter 4 21

Tie breaking in the simplex method


You may have noticed that we never said what to do if the various choice rules of the simplex method do not lead to a clear-cut decision, because of either ties or other similar ambiguities. We discuss these details now.

Operations Research 1 06/07 Chapter 4

22

The entering basic variable, step 1


If more than one nonbasic variables are tied for having the largest negative coefficient, then the selection may be made arbitrary.

Operations Research 1 06/07 Chapter 4

23

The leaving basic variable, step 2


Definition: Basic Variables (BVs) with a value of zero are called degenerate. Not very often a choice of a degenerate variable may lead to a loop. R. Bland (Mathematics of Operations Research, 2: 103-107, 1977) has suggested special rules avoiding such loops.

Operations Research 1 06/07 Chapter 4

24

No leaving Basic Variable (BV) Unbouded Z


If the entering BV could be increased indefinitely without giving negative values to any of current BVs, then no variable qualifies to be the leaving BV.
TABLE 4.9 Initial simplex tableau for the Wyndor Glass Co. Problem without the last two functional constraints.

Basic Variable Z X3

Coefficient of: Eq. (0) (1) Z 1 0 x1 -3 1 x2 -5 0 x3 0 1

Right Side 0 4

Ratio

With x1= 0 and x2 increasing, x3 = 4 - 1x1 0x2 = 4 > 0.

None

Operations Research 1 06/07 Chapter 4

25

Multiple Optimal Solutions continued


Any Weighted average of two or more solutions (vectors) where the weights are nonnegative and sum is equal to 1 is called a convex combination of these solutions. Whenever a problem has more than one optimal BF solution, at least one of the nonbasic variables has a coefficient of zero in the final row 0, so increasing any such variable will not change the value of Z. Therefore, these other optimal BF solutions can be identified (if desired) by performing additional iterations of the simplex method, each time choosing a nonbasic variable with a zero coefficient as the entering basic variable. If such an iteration has no leaving basic variable, this indicates that the feasible region is unbounded and the entering basic variables can be increased indefinitely without changing the value of Z.

Operations Research 1 06/07 Chapter 4

26

Table 4.10
Iteration Basic Variable Z x3 x4 x5 Z x1 x4 x5 2 Z x1 x4 x2 Z x1 Coefficient of: Eq. (0) (1) (2) (3) Z 1 0 0 0 x1 -3 1 0 3 x2 -2 0 2 2 x3 0 1 0 0 x4 0 0 1 0 x5 0 0 0 0 Right Side 0 4 12 18 Optimal solution no

(0) (1) (2) (3) (0) (1) (2) (3)

1 0 0 0 1 0 0 0

0 1 0 0 0 1 0 0

-2 0 2 2 0 0 0 1 0 0 0 1

3 1 0 -3 0 1 3 -3/2 0 0 1 0

0 0 1 0 0 0 1 0 0 -1/3 1/3 1/2

0 0 0 1 1 0 -1 -1/2 1 1/3 -1/3 0

12 4 12 6 18 4 6 3 18 2 2 6

no

Yes

(0) 1 0 3 (1) 0 1 (2) 0 0 x3 Operations Research 1 06/07 Chapter 4 (3) 0 0 x


2

Yes 27

Equality Constraints
Any equality constraint ai1x1 + ai2x2 + + ainxn = bi Actually is equivalent to a pair of inequality constraints: ai1x1 + ai2x2 + + ainxn bi ai1x1 + ai2x2 + + ainxn bi Example: Suppose that the Wyndor Glass Co. Problem is modified to require that Plant 3 be used at full capacity. The only resulting change in the LP model is that the third constraint, 3x1 + 2x2 18, instead becomes an equality constraint 3x1 + 2x2 = 18, so that the complete model becomes the one shown in the upper right hand corner of figure 4.3. This figure als shows in darker ink the feasible region which now consists of just the line segment connecting (2,6) and (4,3). After the slack variables still needed for the inequality constraints are introduced, the system of equations for the augmented form of the problem becomes (0) Z 3x1 5x2 =0 (1) x1 + x3 =4 (2) 2x2 + x4 =12 (3) 3x1 + 2x2 = 18
Operations Research 1 06/07 Chapter 4

28

Figure 4.3
Figure 4.3 When the third constraint becomes an equality constraint, the feasible region for the Wyndor Glass Co. problem becomes the line segment between (2,6) and (4,3). Maximize Z = 3x1 + 5x2, Subject to X1 4 2x2 12 3x1 + 2x2 = 18 And x1 0, x2 0

(2,6)

(4,3)

Operations Research 1 06/07 Chapter 4

29

Minimization
Minimization problems can be converted to equivalent maximization problems: Minimizing

Z=

cjxj

j= 1

is equivalent to Maximizing

Z=

( cj)xj

j= 1

Operations Research 1 06/07 Chapter 4

30

Variables Allowed to be negative


Suppose that the Wyndor Glass Co. Problem is changed so that product 1 already is in production, and the first decision variable x1 represents the increase in its production rate. Therefore, a negative value of x1 would indicate that product 1 is to be cut back by that amount. Such reductions might be desirable to allow a larger production rate for the new, more profitable product 2, so negative values should be allowed for x1 in the model.

Operations Research 1 06/07 Chapter 4

31

Variables with Bound on the Negative Values Allowed. (sheet 1 of 2)


Consider any decision variable xj that is allowed to have negative values which satisfy a constraint of the form xj Lj , Where Lj is some negative constant. This constraint can be converted to a nonnegativity constraint by making the change of variables xj = xj Lj, so xj 0. Thus, xj + Lj would be substituted for xj throughout the model, so that the redefined decision variable xj cannot be negative. (This same technique can be used when Lj is positive to convert a functional constraint xj Lj to a nonnegativity constraint xj 0.)
Operations Research 1 06/07 Chapter 4 32

Variables with Bound on the Negative Values Allowed. (continued)


To illustrate, suppose that the current production rate for product 1 in the Wyndor Glass Co. problem is 10. With the definition of x1 just given, the complete model at this point is the same as that given in Sec.3.1 except that the nonnegativity constraint x1 0 is replaced by x1 -10 To obtain the equivalent model needed for the simplex method, this decision variable would be redefined as the total production rate of product 1 xj = x1 + 10, which yields the changes in the objective function and constraints as shown:3x + 5x Z= Z = 3(x1-10) + 5x Z = -30 + 3x + 5x
1 2 2 1 2

2x2 3x1 + 2x2 x1 -10,

x1

4 12 18 x2 0

x1 - 10 4 2x2 12 3(x1-10)+ 2x2 18 x1 - 10 -10, x2 0

14 2x2 12 3x1 + 2x2 48 x1 0, x2 0 33

x1

Operations Research 1 06/07 Chapter 4

You might also like