






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Leave the source vertex using the cheapest edge
Leave the current vertex using the cheapest edge to the
next vertex
Continue until destination is reached
Try Shortest 1 to 7 Path by this Greedy Algorithm
the algorithm does not guarantee the optimal solution
1
2
3
4
5
6
7
2
6
16
7
10
3
4
4
5 3
1
4
1
2
3
4
5
6 2
6
16
7
8
10
3
14
4
4
5 3
1
Lengt
h
1
0
1 3 2
1 3 5
5
1 2
6
1 3 9
5 4
1 3 1
0
6
1 3 1
1
6 7
Each path (other than first) is a one
edge extension of a previous path
Next shortest path is the shortest
one edge extension of an already
generated shortest path
Increasing
order
Greedy Single-Source All-Destinations Shortest
Path (3)
one edge extension of an already generated shortest path,
the one edge extension ends at vertex i
which the d() value is least
the shortest one edge extension to i
5
1
2
3
4
5
6
7
d
p
1
1 3
2
5
6
1
2
3
4
5
6
7
d
p
1
1 3
1 3 5
4 7
1
2
3
4
5
6
7
d
p
1
1 3
1 3 5
1 2
1 3 5 4
7
1
2
3
4
5
6
7
d
p
1 3 6
7