logistics. terminology
DESCRIPTION
AACIMP 2009 Summer School lecture by Boris Goldengorin. "Logistics" course. 3rd - 4th hour. Part 3.TRANSCRIPT
Operations Research 1 – 06/07 – Chapter 4 1
Operations Research 1
Chapter 4Introduction to Operations Research
Hillier & LiebermannEighth EditionMcGrawHill
Operations Research 1 – 06/07 – Chapter 4 2
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 3
The Simplex Method – Graphical algorithmx 2
x1
10421 3 5 6 87 9
104
21
35
68
79
Maximize Z = 3x1 + 5x2
subject to
x1 ≤ 4
2x2 ≤ 12
3x1 + 2x2 ≤ 18
and
x1 ≥ 0; x2 ≥ 0
x1 = 4
2x2 = 12
3x1 + 2x2 = 18
Feasibleregion
= Corner-point solution (not feasible)
= Corner-point feasible solution (CPF solution)
For any linear programming problem with n decision variables, two CPF solutions are adjacent to each other if they share n – 1 constraint boundaries.
The two adjacent CPF solutions are connected by a line segment that lies on these same shared constraint boundary. Such a line segment is referred to as an edge of the feasible region.two adjacent
CPF-solutions
= Edge
Operations Research 1 – 06/07 – Chapter 4 4
The Simplex Method – Graphical algorithmx 2
x1
10421 3 5 6 87 9
104
21
35
68
79
x1 = 4
2x2 = 12
3x1 + 2x2 = 18
Feasibleregion
= Corner-point solution (not feasible)
= Corner-point feasible solution (CPF solution)
two adjacent CPF-solutions
= Edge
CPF solution
Its Adjacent CPF solution
(0, 0) (0, 6) and (4, 0)(0, 6) (2, 6) and (0, 0)(2, 6) (4, 3) and (0, 6)(4, 3) (4, 0) and (2, 6)(4, 0) (0, 0) and (4, 3)
Operations Research 1 – 06/07 – Chapter 4 5
x 2
x1
10421 3 5 6 87 9
104
21
35
68
79
Feasibleregion
Initialization: Choose (0,0) as the initial CPF solutionOptimality test: Is (0,0) an optimal CPF solution?
No (Z = 0), adjacent solutions are better.Iteration 1: Move to a better CPF solution in three steps:
1. 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. 2. Stop at the first new constraint boundary:
2x2 = 12 (We have to stay in the feasible region).
3. Solve for the intersection of the new set of constraints boundaries: (0, 6).Z = 3 * 0 + 5 * 6 = 30
Optimality test: Is (0, 6) an optimal CPF solution?No, an adjacent solution is better.
Maximize Z = 3x1 + 5x2
The Simplex Method – Graphical algorithm
Operations Research 1 – 06/07 – Chapter 4 6
x 2
x1
10421 3 5 6 87 9
104
21
35
68
79
Feasibleregion
Maximize Z = 3x1 + 5x2Iteration 2: Move to a better CPF solution in three steps:
1. 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.
2. Stop at the first new constraint boundary:3x1 + 2x2 = 12 (We have to stay in the feasible region).
3. Solve for the intersection of the new set of constraints boundaries: (2, 6).Z = 3 * 2 + 5 * 6 = 36
Optimality test: Is (2, 6) an optimal CPF solution?Yes, there is no better CPF solution!
The Simplex Method – Graphical algorithm
Operations Research 1 – 06/07 – Chapter 4 7
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 8
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 9
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 tox1 ≤ 4 2x2 ≤ 12
3x1+ 2x2 ≤ 18and x1 ≥ 0; x2 ≥ 0
Augmented Form of the Model
Maximize Z = 3x1 + 5x2
subject to x1 + x3 = 4
2x2 + x4 = 12 3x1 + 2x2 +x5 = 18and xj ≥ 0 for j = 1, 2, 3, 4, 5.
Operations Research 1 – 06/07 – Chapter 4 10
Slack values
FeasibleRegion
InfeasibleRegion
Constraint correspondingwith slack variable
Slack variable > 0 Slack variable < 0Slack variable = 0
Operations Research 1 – 06/07 – Chapter 4 11
Terminology – Graphical & AlgebraicGraphical Algorithm
Algebraic Algorithm
Solution Solution Augmented solution
Solution on a corner point
Corner point solution
Basic solutionAugmented corner point solution
Solution on a feasible corner point
CPF solution Basic Feasible (BF) solutionAugmented CPF solution
Example of a solution (0,6) (0, 6, 4, 0, 6)(Slack included)
Operations Research 1 – 06/07 – Chapter 4 12
Basic and non-basic variables
- =
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.
Number of variables (in augmented form)
Number of equations Number of degreesof freedom
Maximize Z = 3x1 + 5x2
subject to x1 + x3 = 4
2x2 + x4 = 12 3x1 + 2x2 +x5 = 18and xj ≥ 0 for j = 1, 2, 3, 4, 5.
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 var’s) then this must be true:x3 = 0; x2 = 5; x5 = -4(x3, x2 and x5 are basic var’s)
Operations Research 1 – 06/07 – Chapter 4 13
Properties of a Basic Solution1. 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 14
Solving the Simplex MethodGraphical & Algebraic Interpretations
Method Sequence Graphical Interpretation Algebraic InterpretationInitialization Choose (0, 0) to be the initial
CPF solution.Choose x1 and x2 to be the nonbasic variables (= 0) for the initial BF solution (0, 0, 4, 12, 18)
Optimality test Not optimal, because moving along either edge from (0, 0) increases Z.
Not optimal, because increasing either nonbasic variable (x1 or x2) increases Z.
Iteration 1 step 1 Move up the edge lying on the x2 axis.
Increase x2 while adjusting other variable values to satisfy the system of equations.
Iteration 1 step 2 Stop when the first new constraint boundary (2x2 = 12) is reached.
Stop when the first basic variable (x3, x4 or x5) drops to zero (x4).
Iteration 1 step 3 Find the intersection of the new pair of constraint boundaries: (0, 6) is the new CPF solution.
With x2 now a basic variable and x4 now a nonbasic variable, solve the system of equations: (0, 6, 4, 0, 6) is the new BF solution.
Operations Research 1 – 06/07 – Chapter 4 15
Solving the Simplex MethodGraphical & Algebraic Interpretations (continued)
Method Sequence Graphical Interpretation Algebraic InterpretationOptimality test Not optimal, because moving
along the edge from (0, 6) to the right increases Z.
Not optimal, because increasing one nonbasic variable (x1) increases Z.
Iteration 2 step 1 Move along this edge to the right.
Increase x1 while adjusting other variable values to satisfy the system of equations.
Iteration 2 step 2 Stop when the first new constraint boundary (3x1 + 2x2 = 18) is reached.
Stop when the first basic variable (x2, x3, or x5) drops to zero (x5).
Iteration 2 step 3 Find the intersection of the new pair of constraint boundaries: (2, 6) is the new CPF solution.
With x1 now a basic variable and x5 now a nonbasic variable, solve the system of equations: (2, 6, 2, 0, 0) is the new BF solution.
Optimality test (2, 6) is optimal, because moving along either edge from (2, 6) decreases Z.
(2, 6, 2, 0, 0) is optimal, because increasing either nonbasic variable(x4 or x5) decreases Z.
Operations Research 1 – 06/07 – Chapter 4 16
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 = 0(1) x1 + x3 = 4(2) 2x2 + x4 = 12(3) 3x1 + 2x2 +x5 = 18
Tabular FormBasic
variableEq Coefficient of: Right
sideZ x1 x2 x3 x4 x5
Z (0) 1 -3 -5 0 0 0 0x3 (1) 0 1 0 1 0 0 4
x4 (2) 0 0 2 0 1 0 12
x5 (3) 0 3 2 0 0 1 18
Operations Research 1 – 06/07 – Chapter 4 17
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.
• IterationSee next slides
Operations Research 1 – 06/07 – Chapter 4 18
Tabular Form: The algorithmTabular Form
Basic variable
Eq. Coefficient of: Right sideZ x1 x2 x3 x4 x5
Z (0) 1 -3 -5 0 0 0 0x3 (1) 0 1 0 1 0 0 4
x4 (2) 0 0 2 0 1 0 12
x5 (3) 0 3 2 0 0 1 18
Pivot column• Iteration– 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 19
Tabular Form: The algorithm
62
12 =
92
18 =
Tabular Form Basic
variableEq. Coefficient of: Right
sideRatio
Z x1 x2 x3 x4 x5
Z (0) 1 -3 -5 0 0 0 0 x3 (1) 0 1 0 1 0 0 4 infinite
x4 (2) 0 0 2 0 1 0 12 minimum
x5 (3) 0 3 2 0 0 1 18
• Iteration– 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.
Pivot number
Operations Research 1 – 06/07 – Chapter 4 20
Tabular Form: The algorithmIteration: 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 the new pivot row.
Tabular Form
Iteration Basic variable Eq. Coefficient of: Right side
Z x1 x2 x3 x4 x5
0 Z (0) 1 -3 -5 0 0 0 0
x3 (1) 0 1 0 1 0 0 4
x4 (2) 0 0 2 0 1 0 12
x5 (3) 0 3 2 0 0 1 18
1 Z (0)
x3 (1)
x2 (2) 0 0 1 0 1/2 0 6
x5 (3)
1 Z (0) 1 -3 0 0 5/2 0 30
x3 (1) 0 1 0 1 0 0 4
x2 (2) 0 0 1 0 1/2 0 6
x5 (3) 0 3 0 0 -1 1 6
The operations in this example:1. New row (2) = Old row (2) / 22. 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 21
Tabular Form: The algorithmOptimality 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:
Tabular Form
Iteration Basic variable Eq. Coefficient of: Right side
Z x1 x2 x3 x4 x5
0 Z (0) 1 -3 -5 0 0 0 0
x3 (1) 0 1 0 1 0 0 4
x4 (2) 0 0 2 0 1 0 12
x5 (3) 0 3 2 0 0 1 18
1 Z (0) 1 -3 0 0 5/2 0 30
x3 (1) 0 1 0 1 0 0 4
x2 (2) 0 0 1 0 1/2 0 6
x5 (3) 0 3 0 0 -1 1 6
414 =
236 =
2 Z (0) 1 0 0 0 3/2 1 36
x3 (1) 0 0 0 1 1/3 -1/3 2
x2 (2) 0 0 1 0 1/2 0 6
x1 (3) 0 1 0 0 -1/3 1/3 2
- 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 22
Tie breaking in the simplex methodYou 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 23
The entering basic variable, step 1If 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 24
The leaving basic variable, step 2Definition: Basic Variables (BV’s) 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 25
No leaving Basic Variable (BV) – Unbouded ZIf the entering BV could be increased indefinitely without givingnegative values to any of current BV’s, then no variable qualifies to bethe leaving BV.
Basic Variable Eq.
Coefficient of: Right Side RatioZ x1 x2 x3
ZX3
(0)(1)
10
-3 -5 0 1 0 1
0 4 None
With x1= 0 and x2 increasing, x3 = 4 - 1x1 – 0x2 = 4 > 0.
• TABLE 4.9 Initial simplex tableau for the Wyndor Glass Co. Problem without the last two functional constraints.
Operations Research 1 – 06/07 – Chapter 4 26
Multiple Optimal Solutions continuedAny 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 27
Table 4.10 Basic Iteration Variable Eq.
Coefficient of: Right OptimalSide solutionZ x1 x2 x3 x4 x5
Z0 x3
x4
x5
(0)(1)(2)(3)
1000
-3 -2 0 0 0 1 0 1 0 0 0 2 0 1 0 3 2 0 0 0
0 no 4 12 18
Z1 x1
x4
x5
(0)(1)(2)(3)
1000
0 -2 3 0 0 1 0 1 0 0 0 2 0 1 0 0 2 -3 0 1
12 no 4 12 6
Z2 x1
x4
x2
(0)(1)(2)(3)
1000
0 0 0 0 1 1 0 1 0 0 0 0 3 1 -1 0 1 -3/2 0 -1/2
18 Yes 4 6 3
Z3 x1
x3
x2
(0)(1)(2)(3)
1000
0 0 0 0 1 1 0 0 -1/3 1/3 0 0 1 1/3 -1/3 0 1 0 1/2 0
18 Yes 2 2 6
Operations Research 1 – 06/07 – Chapter 4 28
Equality ConstraintsAny 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 29
Figure 4.3
(2,6)
(4,3)
Maximize Z = 3x1 + 5x2,Subject to X1 ≤ 4 2x2 ≤ 12 3x1 + 2x2 = 18And x1 ≥ 0, x2 ≥ 0
• 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).
Operations Research 1 – 06/07 – Chapter 4 30
MinimizationMinimization problems can be converted to equivalent
maximization problems:
Minimizing
is equivalent to
Maximizing
∑=
=n
1jjjxcZ
∑=
−=−n
1jjj x)c(Z
Operations Research 1 – 06/07 – Chapter 4 31
Variables Allowed to be negativeSuppose 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 32
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
x’j = xj – Lj, so x’j ≥ 0. Thus, x’j + Lj would be substituted for xj throughout the
model, so that the redefined decision variable x’j cannot be negative. (This same technique can be used when Lj is positive to convert a functional constraint xj ≥ Lj to a nonnegativity constraint x’j ≥ 0.)
Operations Research 1 – 06/07 – Chapter 4 33
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 byx1 ≥ -10To obtain the equivalent model needed for the simplex method, this decision variable would be redefined as the total production rate of product 1x’j = x1 + 10,which yields the changes in the objective function and constraints as shown:
Z = 3x1 + 5x2
x1 ≤ 4 2x2 ≤ 123x1 + 2x2 ≤ 18x1 ≥ -10, x2 ≥ 0
Z = 3(x’1-10) + 5x2
x’1 - 10 ≤ 4 2x2 ≤ 123(x’1-10)+ 2x2 ≤ 18x’1 - 10 ≥ -10, x2 ≥ 0
Z = -30 + 3x’1 + 5x2
x’1 ≤ 14 2x2 ≤ 123x’1 + 2x2 ≤ 48x’1 ≥ 0, x2 ≥ 0