Relaxation;
d(u) + c(u,v) < d(v)
d(v)=d(u) + c(u,v)
|
Source |
A |
B |
C |
D |
E |
F |
|
A |
0 |
∞ |
∞ |
∞ |
∞ |
∞ |
|
B |
|
2 |
4 |
∞ |
∞ |
∞ |
|
C |
|
|
3 |
6 |
4 |
∞ |
|
E |
|
|
|
6 |
4 |
∞ |
|
D |
|
|
|
6 |
|
6 |
|
F |
|
|
|
|
|
6 |
Find the shortest path from A to F using the above table : F E B A
Find the shortest path from A to E using the above table : E B A
Find the shortest path from A to C using the above table : C B A
Find the shortest path from A to D using the above table : D B A







No comments:
Post a Comment