Title: Lecture 15 Minimum Cost Network Flows
1Lecture 15 Minimum Cost Network Flows
- Alg 10B On Page 527 Network Simplex
- Example Requirements At Nodes 1,2,3 5,0,-5
Node 1 has a supply of 5, Node 3 has a demand of 5
2Graphical Representation
5
0
0,1,4
1
2
flow,cost, bound
4,3,4
0,1,2
1,10,10
requirement
3
-5
Step 0. Feasible Flow 0, 0, 4, 1 with obj value
22 Bold arcs are basic.
3Basis Spanning Tree
1
2
3
Nonbasic arcs are 2 (2,3) and 3 (1,3) Flow on
nonbasics must be either 0 or bound!
4Current Solution
Flow 0
5
1
2
Flow 4
Flow 0
Flow 1
3
-5
5Step 1. Add nonbasic (2,3) to the basis tree
Cost for this direction 11-10 -8 implies an
improving direction.
6The Improving Simplex Cycle
0,1,4
1
2
flow, cost, bound
0,1,2
1,10,10
3
7Step 3. Step Size
- Flow is increasing in (1,2) max increase is
(4-0) 4 - Flow is increasing in (2,3) max increase is
(2-0) 2 - Flow is decreasing in (1,3) max decrease 1
- Step size ? min 4, 2, 1 1
8Step 4. Advance
Current obj value 111214 an improvement.
9Step 5 New Basis
10New Basis Spanning Tree
Flow 1
5
1
2
Where is the rest of the flow needed to satisfy
the demand of 5?
Flow 1
3
-5
11Nonbasic arcs have flow of 0 or bound
Flow 1
5
1
2
Satisfies flow conservation at every node
Flow 1
Flow 4
3
nonbasic
-5
12Step 1- Iteration 2 decrease flow in arc 3
Cost 11-3 -1, hence an improving direction
133. Step Size
Flow 1
1
2
Flow 1
Flow 4
3
For (1,2) max increase 4-1 3 For (2,3) max
increase 2-1 1 For (1,3) max decrease 4
? 1
14Step 4 Advance
15Step 5 New Basis
16Step 1 Simplex Direction
Flow 2
5
1
2
Where is the rest of the flow that is needed to
satisfy flow conservation at nodes 2 and 3?
Flow 3
3
-5
17Check Feasibility
Flow 2
Nonbasic arc with flow at bound
1
2
Flow 2
Flow 3
Flow conservation is satisfied.
3
Obj value cost 22913, an improvement.
18Two Possible Cycles
Flow 2
1
Flow 2
2
1
2
Flow 0
Flow 3
Flow 2
Flow 3
3
3
Cycle 1-3-1 Cost 10-37 not improving
Cycle 3-2-1-3 Cost -1-131 not improving
19Optimal Solution Obtained
20Modeling Fixed Charges Page 558
cost
0, if x 0 Cost fcx, otherwise
c
1
f
x
21Network Problem With Fixed Costs
- Consider a network model with fixed costs on some
of the arcs
Cost functions g1(x1) 0, if x10 and
105x1, otherwise g2(x2) 0, if x20 and
20x2, otherwise g3(x3) 3x3
0
5
-5
22The Cost Functions
g1(x1)
g2(x2)
5
1
1
10
1
20
x1
x2
g3(x3)
3
x3
1
0
23Model Of Fixed Charge Network Problem
- var x1 gt 0 var x2 gt 0 var x3 gt 0, lt 3
- var y1 binary var y2 binary
- subject to Node1 x1 x3 5
- subject to Node2 -x1 x2 0
- subject to Node3 -x2 -x3 -5
- subject to FCx1 x1 lt 100y1
- subject to FCx2 x2 lt 100y2
- minimize FixedCosts
- 10y1 5x1 20y2 x2 3x3
24Optimal Solution
0
Cost x1 10(2)(5) 20 x2 20(2)(1) 22
x3 (3)(3) 9 Total 51
x12
2
5
1
x22
3
x33
-5
25Chapter 11 Discrete Optimization Models
- 11.4 page 561 A knapsack model.
- An Integer Linear Program (ILP) with one
constraint. - max cx
- s. t. ax lt b
- xj binary for all j This problem can be
very hard. - How many possible solutions for a problem with
100 variables? - 2100 is about
100010 1030
26Example of a knapsack problem
- var x1 binary var x2 binary var x3 binary var
x4 binary - var x5 binary var x6 binary var x7 binary var
x8 binary - var x9 binary var x10 binary
- maximize benefit
- 8x12x24x31x44x57x62x71x85x95x10
- subject to knapsack
- 9x14x22x37x43x59x69x77x83x99x10
- lt 47
- What is 210? 1024
27Solution Obtained using AMPL and CPLEX
- Optimal Objective 36
- Include items 1,2,3,4,5,6,9,10 in the knapsack.
- Omit 7 and 8 only.
- What is the bang/buck for items 7 and 8?
- 7 2/9 8 1/7
- What about others 1 8/9 2 2/4 3 4/2 4 1/7
28Mutually Exclusive Constraints
- Select at most one from the set M
- sum j in M xj lt 1
- x1 x4 x27 x54 lt 1
- all binary var
- Select exactly one from the set M
- sum j in M xj 1
- Select at least one from the set M
- sum j in M xj gt 1
-
29Dependancies
- Example 1 Select 5 only if 3 is selected
- x5 lt x3
- Example 2 NASA Problem - If you do any of the
missions 4 thru 7, then you must do mission 3. - x4 lt x3
- x5 lt x3
- x6 lt x3
- x7 lt x3
30Dependancies Example 3
- You only have to do mission 3 if you do all
missions 4 thru 7.
x4x5x6x7 lt 3 x3
31Dependancies Example 4
- You must do mission 3 if and only if you do all
missions 4 thru 7.
x4x5x6x7 lt 3 x3 x3 lt x4 x3 lt x5 x3 lt
x6 x3 lt x7
32The End