Professional Documents
Culture Documents
Mathematical programming:
Flow problems
Week 1, chapter 3
2020-2021
09/09/2023 1
A simple network flow problem
Transport some good (cars, water,electricity, money)
from 1 to 4 at minimum cost.
€20
2 €50
supply demand
1 €10 4
100 100
€40 €20
3
2
A simple network flow problem
Transport some good (cars, water,electricity, money)
from 1 to 4 at minimum cost, such that the capacity
of the arcs is not exceeded.
€20
2 €50
70 50 demand
supply
1 60 €10 4
100 100
40 70
€40 €20
3
3
Network Flow Model
• A set of nodes,
• A set of arcs or connections, having a direction from tail node to
head node, used to transport flow (amount of a good),
• A weight or cost to transport one unit of flow from tail to head,
• A capacity of each arc (acts as upper bound on the flow),
Arc
Tail node Head node
flow
i unit cost: €30
j
capacity: 60
4
Network flow: variables
€20
2 €50
70 50 demand
supply
1 60 €10 4
100 100
40 70
€40 €20
3
5
Network flow: objective
€20
2 €50
70 50 demand
supply
1 60 €10 4
100 100
40 70
€40 €20
3
6
Network flow: constraints (1)
€20
2 €50
70 50 demand
supply
1 60 €10 4
100 100
40 70
€40 €20
3
7
Network flow: constraints (2)
€20
2 €50
70 50 demand
supply
1 60 €10 4
100 100
40 70
€40 €20
3
Balance constraints:
supply demand
inflow outflow
3
Inflow + Supply = Outflow + Demand
Inflow – Outflow = Demand – Supply
Node 1:
Node 2:
Node 3:
Node 4:
10
Flow balance
2
supply demand
1 4 100
100
3
Supply node: node where flow (the supply) enters the network
Demand node: node where flow (the demand) leaves the network.
Transshipment node: node without demand or supply.
Constraints
Final Shadow Constraint Allowable Allowable
Cell Name Value Price R.H. Side Increase Decrease
$G$11 Flow balance node 1 -100 0 -100 1E+30 0
$G$12 Flow balance node 2 0 30 0 0 20
$G$13 Flow balance node 3 0 40 0 0 30
$G$14 Flow balance node 4 100 80 100 0 20
$G$6 Capacity arc (1,2) 70 -10 70 20 10
$G$7 Capacity arc (1,3) 30 0 40 1E+30 10
$G$8 Capacity arc (2,3) 40 0 60 1E+30 20
$G$9 Capacity arc (2,4) 30 0 50 1E+30 20
$G$10 Capacity arc (3,4) 70 -20 70 20 20
13
Network Flow Model
1. Variables: Flows on arcs variable
3. Constraints:
a. Capacity constraints, . One for each arc.
b. Flow balance constraints !!!!!
Inflow + Supply = Outflow + Demand
One for each node.
14
Case Car Transportation
Transport cars from stations with an excess to stations with a shortage
(we already made the decision of how many cars should be
transported to each of the stations with a shortage.
demand 30 -100
Boston Newark
50 2 1 supply
60 Col.
3 40 40
80
35 Atlanta 30 Richm. demand
5 4
35
demand
25 45 50
Mobile
70 6 50
J.ville
-110
7
supply
15
Complete model
min 30 X 12 40 X 14 50 X 23 35 X 35 40 X 53 40 X 54 35 X 56 25 X 65 50 X 74 45 X 75 50 X 76
X 12 X 14 100
X 12 X 23 0
X 23 X 35 X 53 60
X 14 X 54 X 74 80 ,
X 35 X 53 X 54 X 56 X 65 X 75 0
X 56 X 65 X 76 70
X 74 X 75 X 76 110
X 12 , X 14 , X 23 , X 35 , X 53 , X 54 , X 56 , X 65 , X 74 , X 75 , X 76 0
16
Complete model
min 30 X 12 40 X 14 50 X 23 35 X 35 40 X 53 40 X 54 35 X 56 25 X 65 50 X 74 45 X 75 50 X 76
X 12 X 14 100
X 12 X 23 0
X 23 X 35 X 53 60
X 14 X 54 X 74 80 ,
X 35 X 53 X 54 X 56 X 65 X 75 0
X 56 X 65 X 76 70
X 74 X 75 X 76 110
X 12 , X 14 , X 23 , X 35 , X 53 , X 54 , X 56 , X 65 , X 74 , X 75 , X 76 0
18
Supply and demand
If total supply exceeds total demand, then not all supply
needs to be used to satisfy demand. Therefore, the balance
constraints for the supply nodes become:
In fact, we can do this for ALL nodes. So not only for the
supply nodes.
19
Supply and demand
If total demand exceeds total supply, then not all demand
can be satisfied. Therefore, the balance constraints for the
demand nodes become:
In fact, we can do this for ALL nodes. So not only for the
demand nodes.
20
Special case: Travel Time
Find the shortest route from Birmingham 1 to Virginia
Beach 11: travel times in hours.
21
Special case: Travel Time
Find the shortest route from Birmingham to Virginia Beach:
travel times in hours.
Finish 11:
Start 1: K’ville 5.0 L’burg
1.7 1 unit
1 unit 5 9
demand
supply Chatt. 4.7 3.3
2.8 3
2.8
B’ham A’ville 3.0 G’boro Va Bch
1 1.7 6 8 11
23
Excel sheet Travel Time
24
Flow models
• In space:
– Transportation (min cost flow)
– Shortest path (min cost flow of one unit)
– Max flow (capacities on the arcs)
• In time:
– Inventory management models
– Financial models
25
Case Inventory management
• A company has an order for 39 microwave ovens,
– 7 have to be delivered in week one,
– 9 in week two,
– 12 in week three, and
– 11 in week four.
• Production cost: Euro 10,000 per microwave oven in
week 1, increases with Euro 100 per week.
• Production capacity: 10 microwave ovens per week.
• Capacity can be increased (by working overtime) to 12 in
weeks 3 and 4, at an additional cost of Euro 1,200 per
microwave oven.
• Inventory cost: Euro 550 per microwave oven per week.
=7 =9 =12 =11
27
Case Inventory management
• Decision Variables
– Regular production (supply) in periods 1 to 4: R1,
R2, R3, and R4 non-negative integers.
– Overtime production (supply) in periods 3 and 4: O3
and O4.
– Inventory between periods 1 and 2, 2 and 3, and 3 and 4:
I12, I23, and I34
• Objective
– 10,000*R1 + 10,100*R2 + 10,200*R3 + 10,300*R4 +
11,200*O3 + 11,300*O4 + 550*I12 + 550*I23 + 550*I34
28
Case Inventory management
• Constraints
– Regular capacity: R1, R2, R3, R4 ≤ 10
– Overtime capacity: O3, O4 ≤ 2
– Balance: supply + inflow = demand + outflow
R1 = 7 + I12
R2 + I12 = 9 + I23
R3 + O3 + I23 = 12 + I34
R4 + O4 + I34 = 11
Case Inventory
Regular Overtime Inventory
1 2 3 4 3 4 1 2 3
Variables 8 10 10 10 0 1 1 2 0
Objective 10000 10100 10200 10300 11200 11300 550 550 550 398950
Constraints Coefficients LHS Operator RHS
Constraint 1 1 -1 7 = 7
Constraint 2 1 1 -1 9 = 9
Constraint 3 1 1 1 -1 12 = 12
Constraint 4 1 1 1 11 = 11
Constraint 5 1 8 <= 10
Constraint 6 1 10 <= 10
Constraint 7 1 10 <= 10
Constraint 8 1 10 <= 10
Constraint 9 1 0 <= 2
Constraint 10 1 1 <= 2
30