Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Shortest-path model:
In transport organizations, one the objective is to find the shortest path to a particular
node from any of the other nodes in a road network for shipping cargo. Determination of
the shortest path using specialized procedures is known as shortest-path model.
The following methods are popularly used to find the shortest-path in a distance network:
A. Systematic method
B. Dijkstra’s algorithm
C. Floyd’s algorithm
Algorithm for Systematic method
A. Systematic Method
Example: 1
Consider the road network as shown in Figure below, where distance between different
pairs of adjacent cities are summarized in Table 1. Find the shortest path from City 1 to
City 10.
Distance Network
Table 2 Details of selection of Node in each iterations
3 1,2 3 ,5 0 + 7 = 7*
6 + 8 = 14
4 1,2,3 4,5, 7 0 + 10 = 10*
6 + 8 = 14
7 + 3 = 10*
5 1,2,3,7 4 ,5,4,6 0 + 10 = 10*
6 + 8 = 14
7 + 4 =11
10 + 5 = 15
6 X X 5, 5 ,6 6 + 8 = 14
1, 2,3,7, 4 7 + 6 = 13*
10 + 5 = 15
7 X 6, 6 ,8 7 + 11 = 18
2, 3,7,5 10 + 5 = 15*
13 + 9 =22
8 X 9,8, 10 10 + 10 =20
3 ,7,5,6 13 + 9 =22
15 + 3 = 18*
Shortest path indicated using Red line
B. Dijkstra’s Algorithm
Replacing cell
Lowest dist.
Lowest dist.
Lowest dist.
Lowest dist.
Lowest dist.
Lowest dist.
Lowest dist.
Final solution
The objective of the minimum spanning tree problem is to connect the nodes of the
network by a set of arcs such that the total length of all the arcs are minimized.
Laying telephone cable, television cable, etc., are the examples of minimum
spanning tree problem.
There are two algorithms for the minimum spanning tree problem is presented:
a). PRIM algorithm
b). Kruskal’s algorithm
1.Consider the details of a distance network as shown below:
1 2 3 4 5 6 7 8 9 10
1 - 4 ∞ 2 3 ∞ ∞ ∞ ∞ ∞
2 4 - 6 6 ∞ ∞ ∞ ∞ ∞ ∞
3 ∞ 6 - 5 ∞ 9 ∞ ∞ ∞ ∞
4 2 6 5 - 4 8 10 ∞ ∞ ∞
5 3 ∞ ∞ 4 - ∞ 5 7 ∞ ∞
6 ∞ ∞ 9 8 ∞ - 3 ∞ ∞ 6
7 ∞ ∞ ∞ 10 5 3 - 1 3 ∞
8 ∞ ∞ ∞ ∞ 7 ∞ 1 - 2 ∞
9 ∞ ∞ ∞ ∞ ∞ ∞ 3 2 - 5
10 ∞ ∞ ∞ ∞ ∞ 6 ∞ ∞ 5 -
1 2 3 4 5 6 7 8 9 10
1 - 4 ∞ 2 3 ∞ ∞ ∞ ∞ ∞
2 4 - 6 6 ∞ ∞ ∞ ∞ ∞ ∞
3 ∞ 6 - 5 ∞ 9 ∞ ∞ ∞ ∞
4 2 6 5 - 4 8 10 ∞ ∞ ∞
5 3 ∞ ∞ 4 - ∞ 5 7 ∞ ∞
6 ∞ ∞ 9 8 ∞ - 3 ∞ ∞ 6
7 ∞ ∞ ∞ 10 5 3 - 1 3 ∞
8 ∞ ∞ ∞ ∞ 7 ∞ 1 - 2 ∞
9 ∞ ∞ ∞ ∞ ∞ ∞ 3 2 - 5
10 ∞ ∞ ∞ ∞ ∞ 6 ∞ ∞ 5 -
1 2 3 4 5 6 7 8 9 10
1 - 4 ∞ 2 3 ∞ ∞ ∞ ∞ ∞
2 4 - 6 6 ∞ ∞ ∞ ∞ ∞ ∞
3 ∞ 6 - 5 ∞ 9 ∞ ∞ ∞ ∞
4 2 6 5 - 4 8 10 ∞ ∞ ∞
5 3 ∞ ∞ 4 - ∞ 5 7 ∞ ∞
6 ∞ ∞ 9 8 ∞ - 3 ∞ ∞ 6
7 ∞ ∞ ∞ 10 5 3 - 1 3 ∞
8 ∞ ∞ ∞ ∞ 7 ∞ 1 - 2 ∞
9 ∞ ∞ ∞ ∞ ∞ ∞ 3 2 - 5
10 ∞ ∞ ∞ ∞ ∞ 6 ∞ ∞ 5 -