110 likes | 180 Views
15.082 and 6.855J. Modified Label Correcting Algorithm. The Modified Label Correcting Algorithm. . . 2. 5. 2. 3. 3. 3. 1. . . -2. 6. 1. 4. 7. 0. Initialize. 2. 3. 4. 3. d(1) := 0; d(j) := for j 1. -4. 3. 6. . . LIST := {1}.
E N D
15.082 and 6.855J Modified Label Correcting Algorithm
The Modified Label Correcting Algorithm 2 5 2 3 3 3 1 -2 6 1 4 7 0 Initialize 2 3 4 3 d(1) := 0; d(j) := for j 1 -4 3 6 LIST := {1} In next slides: the number inside the node will be d(j).
An Example 2 LIST := { 1 } LIST := { 2, 3 } LIST := { 2 } LIST := { } LIST := {1} LIST := { 2, 3, 4 } 3 3 3 3 1 -2 6 0 0 6 2 3 4 3 Generic Step -4 3 Take a node i from LIST Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 3, 4, 5 } LIST := {1} LIST := { 2 } LIST := { } LIST := { 2, 3, 4 } LIST := { 3, 4 } LIST := { 2, 3 } 3 3 3 3 3 1 -2 6 0 4 6 2 3 4 3 -4 Take a node i from LIST 3 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 4, 5 } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 6 4 2 3 4 3 -4 Take a node i from LIST 3 3 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 5 } LIST := { 4, 5 } LIST := { 5, 6 } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 4 4 6 2 3 4 3 -4 Take a node i from LIST 3 6 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 5 LIST := { 5, 6 } LIST := { 5 } LIST := { 4, 5 } LIST := { 6 } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 4 6 2 3 4 3 -4 Take a node i from LIST 3 6 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 3, 7 } LIST := { 5 } LIST := { 5, 6 } LIST := { 4, 5 } LIST := { } LIST := { 3 } LIST := { 6 } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 6 4 9 2 3 4 3 -4 Take a node i from LIST 2 3 6 6 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 7 } LIST := { 4, 5 } LIST := { 5, 6 } LIST := { 5 } LIST := { } LIST := { 3 } LIST := { 3, 7 } LIST := { 6 } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 4 6 9 2 3 4 3 -4 Take a node i from LIST 3 2 2 6 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { } LIST := { 4, 5 } LIST := { 5 } LIST := { 6 } LIST := { 5, 6 } LIST := { 3 } LIST := { 3, 7 } LIST := { 7 } LIST := { } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 6 4 9 9 2 3 4 3 -4 Take a node i from LIST 2 3 6 Update(i): for each arc (i,j) with d(j) > d(i) + cijreplace d(j) by d(i) + cij.
An Example 2 5 LIST := { 7 } LIST := { 3, 7 } LIST := { 5, 6 } LIST := { 3 } LIST := { 5 } LIST := { } LIST := { 6 } LIST := { 4, 5 } LIST := { } 3 LIST := { 3, 4, 5 } 3 3 3 1 -2 6 0 6 4 9 2 3 4 3 -4 LIST is empty. The distance labels are optimal 3 2 6 Here are the predecessors