0% found this document useful (0 votes)
7 views

(4b) Shortest Route Models

The document discusses shortest route models and Dijkstra's algorithm, which is used to find the shortest paths in a network. It explains the steps involved in Dijkstra's algorithm, including assigning labels to nodes and updating them based on the shortest distances. Additionally, it touches on limitations of Dijkstra's algorithm and introduces the linear programming formulation for shortest route problems.

Uploaded by

Jan Vincent Fun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

(4b) Shortest Route Models

The document discusses shortest route models and Dijkstra's algorithm, which is used to find the shortest paths in a network. It explains the steps involved in Dijkstra's algorithm, including assigning labels to nodes and updating them based on the shortest distances. Additionally, it touches on limitations of Dijkstra's algorithm and introduces the linear programming formulation for shortest route problems.

Uploaded by

Jan Vincent Fun
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

SHORTEST ROUTE

MODELS and the


DIJKSTRA’S ALGORITHM

ENGR. YOSHIKI B. KURATA, CIE, AAE, MSc.IE


Course Instructor

Reference:

Introduction to Operations Research (7th Edition)


By F. Hillier & H. Lieberman
McGraw Hill Higher Education
Shortest Route Models
 Assuming each arc in the network has a length associated with it.

 The problem of finding the shortest route from one node to any
node in the network is called the shortest route model.

 The shortest route model can also be modeled as a transshipment


model in which there is one source shipping one unit of product to
one destination demanding one unit of product.
Shortest Route Models
 The network below shows the distance (in miles) of each feasible
route between cities. Determine the shortest routes from city 1 to
each of the four cities.
Dijkstra’s Algorithm
 The Dijkstra’s algorithm was conceived by Dutch computer
scientist Edsger Dijkstra in 1959.

 It is designed to determine the shortest routes between the source


node and every other node in the network.

 Let ui be the shortest distance from source node 1 to node i, and


define dij as the length of arc (i,j). Then the algorithm defines the
label for an immediately succeeding node j as
[uj, i] = [ui + dij, i], dij ≥ 0

 Node labels in Dijkstra’s algorithm are of two types; temporary and


permanent. A temporary label is modified if a shorter route to a
node can be found. At the point when no better routes can be
found, the status of the temporary label is changed to permanent.
Dijkstra’s Algorithm
1. Assign the permanent label [ 0, -- ] to the source node.
2. Create temporary labels on all nodes that can be reached from
any permanently labeled node.
3. Change the best temporary label to permanent.
Dijkstra’s Algorithm
4. Repeat steps 2 and 3 until all nodes have permanent labels.
Dijkstra’s Algorithm
Note: If a temporary label can be created that is better than the
current temporary label written on a node, replace the current
temporary label with the better one.
Dijkstra’s Algorithm
Note: If a temporary label can be created that is better than the
current temporary label written on a node, replace the current
temporary label with the better one.
Dijkstra’s Algorithm
 The shortest route from a node to any other node in the network is
determined by starting at the desired destination node and
backtracking through the nodes using the information given by the
permanent labels.
Dijkstra’s Algorithm
 Shortest route to node 2: 1 3 4 2
 Shortest distance to node 2 is 55 miles.
Dijkstra’s Algorithm
 Shortest route to node 3: 1 3
 Shortest distance to node 3 is 30 miles.
Limitations of Dijkstra’s
Algorithm
 Although it can efficiently solve for shortest routes, the Dijkstra’s
algorithm requires a starting point to be executed.

 The more general algorithm called Floyd’s Algorithm answers this


limitation and is designed to solve for shortest route between any
two points in a network.
LP Formulation of the Shortest
Route Problems
 Assume that an item enters the network at the source node (node
1) and leaves it at the destination node (node 5) following the
optimal path.
 This item enters and exits each node in its path.
 As the item exits a node, it takes one of the paths the span out of it
going to the next node in its path.
LP Formulation of the Shortest
Route Problems
 Using this concept, we can say that the amount of flow into each
node must equal the amount of flow out it.

Amount of inflow = Amount of outflow

 Define xij = amount of flow in link (i,j)


LP Formulation of the Shortest
Route Problems
 For node 1,
– Total inflow equals 1
– Total outflow equals the sum of flows in link (1, 2) and link (1, 3).

Node 1 constraint: 1 = X12 + X13


LP Formulation of the Shortest
Route Problems
LP Formulation of the Shortest
Route Problems
 The INFLOW = OUTFLOW is a very useful concept in formulating
various network models.

 The shortest route model is a special case in that total inflow at


source and total outflow at destination equals 1. Hence, all
variables can be considered binary.

 An alternate formulation may also be constructed which leads to


the dual of this LP.
Assignment
Determine the shortest path for the following network using Dijkstra’s
algorithm.

You might also like