9.1
Indegree Before Dequeue# | |||||||||||
Vertex | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
s | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
A | 2 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
B | 1 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
C | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 1 | 1 | 0 | 0 |
D | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
E | 4 | 4 | 3 | 2 | 1 | 0 | 0 | 0 | 0 | 0 | 0 |
F | 2 | 2 | 2 | 2 | 2 | 2 | 2 | 1 | 0 | 0 | 0 |
G | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
H | 1 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
I | 2 | 2 | 2 | 2 | 1 | 1 | 1 | 0 | 0 | 0 | 0 |
t | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 3 | 2 | 1 | 0 |
Enqueue | s | G | D,H | H,A | A | B,E | E | I | F | C | t |
Dequeue | s | G | D | H | A | B | E | I | F | C | t |
The topological order is :
s,G,D,H,A,B,E,I,F,C,t
9.5
(a)
A->C A->B A->B->G A->B->G->E A->B->G->E->F A->B->G->E->D
(b)
B->C B->G B->E B->E->F B->C->D B->C->D->A
9.15
(a)
(b)
(1)The minumum spanning tree is not unique.
(2)Because although this algorithm tries to do the best it can in each case, there may be multiple identical cases in each case, so this result is not unique