Professional Documents
Culture Documents
Paths
Shortest paths
Shortest paths
BFS
Shortest paths
3
3
A
1
E
4
Shortest paths
3
3
A
1
E
4
Dijkstras algorithm
Dijkstras algorithm
Dijkstras algorithm
Dijkstras algorithm
Dijkstras algorithm
A
1
E
4
1
1
A
1
C
4
Heap
A
B
C
D
E
1
1
A
1
C
4
Heap
B
C
D
E
1
1
A
1
C
4
Heap
B
C
D
E
1
1
A
1
C
4
Heap
C
B
D
E
1
1
A
1
C
4
Heap
C
B
D
E
1
1
A
1
C
4
Heap
C
B
D
E
3
3
1
1
A
1
C
4
1
3
Heap
C
B
D
E
3
3
1
1
A
1
C
4
1
3
Heap
B 3
D
E
3
3
1
1
A
1
C
4
Heap
B 3
D
E
3
3
1
1
A
1
C
4
Heap
B 3
D
E
3
3
1
1
A
1
C
4
Heap
B 2
D
E
2
3
1
1
A
1
C
4
Heap
B 2
D
E
2
3
1
1
A
1
C
4
Heap
B 2
E 5
D
2
3
1
1
A
1
E 5
C
4
Heap
B 2
E 5
D
2
3
1
1
A
1
E 5
C
4
Frontier?
Heap
B 2
E 5
D
2
3
1
1
A
1
E 5
C
4
Heap
E 3
D 5
2
5
3
1
1
A
1
E 3
C
4
Heap
D 5
2
5
3
1
1
A
1
E 3
C
4
Heap
5
3
1
1
A
1
E 3
C
4
Heap
1
1
A
1
E 3
Invariant:
Running time?
Running time?
1 call to MakeHeap
Running time?
|V| iterations
Running time?
|V| calls
Running time?
O(|E|) calls
Running time?
|V| ExtractMin
|E| DecreaseKey
Array
O(|V|)
O(|V|2)
O(|E|)
Bin heap
O(|V|)
Total
O(|V|2)
Running time?
|V| ExtractMin
|E| DecreaseKey
Array
O(|V|)
O(|V|2)
O(|E|)
Bin heap
O(|V|)
Total
O(|V|2)
Is this an improvement?
Running time?
|V| ExtractMin
|E| DecreaseKey
Array
O(|V|)
O(|V|2)
O(|E|)
Bin heap
O(|V|)
Total
O(|V|2)
Fib heap
O(|V|)
O(|E|)
D
5
10
-10
D
5
10
-10
D
5
10