Академический Документы
Профессиональный Документы
Культура Документы
br
dr
........................................................................................................................................
.................
... ...........
......... ..... .............
.........
...
.......
.........
...
.........
...
.......
.........
...
...
.......
.........
.
..
.
.
.
.
.........
.
.
.......
....
...
......
.
.
.........
.
.
.
.
.
.
.
.
.
.
.......
..
..
.........
.....
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.........
.
.
.......
...
...
.....
.......
.......
..
.
................
.
.......
.........
...
.
.........
.
.......
...
.........
.........
.
.
.
.......
.
.
.
.
.....
.
.........
.
...
.......
......
.
.
.........
.
.
.
.
.
.
.
.
.
.
.......
.
.
...
.........
.......
.........
.........
.....
....
.......
.........
.........
...
....... .....
.........
.........
... .
.........
......... ....
.....................................................................................................................................................................
2...........................
a r
r
c
rz
r
e
Solution: The iterations of Dijkstras algorithm are described in the following table.
S
L(a)
L(b)
L(c)
L(d)
L(e)
L(z)
{a}
{a, b}
{a, b, c}
{a, b, c, e}
{a, b, c, e, d}
{a, b, c, e, d, z}
3
3
7
7
5
5
4
8
7
At the last iteration, z S and L(z) = 7. We conclude that the cheapest path from a to z has
a cost of 7.