Chapter 5 - Network Models
Chapter 5 - Network Models
CHAPTER 5
NETWORK
OPTIMIZATION
MODELS
ASSOC. PROF. HO THANH PHONG
OUTLINE
• Introduction
• Terminology of Networks
• Typical Problems:
• Shortest-Path Problem
• Minimum Spanning Tree Problem
• Maximum Flow Problem
• Minimum Cost Flow Problem
• Special cases
B E
• Directed path: A directed path from node i to node j is a sequence of connecting arcs whose
direction is toward node j, so that flow from node i to node j along this path is feasible.
• Undirected path :An undirected path from node i to node j is a sequence of connecting arcs whose
direction (if any) can be either toward or away from node j. (may includes directed arcs).
• Connected: Two nodes are said to be connected if the network contains at least one undirected path
between them.
• Example:
Path OT, from node O to node T can go through arcs OB - BD - DT
(O->B->D->T)
- Supply node (source node/source): the flow out of the node exceeds the flow into the node.
- Demand node (sink node/sink): the flow into the node exceeds the flow out of the node.
- Transshipment (intermediate) node: Flow in equals flow out.
2 2
4
5 6
1
0 3
3
4 1
7
4 5
2
5 6
1
−𝑥01 + 𝑥13 + 𝑥14 = 0 0 3
3
4 1 7
−𝑥02 − 𝑥32 + 𝑥25 = 0 4 5
2
−𝑥03 − 𝑥13 + 𝑥32 + 𝑥34 + 𝑥35 = 0
−𝑥14 − 𝑥34 − 𝑥54 + 𝑥46 = 0
−𝑥25 − 𝑥35 + 𝑥54 + 𝑥56 = 0
−𝑥46 − 𝑥56 = −1
𝑥𝑖𝑗 = 0 𝑜𝑟 1, ∀𝑖, 𝑗
Assoc. Professor Hồ Thanh Phong Operations Research – Deterministic Models 14
ALGORITHMS SOLVING
SHORTEST PATH PROBLEMS
• Objective of nth iteration: Find the nth nearest node to the origin (shortest
∗
distance node to the origin). Shortest distance from node 0 to node k: 𝑑0𝑘
∗
• Input for nth iteration: Shortest distance from node 0 to node j 𝑑0𝑗 and shortest
∗
distance from node j to node k 𝑑𝑗𝑘
• [Shortest distance from 0 to node k] = [Shortest distance from 0 to node j]
+ [Shortest distance jk]
• The computation will be done in forwarding way, starting from origin node 0.
• Dijkstra’s Algorithm was used in order to find the shortest path from a source node to any
other nodes in the network. It can be used for cyclic network.
• Dijkstra’s Algorithm employed a special label assignment.
Let
ui is the shortest distance from source node to node i
dij ( > 0): is the distance of arc (i, j)
Label of node j is defined as:
[uj, i] = [ ui + dij, i], dij > 0
Example:
• Find the shortest path from node 1: 15
2
4
100
20 10 50
30 60
1 5
3
[30, 1]*
Shortest path form :
Node 1 to 2: 55, 1 → 3 → 4 → 2.
Node 1 to 3: 30, 1 → 3
Node 1 to 4: 40, 1→ 3 → 4
Node 1 to 5: 90, 1 → 3 → 5 OR 1→3→ 4→5
• You are given the nodes of a networks but not the links. Instead, you are
given the potential links and the positive length for each if it is inserted
into the network.
• You wish to design the network by inserting enough links to satisfy the
requirement that there be a path between every pair of nodes.
• The objective is to satisfy this requirement in a way that minimizes the
total length of the links inserted into the network.
1. Select any node arbitrarily, and then connect it (i.e., add a link) to the nearest
distinct node.
2. Identify the unconnected node that is closest to a connected node, and then
connect these two nodes (i.e., add a link between them). Repeat this step until
all nodes have been connected.
3. Tie breaking: Ties for the nearest distinct node (step 1) or the closest
unconnected node (step 2) may be broken arbitrarily, and the algorithm must still
yield an optimal solution. However, such ties are a signal that there may be (but
need not be) multiple optimal solutions. All such optimal solutions can be
identified by pursuing breaking ties to their conclusion.
1. 2.
A A
2 7 2 7
2 2
5 T 5 T
5 4 5 4
O B D O B D
3 1 7 3 1 7
4 1 4 1
C E C E
4 4
3. 4.
A A
2 7 2 7
2 2
5 T 5 T
5 4 5 4
O B D O B D
3 1 7 3 1 7
4 1 4 1
C E C E
4 4
5. 6.
A A
2 7 2 7
2 2
5 T 5 T
5 4 5 4
O B D O B D
3 1 7 3 1 7
4 1 4 1
C E C E
4 4
7.
A
2 7
2
5 T
5 4
O B D
3 1 7
4 1
C E
4
• After some flows have been assigned to the arcs of the original
network, the residual network show remaining arc capacities (called
residual capacities) for assigning additional flows.
7 0 2 5
O B O B
Subject to: 5 1 4
7 6
1
x01 + x02 + x03 = f 0 3
5
2
-x01 + x13 + x14 = 0 4 6
4
-x02 – x32 + x25 = 0
5
2
• A cut is defined as any set of directed arcs containing at least one arc
from any directed path from the supply node to the demand nodes.
• The cut value is the sum of the arc capacities of the arcs of the cut.
Consider a directed and connected network where the n nodes include at least one
supply node and at least one demand node.
xij = flow through arc i → j.
cij = cost per unit flow through arc i → j.
uij = arc capacity for i → j.
bi = net flow generated at node i.
The value of bi depends on the nature of node i, where
bi > 0 if node i is a supply node.
bi < 0 if node i is a demand node.
bi = 0 if node i is a transshipment node.
𝑏𝑖 = 0
𝑖=1
(50) (-30)
900
1 4
400
200 300
200 3
100
300
(40) 2 5
(-60)
45
45
MATHEMATICAL MODEL
200 300
200 3
100
300
(40) 2 5
(-60)
Example 1:
TSP with n = 15,112
Example 2:
A person at node 1 wants to travel to all remaining nodes, then return to node 1. The distances
between nodes are as follows:
3
40
25
59
25
40
15
1 4
15 18
10
10 59
18
2
Find the minimum travel distance.
Mathematical model:
𝐿𝑒𝑡 𝑥𝑖𝑗 = ቊ 1 if there is travel from i to j
0 otherwise
Constraints:
x11+ x12 + x13 + x14 = 1 x12 + x21 <= 1
x13 + x31 <= 1
x21 + x22 + x23 + x24 = 1
x14 + x41 <= 1
x31 + x32 + x33 + x34 = 1 x23 + x32 <= 1
x41 + x42 + x43 + x44 = 1 x24 + x42 <= 1
x11 + x21 + x31 + x41 = 1 x34 + x43 <= 1
Solving by LINGO:
x13 = x34 = x42 = x21 = 1,
Other variables equal 0.
Z = 100
Therefore the shortest route is 80.
Travel sequence: 1 – 3 – 4 – 2 – 1