You are on page 1of 5

Handout – Shortest Path Prepared by: Dr.

Elias Choueiri
Handout – Shortest Path Prepared by: Dr. Elias Choueiri

ν a b c d e f g

a 0 4a 3a 7a ∞ ∞ ∞ Smallest is 3  c next step

c 0 4a 3a 5b 7d ∞ ∞ Smallest is 4  b next step

b 0 4a 3a 5b 7d 7d ∞ Smallest is 5  d next step

d 0 4a 3a 5b 7d 7d 9e

 Shortest path = ABDEG  4 + 1 + 2 + 2 = 9


Handout – Shortest Path Prepared by: Dr. Elias Choueiri

ν a b c d e f g

a 0 6a 3a 18a ∞ ∞ ∞ Smallest is 3  c next step

c 0 6a 3a 17b ∞ 13c ∞ Smallest is 6  b next step

b 0 6a 3a 17b 11b 13c ∞ Smallest is 11  e next step

e 0 6a 3a 17b 11b 13c 20e

 Shortest path = ABEG  6 + 5 + 9 = 20


Handout – Shortest Path Prepared by: Dr. Elias Choueiri

Example 3

Answer

Smallest is 3  b next step


Smallest is 5  c next step
Smallest is 5  d next step
Smallest is 8  f next step

 Shortest path = ACFG  5 + 3 + 1 = 9


Handout – Shortest Path Prepared by: Dr. Elias Choueiri

ν a b c d e f g h i j

a 0 4a ∞ 17a 10a ∞ ∞ ∞ ∞ ∞

Smallest is 4  b next step

b 0 4a 18b 17e 6b ∞ ∞ ∞ ∞ ∞

Smallest is 6  e next step

e 0 4a 18b 17e 6b 24e ∞ 14e 17h ∞

Smallest is 14  h next step

h 0 4a 18b 17b 6b 24e ∞ 14e 17h 24i

 Shortest path = ABEHIJ  4 + 2 + 8 + 3 + 7 = 24

You might also like