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

Management II

Part 1: Methods
Linear programming
Linear programming
• Mathematical technique to solve optimization problems
»Maximize or minimize a linear function
• 𝑛𝑛 real variables
• subject to 𝑚𝑚 constraints.
»e.g. scheduling of personnel, blending problems, inventory control
and production planning, distribution and logistics problems,
assignment problems, etc.
»Commonly solved using the Simplex method

3
Definition of commonly used terms
• Objective function
»Quantity to be minimized or maximized
• Constraints
»Linear combination of problem variables followed by relational
operator ≤, =, ≥ followed by a nonnegative “right-hand side”
constant
• Right-hand side
»Required to be nonnegative  if not, multiply constraint by -1
»example: 4𝑥𝑥1 − 2𝑥𝑥2 ≤ −5  −4𝑥𝑥1 + 2𝑥𝑥2 ≥ 5

4
Definition of commonly used terms
• Feasible region
»Set of values of the decision variables that satisfy all constraints
»All constraints are linear, so the feasible region is a convex
polytope (i.e., a straight line between any two points lies entirely
within the set)
• Feasible solution
»One particular set of values of the decision variables that satisfies
all constraints
»Can be an extreme point or an interior point

5
Definition of commonly used terms
• Extreme points
»Finite number of feasible points that are corner points to the
feasible region
• Optimal solution
»The feasible solution that maximizes or minimizes the objective
function
»At least one of the extreme points is always an optimal solution
»In some cases the optimal solution is not unique - in this case there
is an infinite number of optimal solutions

6
Features of linear programs
• Linearity
»The objective and all constraints can be formulated as a linear
function of the decision variables – otherwise the problem is
nonlinear and cannot be solved by linear programming
• Continuity
»All decision variables must be continuous (i.e., can take any
nonnegative value) as opposed to discrete or integer valued
»The optimal integer solution is not always equal to the continuous
solution rounded to the nearest integer

7
Example problem
• Company produces household and commercial furnishings
» Two types of desks
• Rolltop
– 10 sqft pine, 4 sqft cedar, 15 sqft maple
– $115 profit per sale
• Regular
– 20 sqft pine, 16 sqft cedar, 10 sqft maple
– $90 profit per sale
» Current inventory: 200 sqft pine, 128 sqft cedar, 220 sqft maple
» Production volume of each type to maximize profit?

8
Example problem
𝑥𝑥1 … 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝑡𝑡𝑡𝑡𝑡𝑡 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝
𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑 𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣𝑣
𝑥𝑥2 … 𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑜𝑜𝑜𝑜 𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟𝑟 𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑𝑑 𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝𝑝

𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀
115𝑥𝑥1 + 90𝑥𝑥2 𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜𝑜 𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓𝑓
𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡𝑡𝑡
10𝑥𝑥1 + 20𝑥𝑥2 ≤ 200
4𝑥𝑥1 + 16𝑥𝑥2 ≤ 128 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐
15𝑥𝑥1 + 10𝑥𝑥2 ≤ 220

𝑥𝑥1 ≥ 0
𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛𝑛 𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐𝑐
𝑥𝑥2 ≥ 0
9
Solving linear programming problems graphically
• Each constraint is represented by a straight line (in 2D)
»Determine the two intercepts with the axes by setting one variable
to zero and solving for the second variable:
• 10𝑥𝑥1 + 20𝑥𝑥2 ≤ 200  10𝑥𝑥1 + 20𝑥𝑥2 = 200
• 𝑥𝑥1 = 0  20𝑥𝑥2 = 200  𝑥𝑥2 = 10
• 𝑥𝑥2 = 0  10𝑥𝑥1 = 200  𝑥𝑥1 = 20
• The line passes through the points (20,0) and (0,10). Which
side is feasible can be found by plugging one point on each
side into the constraint to see which is feasible.

10
Solving linear programming problems graphically
x2 50
48
46
44
42
40
38
36
34
32
30
28
26
24
22
20
18
16
14
12
10
8
6
4
2
0
-6 -4 -2-2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
-4 x1
-6

10𝑥𝑥1 + 20𝑥𝑥2 = 200 11


Solving linear programming problems graphically
x2 50
48
46
44
42
40
38
36
34
32
30
28
26
15𝑥𝑥1 + 10𝑥𝑥2 = 220
24
22
20
18
16
14
12
10
8
6
4
2
0
-6 -4 -2-2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
-4 x1
-6

