Network Model
Network
Applications:
• Design of an offshore natural-gas pipeline network
• Determination of the shortest route between two cities
• Determination of the maximum capacity of a pipeline network
• Project management: Preparation of time schedule
Network optimization Algorithms
• Minimal spanning tree
• Shortest-route algorithm
• Maximal-flow algorithm
• Critical Path Method (CPM) algorithm
Minimal Spanning tree
• Aim is to find the spanning tree of a network with minimum length
• Transportation design
• Power Grid design
• Telecommunication network design
• Urban planning
• Image processing…
• LP formulation is possible but cumbersome
Greedy algorithm:
Divide all Nodes into two sets:
Connected set & unconnected set
At first connected set is a null set
Choose any node and make it a part of connected set.
From the unconnected set, Select the node who has
shortest arc in the connected set ( any nodes in
connected set)
Repeat it till all nodes are in connected set
Other algorithms (Not a part of exam)
• Krushkal algorithm
• [Link]
• Prim’s algorithm
• [Link]
LP formulation (Not for exam)
Formulation example
𝑥𝑖𝑗 = binary variable that decides whether 2 nodes are
connected in the MST or not
1
No cycle is formed:
3 2 Total number of arc = total nodes-1
Each node is connected to the spanning tree:
3 2 𝑓𝑜𝑟 𝑒𝑎𝑐ℎ 𝑛𝑜𝑑𝑒 𝑖, 𝑡𝑜𝑡𝑎𝑙 𝑎𝑟𝑐𝑠 𝑜𝑟 𝑒𝑑𝑔𝑒 𝑠ℎ𝑜𝑢𝑙𝑑 𝑏𝑒 𝑚𝑜𝑟𝑒 𝑡ℎ𝑎𝑛 1
𝑥𝑖𝑗 ≥ 1
5 Imagine what will happen when the number of nodes
increase to 10? Too much possible combination, a lot
of DVs (most of which will be zero).
Find the shortest route
Rent Car is developing a replacement policy for its car fleet over a
4-year planning horizon. At the start of each year, a car is either
replaced or kept in operation for an extra year. A car must be in
service from 1 to 3 years. The following table provides the
replacement cost as a function of the year a car is acquired and the
number of years in operation.
Shortest-Route Algorithms
• Dijkstra’s algorithm: between the source node and every other
node in the network.
• Floyd’s algorithm: between any two nodes in the network.
Dijkstra’s algorithm
• Start with the Initial Node: Choose the starting node (let's call it A). Set the
distance to A as 0 and the distance to all other nodes as infinity.
• Visit the Nearest Node: Look at all the nodes directly connected to A. Calculate the
distance to each of these nodes from A. Update the distance to these nodes if the
calculated distance is less than the current known distance.
• Mark the Node as Visited: Once you have checked all the nodes connected to A,
mark A as visited. This means you have found the shortest path to A and you won't
need to revisit it.
• Move to the Next Nearest Node: Choose the unvisited node with the smallest
known distance from the starting node. Repeat steps 2 and 3 for this node.
• Repeat Until All Nodes are Visited: Continue this process until all nodes have been
visited. Each time, you will be updating the shortest known distances to each node.
• Determine the Shortest Path: Once all nodes have been visited, you will have the
shortest path from the starting node to all other nodes.
Problem
Solution Table
Solution
Floyd’s algorithm
• Start with a Distance Matrix:
• Create a matrix where the entry at (i, j) represents the shortest distance from node i to node j.
• If there is a direct edge between two nodes, fill in the edge weight; otherwise, use infinity (∞) for no direct
path. Set the diagonal (distance from a node to itself) to zero.
• Iterate Over All Nodes:
• Consider each node in turn as an intermediate node.
• For each pair of nodes (i, j), check if the path from i to j can be shortened by going through the
intermediate node.
• Update the Distance:
• If the path through the intermediate node is shorter than the current known path, update the matrix with
the shorter path.
• Repeat for All Pairs:
• Repeat this process for each intermediate node until all pairs of nodes have been considered.
• Final Distance Matrix:
• The final matrix will contain the shortest distances between all pairs of nodes.
Floyd’s triple operation
Travelling through k is better if
dik + dkj < dij
See the
word file
for solution
See the excel
Linear
programming
Formulation of
the Shortest-
Route problem
example
Can locate the shortest route between any two
nodes, simply changing the location of “1” and “–
1” in the right-hand side to correspond to the start
and end nodes, respectively.
Maximal Flow model
• The goal is to determine the maximum flow capacity of the
network.
Problem
cuts
LP
ILLUSTRATIO
N