Problem:
|
Distance matrix: A B C D E ----+--------------------- A | - 5 10 * * B | 5 - 3 11 * C | 10 3 - 2 * D | * 11 2 - 3 E | * * * 3 - |
|
Initially:
|
|
/* ------------------------ Initialization step ------------------------ */ ReachSet := {S} (S is the node that performs the computation) for ( each node n in N - {S} ) do { d(S,n) := linkcost(S,n); // Min. cost S -> n directionTo(n) := n; // Next hop towards n } |
Distance matrix To: From A B C D E ------+--------------------------------- A | * 5 10 * * B | 5 * 3 11 * C | 10 3 * 2 * D | * 11 2 * 3 E | * * * 3 * |
|
Destination | Next Hop ----------------+----------------- A | A B | - C | C D | C E | C |