14.6667 10𝑥𝑥1 + 20𝑥𝑥2 = 200 12


Solving linear programming problems graphically
x2 50
48
46
44
42
40
38
36
34
32
30
28
26
15𝑥𝑥1 + 10𝑥𝑥2 = 220
24
22
20
18
16
14
12
10
8 4𝑥𝑥1 + 16𝑥𝑥2 = 128
6
4
2
0
-6 -4 -2-2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
-4
-6 x1

14.6667 10𝑥𝑥1 + 20𝑥𝑥2 = 200 13


Solving linear programming problems graphically
• Determine the optimal solution graphically
»Draw the objective function like the constraints by choosing
arbitrary values for it:
• 𝑍𝑍 = 115𝑥𝑥1 + 90𝑥𝑥2 = 1000
• 𝑥𝑥1 = 0  90𝑥𝑥2 = 1000  𝑥𝑥2 = 11.1111
• 𝑥𝑥2 = 0  115𝑥𝑥1 = 1000  𝑥𝑥1 =8.69565

• Move this line parallel until it touches exactly one extreme


point of the feasible region and determine this points value.

14
Solving linear programming problems graphically
x2 50
48
46
44
42
40
38
36
34
32
30
28
26
24
22
20
18
16
14
12
10
8
6
4
2
0
-6 -4 -2-2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
-4
-6 x1

𝑍𝑍 = 1000 15
Solving linear programming problems graphically
x2 50
48
46
44
42
40
38
36
34
32
30
28
26
24
22
20
18
16
14
12
10
8
𝑥𝑥1 = 12, x2 = 4
6
4
2
0
-6 -4 -2-2 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40
-4
-6 x1

𝑍𝑍 = 1740 16
Solving linear programming problems with Excel

𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀
115𝑥𝑥1 + 90𝑥𝑥2 Variables: x1 x2 operator RHS
Objective 115 90 max
𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡𝑡𝑡
Constraint 1 10 20 ≤ 200
10𝑥𝑥1 + 20𝑥𝑥2 ≤ 200
Constraint 2 4 16 ≤ 128
4𝑥𝑥1 + 16𝑥𝑥2 ≤ 128
Constraint 3 15 10 ≤ 220
15𝑥𝑥1 + 10𝑥𝑥2 ≤ 220

17
Solving linear programming problems with Excel

F5=C5*$C$4+D5*$D$4
F7=C7*$C$4+D7*$D$4
F8=C8*$C$4+D8*$D$4
F9=C9*$C$4+D9*$D$4

18
Solving linear programming problems with Excel

19
Solving linear programming problems with Excel

20
Solving linear programming problems with Excel

21
Interpreting the sensitivity report

22
Shadow prices
• What value do additional resources have to the objective
function?
»This information is contained in the values of the shadow prices for
the constraints
»This is the improvement in the objective function realized by
adding one additional unit of a resource
»e.g., the first constraint refers to the amount of pine needed – as
this constraint is binding (i.e., the final value equals the right-hand
side), so adding more pine would increase the revenue

23
Objective function coefficients and right-hand side
• Shadow prices remain valid as long as the basis does not
change (i.e., the set of positive variables in the final solution)
»„allowable increase“ and „allowable decrease“ indicate the range
within which the right-hand sides and the objective function
coefficients may vary without changing the basis (and thus the
shadow prices)
»example: the price for roll top desks may not increase by more
than 20 or decrease by more than 70
»Note: only a single parameter may change at a time

24
Adding a new variable
• Should a new product „vanity table“ be produced?
»Selling price: 75$
»Resources: 8 sqft pine, 6 sqft cedar, and 10 sqft of maple
• The answer is hidden in the shadow prices:
»Show the value of each unit of resource in the current solution
»Reducing the amount of pine by 8 sqft causes 8*1$ reduction in
profit, 10 sqft of maple reduce it by 10*7$
»The total reduction for one vanity table would be 78$ while the
revenue would only be 75$, so it should not be produced

25
Recognizing special problems
• Unbounded solutions
»If the feasible region of a problem is not bounded, the values for
the decision variables can be as large as we like and there is no
optimal solution.
x2 10
9
𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 8
2𝑥𝑥1 + 3𝑥𝑥2 7 2𝑥𝑥1 + x2 = 7
6

𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡𝑡𝑡 5
4 𝑥𝑥1 + x2 = 5
𝑥𝑥1 + 4𝑥𝑥2 ≥ 8 3
2
𝑥𝑥1 + 4x2 = 8
𝑥𝑥1 + 𝑥𝑥2 ≥ 5 1

2𝑥𝑥1 + 𝑥𝑥2 ≥ 7 0
0 1 2 3 4 5 6 7 8 9 10
𝑥𝑥1 , 𝑥𝑥2 ≥ 0 x1
26
Recognizing special problems
• Empty feasible region
»If two or more constraints are inconsistent, there will be no
feasible solution.
x2 10
9
𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀𝑀 8
2𝑥𝑥1 + 3𝑥𝑥2 7
6 𝑥𝑥1 + x2 = 10
𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆𝑆 𝑡𝑡𝑡𝑡 5
4
𝑥𝑥1 + 4𝑥𝑥2 ≤ 8 3
2
𝑥𝑥1 + 𝑥𝑥2 ≥ 10 1
0
𝑥𝑥1 , 𝑥𝑥2 ≥ 0 0 1 2 3 4 5 6 7 8 9 10

𝑥𝑥1 + 4x2 = 8 x1
27
Recognizing special problems
• Multiple optimal solutions
»If the objective function happens to be parallel to one of the
constraints (in 2D), there is more than one optimal solution.
x2 20
18
16
14
12
10
8
6
4
2
0
0 2 4 6 8 10 12 14 16 18 20
x1 28
Recognizing special problems
• Redundant constraints
»Can be eliminated without affecting the solution. Graphically (in
2D), such constraints are outside the feasible region. Excel solver
does not recognize or signal such constraints.
x2 20
18
16
14
12
10
8
6
4
2
0
0 2 4 6 8 10 12 14 16 18 20
x1 29
Recognizing special problems
• Degeneracy
»If a basic variable (i.e., one for which the reduced costs are zero) is
equal to zero in the optimal solution, the Simplex method could
cycle between a set of solutions infinitely.
»Solver programs have means to avoid this cycling, thus degeneracy
is nothing to worry about (but to be kept in mind).

30
Solving the transportation
problem: MODI
Solving the transportation problem: MODI
• MODI
»a.k.a. “stepping stone” or “transportation simplex”
»exact method for solving the basic transportation problem
»iterative improvement method
»requires a basic feasible solution to start from (e.g., column
minimum method, north-west-corner rule, approximation method
by Vogel)

32
Basic idea: find initial solution

𝑐𝑐𝑖𝑖𝑖𝑖 1 2 3 4 𝑠𝑠𝑖𝑖 𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖

1 10 5 6 11 25
1 10 5 6 11
2 1 2 7 4 25 25
15 10
3 9 1 4 8 50
2 1 2 7 4
𝑑𝑑𝑗𝑗 15 20 30 35 100 25
10 15
Find starting solution (e.g., using northwest 3 9 1 4 8
50
corner rule). 15 35
𝑑𝑑𝑗𝑗
15 20 30 35 100

𝑍𝑍 = 15 ∗ 10 + 10 ∗ 5 + 10 ∗ 2 + 15 ∗ 7 + 15 ∗ 4 + 35 ∗ 8 = 665

33
Basic idea: transform it into optimal solution

𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖


10 5 6 11 10 5 6 11
1 25 1 25
15 10 25
1 2 7 4 1 2 7 4
2 25 2 25
10 15 15 10
9 1 4 8 9 1 4 8
3 50 3 50
15 35 20 5 25
𝑑𝑑𝑗𝑗 15 20 30 35 100 𝑑𝑑𝑗𝑗 15 20 30 35 100

𝑍𝑍 = 665 𝑍𝑍 = 445
MODI

34
Requirements for solutions
• Each solution (initial solution or intermediate/final MODI
solution) must represent a spanning tree on the original
bipartite graph
»A problem with 𝑚𝑚 suppliers and 𝑛𝑛 customers must have exactly
𝑚𝑚 + 𝑛𝑛 − 1 base variables (BVs)
»Otherwise the solution cannot be improved using MODI without
repairing it first.
»A solution can be feasible for the transportation problem itself,
although it is incompatible with MODI.

