a

b

c

d

e

f

g

z

a

---

2

 

 

 

1

 

 

b

2

---

2

2

4

 

 

 

c

 

2

---

 

3

 

 

1

d

 

2

 

---

4

3

 

 

e

 

4

3

4

---

 

7

 

f

1

 

 

3

 

---

5

 

g

 

 

 

 

7

5

---

6

z

 

 

1

 

 

 

6

---

 

 

The Adjecency matrix of the given graph

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

        S     

Vertex Selected

Distance to Vertex :

A     b     c     d     e      f     g    z

0

a

a

0 2 ¥ ¥ ¥ 1 ¥ ¥

1

a f

f

0 2 ¥ 4 ¥ 1 6 ¥

2

A f b

b

0 2 4 4 6 1 6 ¥

3

A f b c

c

0 2 4 4 6 1 6 5

4

A f b c d

d

0 2 4 4 6 1 6 5

5

A f b c d z

z

0 2 4 4 6 1 6 5

6

A f b c d z e

e

0 2 4 4 6 1 6 5

7

A f b c d z e g

g

0 2 4 4 6 1 6 5