DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 ∞ -
2 ∞ -
3 ∞ -
4 ∞ -
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [0, 3, 1, 2, 4, 5]
0
∞
∞
∞
∞
∞
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 ∞ -
2 ∞ -
3 ∞ -
4 ∞ -
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [3, 1, 2, 4, 5]
0
∞
∞
∞
∞
∞
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 ∞ -
3 1 0
4 ∞ -
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [3, 1, 2, 4, 5]
0
∞
∞
∞
∞
∞
1
1
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 ∞ -
3 1 0
4 ∞ -
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [1, 2, 4, 5]
0
∞
∞
∞
1
1
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 ∞ -
3 1 0
4 2 3
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [1, 2, 4, 5]
0
∞
∞
∞
1
1
2
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 ∞ -
3 1 0
4 2 3
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [2, 4, 5]
0
∞
∞
1
1
2
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 2 3
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [2, 4, 5]
0
∞
∞
1
1
7
2
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 2 3
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [4, 5]
0
∞
1
1
7
2
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 -13 2
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [4, 5]
0
∞
1
1
7
2
-13
8
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 -13 2
5 ∞ -
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [5]
0
1
1
7
-13
8
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 -13 2
5 -12 4
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: [5]
0
∞
1
1
7
-13
-12
DAG SPT Algorithm
Visit vertices in topological order.
# distTo edgeTo
0 0 -
1 1 0
2 7 1
3 1 0
4 -13 2
5 -12 4
1
3
2
4
5
0
s
1
1
6
1
-20
1
1
1
Fringe: []
0
1
1
7
-13
-12