35
Requirements for solutions
• Possible Problems:
»too few BVs  parts of the graph are disconnected  add more
BVs with value 0 (where needed to make the graph connected)
»too many BVs  circles present  remove BVs by shifting
transported amounts between affected suppliers
»If two or more BVs become 0 during MODI, only ONE of them may
be removed. The others still are BVs with a value of 0!

36
Requirements for solutions

Original (complete) bipartite graph: Feasible solution: spanning tree

C1 C1
W1 W1

C2 C2
W2 W2
C3 C3
W3 W3
C4 C4

37
Correcting infeasible solutions

No spanning tree: circle present Possible solution:


(i.e., too many BVs) Shift 5 units from W2 to W1 for C1

C1 C1
W1 W1

C2 C2
W2 W2
C3 C3
W3 W3
C4 C4

38
Correcting infeasible solutions (without tree)

No spanning tree: circle present Possible solution:


(i.e., too many BVs) Shift 5 units from W2 to W1 for C1

1 2 3 4 𝒔𝒔𝒊𝒊 1 2 3 4 𝒔𝒔𝒊𝒊

1 10 15 25 1 15 10 25

2 5 5 15 25 2 10 15 25

3 15 35 50 3 15 35 50

𝒅𝒅𝒋𝒋 15 20 30 35 100 𝒅𝒅𝒋𝒋 15 20 30 35 100

39
Correcting infeasible solutions

No spanning tree: disconnected Possible solution:


(i.e., too few BVs) Add BV between W1 and C1 with value 0

C1 C1
W1 W1

C2 C2
W2 W2
C3 C3
W3 W3
C4 C4

40
Correcting infeasible solutions (without tree)

No spanning tree: disconnected Possible solution:


(i.e., too few BVs) Add BV with value 0 (several options)

1 2 3 4 𝒔𝒔𝒊𝒊 1 2 3 4 𝒔𝒔𝒊𝒊

1 20 5 25 1 0 20 5 25

2 25 25 2 25 25

3 15 35 50 3 15 35 50

𝒅𝒅𝒋𝒋 15 20 30 35 100 𝒅𝒅𝒋𝒋 15 20 30 35 100

41
MODI algorithm
• Check if initial solution meets requirements
1

• Calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑖𝑖 for all base variables (BV) so that 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 . Start with 0
2 for the dual variable in the row/column with the largest number of BVs.

• For all non-base variables (NBVs) compute coefficient 𝑐𝑐𝑖𝑖𝑖𝑖 − 𝑢𝑢𝑖𝑖 − 𝑣𝑣𝑗𝑗
3

• The NBV with the most negative coefficient enters the solution as new BV  increase its value
4 and perform chain reaction. First BV that gets a value of 0 is deleted (i.e., is now a NBV).

• Coefficients of all NBV non-negative  optimal solution found.


5

42
MODI algorithm
• Method to check validity of all values
»The primal and dual objective function value must be equal

• 𝑍𝑍 = ∑𝑚𝑚 ∑ 𝑛𝑛
𝑖𝑖=1 𝑗𝑗=1 𝑐𝑐𝑖𝑖𝑖𝑖 𝑥𝑥𝑖𝑖𝑖𝑖 = ∑ 𝑚𝑚
𝑖𝑖=1 𝑢𝑢 𝑖𝑖 𝑠𝑠𝑖𝑖 + ∑ 𝑛𝑛
𝑗𝑗=1 𝑣𝑣𝑗𝑗 𝑑𝑑𝑗𝑗

43
MODI Example
Step 1: check requirements  𝑚𝑚 + 𝑛𝑛 − 1 = 6 BVs needed 

𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖
10 5 6 11
1 25
15 10
1 2 7 4
2 25
10 15
9 1 4 8
3 50
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

44
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Find row or column with most BVs  rows 1, 2, and 3 and columns 2 and 3 all have 2 BVs
select topmost row (or if no row among candidates, leftmost column)  set value to 0
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 ?
9 1 4 8
3 50 ?
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 ? ? ? ?

45
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Use 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 to calculate other values:
𝑐𝑐11 = 𝑢𝑢1 + 𝑣𝑣1 → 10 = 0 + 𝑣𝑣1 → 𝑣𝑣1 = 10; 𝑐𝑐12 = 𝑢𝑢1 + 𝑣𝑣2 → 5 = 0 + 𝑣𝑣2 → 𝑣𝑣2 = 5
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 ?
9 1 4 8
3 50 ?
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 ? ?

