9a. Network Model Shortest Route
9a. Network Model Shortest Route
Network Models
Shortest Route
Network Models
Prepared by:
Demy F. Gabriel DEngg
flow capacity: an upper (and sometimes lower) limit on the amount of flow in an
arc in a network. For example, the maximum flow rate of water in a pipe, or the
maximum simultaneous number of calls on a telephone connection.
spanning tree: normally a tree selected from among the arcs in a graph or
source (or source node): a node which introduces flow into a network. This network so that all of the nodes in the tree are connected. See Figure 2(b).
happens at the boundary between the network under study and the external Spanning trees have interesting applications in services layout, for example,
world. finding a way to lay out the computer cable connecting all of the buildings on a
campus (nodes) by selecting from among the possible inter-building
sink (or sink node): a node which removes flow from a network. This happens connections (arcs).
at the boundary between the network under study and the external world.
All of the nodes in the network are initially “unsolved”. A node is “solved” at
each iteration when the shortest distance and route to that node is found. The
length of the shortest path from the origin to a node is the “distance”: a node is
solved when the distance is determined. By definition (and common sense), the
distance from the origin node to the origin node is zero. Arcs which may form
part of the shortest route are gradually added to the “arc set” as the method
proceeds; the arc set is initially empty. Note that the method ventures up some
blind alleys as it proceeds: not all of the arcs that are added to the arc set will
feature in the final shortest route!
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
C 15 C 15
2 J 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
6 2 0 6 2
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
2 6 2 6
B 6 G 2 B 6 G 2
3 5 5 3 5 5
3 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
Example Example
Cable Layout Network (km) Cable Layout Network (km)
C 15 C 15
3 2 J 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
0 6 2 0 6 2
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
2 6 2 6
B 6 G 2 B 6 G 2
3 5 5 3 5 5
2 3 2 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
For each arc connecting a solved and unsolved node, calculate the candidate distance:
Candidate distance = distance to the solved node + length of arc Select the node with the lowest value. This time it is node B.
Change node B to solved node and label it with the candidate distance
Example Example
Cable Layout Network (km) Cable Layout Network (km)
C 15 C 15
3 2 J 3 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
0 6 2 0 6 2
9
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
2 6 2 6
B 6 G 2 B 6 G 2
3 5 5 3 5 5
2 5 3 2 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time it is node A.
unsolved node:
Change node A to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
C 15 C 15
3 2 J 3 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
0 6 2 0 6 2
9
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
9
2 6 2 6
B 6 G 2 B 6 G 2
3 5 5 3 5 5
2 5 3 2 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time, C is selected over E.
unsolved node:
Change node E to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
8 13 8
A 3 F 4 A 3 F 4
5 1 5 1
0 3 0 3
6 9 8 2 6 2
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
9
2 6 2 6
B 6 G 2 B 6 G 2
3 5 5 3 5 5
2 5 3 2 5 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time E is selected.
unsolved node:
Change node E to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
8 13 8
A 3 F 4 A 3 F 4
5 1 5 1
0 3 0 3
6 9 8 2 6 8 2
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
9 11
2 10 G 6 2 6
B 6 2 B 6 G 2
3 5 5 3 5 5
2 5 3 2 5 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
18 Solved node Solved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time D is selected.
unsolved node:
Change node D to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
8 13 8
A 3 F 4 A 3 F 4
5 1 5 1
0 3 0 3
6 8 2 10 6 8 2 10
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
2 10 G 6 2 6
B 6 2 B 6 G 2
3 5 5 3 5 5
2 5 3 2 5 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time, F is selected over G.
unsolved node:
Change node F to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
0 6 2 15 0 6 2
8 10 8 10
S D 1 I 8 S D 1 I 8
7 11 2 T 7 2 T
2 10 G 6 2 10 G 6
B 6 2 B 6 2
3 5 5 3 5 5
2 5 3 2 5 3
K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
18 Solved node Solved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time G is selected.
unsolved node:
Change node G to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
A 8 A 8
3 F 5 4 3 F 5 4
3 1 3 1
0 6 2 15 0 6 2
8 10 8 10
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
12 12
2 10 G 6 2 10 G 6
B 6 2 B 6 2
3 5 5 3 5 5
2 5 3 2 5 3
13 K K
E 3 E 3
13 13
H Unsolved node H Unsolved node
18 Solved node Solved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time I is selected.
unsolved node:
Change node I to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
A 8 A 8
3 F 5 4 16 3 F 5 4
3 1 3 1
0 6 2 0 6 2
8 10 20 8 10
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
12 12
2 10 G 6 2 10 G 6
B 6 2 B 6 2
5 5 18 5 5
3 3
2 5 3 2 5 3
13 17 K 13 K
E 3 E 3
13 13
H Unsolved node H Unsolved node
18 Solved node Solved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time H is selected.
unsolved node:
Change node H to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
A 8 A 8
3 F 5 4 16 3 F 5 4
3 1 3 1
0 6 2 0 6 2
8 10 20 8 10
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
12 12
2 10 G 6 2 10 G 6
B 6 2 B 6 2
5 5 18 5 5
3 3
2 5 3 2 5 3
13 K 13 K
E 3 E 3
13 16 13 16
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time, K is selected over J.
unsolved node:
Change node k to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
15 20 15
C C
3 2 J 3 2 J
A 8 A 8
3 F 5 4 16 3 F 5 4 16
3 1 3 1
0 6 2 0 6 2
8 10 20 8 10
S D 1 I 8 S D 1 I 8
7 2 T 7 2 T
12 12
2 10 G 6 2 10 G 6
B 6 2 18 B 6 2
3 5 5 3 5 5
2 5 3 2 5 3
13 K 13 K
E 3 E 3
13 16 13 16
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time J is selected.
unsolved node:
Change node J to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
Example Example
Cable Layout Network (km) Cable Layout Network (km)
5 5
C 15 C 15
3 2 J 3 2 J
A 8 A 8
3 F 5 4 16 3 F 5 4 16
3 1 3 1
0 6 2 0 6 2
8 10 17 8 10 17
S D 1 I 8 S D 1 I 8
7 2 20 T 7 2 T
12 12
2 10 G 6 2 10 G 6
B 6 2 18 B 6 2
3 5 5 3 5 5
2 5 3 2 5 3
13 K 13 K
E 3 E 3
13 16 13 16
H Unsolved node H Unsolved node
Again, calculate the candidate distance for each arc connecting a solved and
Select the node with the lowest value. This time T is selected.
unsolved node:
Change node T to solved node and label it with the candidate distance
Candidate distance = distance to the solved node + length of arc
15/11/2023
Example Example
Cable Layout Network (km) Road Network in kilometers
C 15
2 J
A 8
3 F 5 4
3 1
6 2
S D 1 I 8
7 2 T
2 6
B 6 G 2
3 5 5
3
K
E 3
13
H Unsolved node
Solved node
Find the shortest route from O to T
The shortest route is S-B-E-G-I-J-T with a distance of 17 kilometers.
15/11/2023
15/11/2023
15/11/2023
15/11/2023
Problem