46
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Use 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 to calculate other values:
𝑐𝑐22 = 𝑢𝑢2 + 𝑣𝑣2 → 2 = 𝑢𝑢2 + 5 → 𝑢𝑢2 = −3
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 -3
9 1 4 8
3 50 ?
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 ? ?

47
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Use 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 to calculate other values:
𝑐𝑐23 = 𝑢𝑢2 + 𝑣𝑣3 → 7 = −3 + 𝑣𝑣3 → 𝑣𝑣3 = 10
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 -3
9 1 4 8
3 50 ?
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 10 ?

48
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Use 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 to calculate other values:
𝑐𝑐33 = 𝑢𝑢3 + 𝑣𝑣3 → 4 = 𝑢𝑢3 + 10 → 𝑢𝑢3 = −6
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 -3
9 1 4 8
3 50 -6
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 10 ?

49
MODI Example
Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
Use 𝑐𝑐𝑖𝑖𝑖𝑖 = 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 to calculate other values:
𝑐𝑐34 = 𝑢𝑢3 + 𝑣𝑣4 → 8 = −6 + 𝑣𝑣4 → 𝑣𝑣4 = 14
𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 -3
9 1 4 8
3 50 -6
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 10 14

50
MODI Example

Step 3: calculate coefficients for all NBVs


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 -4 11 -3
1
15 10
25 0
1 -6 2 7 4 -7
2
10 15
25 -3
9 5 1 2 4 8
3 50 -6
15 35
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 10 14

𝑥𝑥24 has the most negative coefficient  becomes new BV


51
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 -4 11 -3
1
15 10
25 0
1 -6 2 7 4 -7
2
10 15 - ε +ε
25 -3
9 5 1 2 4 8
3 50 -6
15 + ε 35 - ε
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 10 14

𝑥𝑥23 has the smallest value from which ε gets subtracted  ε = 15  𝑥𝑥23 is now a NBV
52
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1 25
15 10
1 2 7 4
2 25
10 15
9 1 4 8
3 50
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗

𝑍𝑍 = 665 + 𝜖𝜖 −7 = 665 − 7 � 15 = 560


53
MODI Example

Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
15 10
25 0
1 2 7 4
2
10 15
25 -3
9 1 4 8
3 50 1
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 3 7

54
MODI Example

Step 3: calculate coefficients for all NBVs


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 3 11 4
1
15 10
25 0
1 -6 2 7 7 4
2
10 15
25 -3
9 -2 1 -5 4 8
3 50 1
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 3 7

𝑥𝑥21 has the most negative coefficient  becomes new BV


55
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 3 11 4
1
15 - ε 10 + ε
25 0
1 -6 2 7 7 4
2
+ε 10 – ε 15
25 -3
9 -2 1 -5 4 8
3 50 1
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 3 7

𝑥𝑥22 has the smallest value from which ε gets subtracted  ε = 10  𝑥𝑥22 is now a NBV
56
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1 25
5 20
1 2 7 4
2 25
10 15
9 1 4 8
3 50
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗

𝑍𝑍 = 560 + 𝜖𝜖 −6 = 560 − 6 � 10 = 500


57
MODI Example

Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
5 20
25 0
1 2 7 4
2
10 15
25 -9
9 1 4 8
3 50 -5
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 9 13

58
MODI Example

Step 3: calculate coefficients for all NBVs


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 -3 11 -2
1
5 20
25 0
1 2 6 7 7 4
2
10 15
25 -9
9 4 1 1 4 8
3 50 -5
30 20
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 9 13

𝑥𝑥13 has the most negative coefficient  becomes new BV


59
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 -3 11 -2
1
5–ε 20 +ε
25 0
1 2 6 7 7 4
2
10 + ε 15 – ε
25 -9
9 4 1 1 4 8
3 50 -5
30 - ε 20 + ε
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 10 5 9 13

𝑥𝑥11 has the smallest value from which ε gets subtracted  ε = 5  𝑥𝑥11 is now a NBV
60
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1 25
20 5
1 2 7 4
2 25
15 10
9 1 4 8
3 50
25 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗

𝑍𝑍 = 500 + 𝜖𝜖 −3 = 500 − 3 � 5 = 485


61
MODI Example

Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
20 5
25 0
1 2 7 4
2
15 10
25 -6
9 1 4 8
3 50 -2
25 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 7 5 6 10

62
MODI Example

Step 3: calculate coefficients for all NBVs


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 3 5 6 11 1
1
20 5
25 0
1 2 3 7 7 4
2
15 10
25 -6
9 4 1 -2 4 8
3 50 -2
25 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 7 5 6 10

𝑥𝑥32 has the most negative coefficient  becomes new BV


63
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 3 5 6 11 1
1
20 - ε 5 + ε
25 0
1 2 3 7 7 4
2
15 10
25 -6
9 4 1 -2 4 8
3 50 -2
+ε 25 - ε 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 7 5 6 10

𝑥𝑥12 has the smallest value from which ε gets subtracted  ε = 20  𝑥𝑥12 is now a NBV
64
MODI Example

Step 4: increase value for new BV and perform chain reaction


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1 25
25
1 2 7 4
2 25
15 10
9 1 4 8
3 50
20 5 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗

𝑍𝑍 = 485 + 𝜖𝜖 −2 = 485 − 2 � 20 = 445


65
MODI Example

Step 2: calculate dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 5 6 11
1
25
25 2
1 2 7 4
2
15 10
25 -4
9 1 4 8
3 50 0
20 5 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 5 1 4 8

66
MODI Example

Step 3: calculate coefficients for all NBVs


𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖
10 3 5 2 6 11 1
1
25
25 2
1 2 5 7 7 4
2
15 10
25 -4
9 4 1 4 8
3 50 0
20 5 25
𝑑𝑑𝑗𝑗 15 20 30 35

𝑣𝑣𝑗𝑗 5 1 4 8

no more negative coefficients  STOP optimal solution found


67
MODI Example

Optimal solution

𝑖𝑖/𝑗𝑗 1 2 3 4
10 5 6 11
1
25
1 2 7 4
2
15 10
9 1 4 8
3
20 5 25

𝑍𝑍 = 445

68
Sensitivity analysis
• From duality theory we see that
»a small change Δ on the RHS (𝑠𝑠𝑖𝑖 → 𝑠𝑠𝑖𝑖 + Δ and 𝑑𝑑𝑗𝑗 → 𝑑𝑑𝑗𝑗 + Δ) does
not change the values of the dual variables 𝑢𝑢𝑖𝑖 and 𝑣𝑣𝑗𝑗
»and changes the objective function to 𝑍𝑍 → 𝑍𝑍 + Δ 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗
»the basis variables don’t change and the solution remains optimal
• Simultaneous change
»Obviously 𝑠𝑠𝑖𝑖 and 𝑑𝑑𝑗𝑗 have to be changed simultaneously
• Maximum value for Δ
»Can be determined similar to the chain reaction

69
Sensitivity analysis

𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖 This is the optimal solution with 𝑍𝑍 = 445


10 5 6 11
1
25
25 + Δ 2
1 2 7 4
The objective function changes to
2
15 10
25 -4 𝑍𝑍 = 𝑍𝑍 + Δ 𝑢𝑢𝑖𝑖 + 𝑣𝑣𝑗𝑗 = 445 + Δ 2 + 1
9 1 4 8
3 50 0 Z = 445 + 3Δ
20 5 25
𝑑𝑑𝑗𝑗 15 20 + Δ 30 35

𝑣𝑣𝑗𝑗 5 1 4 8

How large may Δ be without changing the optimal solution?

70
Sensitivity analysis

𝑖𝑖/𝑗𝑗 1 2 3 4 𝑠𝑠𝑖𝑖 𝑢𝑢𝑖𝑖


10 5 6 11
1
25 + Δ
25 + Δ 2
1 2 7 4
𝑥𝑥33 is the first value to become 0, if Δ = +5
2
15 10
25 -4 𝑥𝑥32 is the first value to become 0, if Δ = −20
9 1 4 8
−20 ≤ Δ ≤ +5
3 50 0
20 + Δ 5 - Δ 25
𝑑𝑑𝑗𝑗 15 20 + Δ 30 35

𝑣𝑣𝑗𝑗 5 1 4 8

Check for correctness:


𝑍𝑍 = 1 � 15 + 1 20 + Δ + 6 25 + Δ + 4 5 − Δ + 4 � 10 + 8 � 25
𝑍𝑍 = 15 + 20 + Δ + 150 + 6Δ + 20 − 4Δ + 40 + 200 = 445 + 3Δ 71

You might also like