1 / 51

Lecture 10

Lecture 10. The Label Correcting Algorithm. Label Correcting Algorithm. An Example. . . 2. 4. 2. 3. 3. 3. 1. . . -2. 6. 1. 5. 7. 0. Initialize. 2. 3. 4. 3. d(1) := 0; d(j) :=  for j  1. -4. 3. 6. . .

ajay
Télécharger la présentation

Lecture 10

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 10 The Label Correcting Algorithm

  2. Label Correcting Algorithm

  3. An Example   2 4 2 3 3 3 1   -2 6 1 5 7 0 Initialize 2 3 4 3 d(1) := 0; d(j) :=  for j  1 -4 3 6   In next slides: the number inside the node will be d(j). Violating arcs will be in thick lines.

  4. An Example 2  3  3 3 3 1 -2 6 0   Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4   Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  5. An Example 2  3  3 3 3 1 -2 6 0  6  Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4   Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  6. An Example 2  3  3 3 3 1 -2 6 0 6   Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4  3  Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  7. An Example 2  5  3 3 3 3 1 -2 6 0 6   Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 3   Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  8. An Example 2 5  3  3 3 3 1 -2 6 0  4 6  Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 3   Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  9. An Example 2 5  3  3 3 3 1 -2 6 0 6 4   Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 3   6 Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  10. An Example 2 5  3  3 3 3 1 -2 6 0 6  4  Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 3  2  6 Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  11. An Example 2 5  3  3 3 3 1 -2 6 0  6 4 9  Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 3 2   6 Pick a violating arc (i,j) and replace d(j) by d(i) + cij.

  12. An Example 2 5  3  3 3 3 1 -2 6 0 4  6  9 Generic Step 2 3 4 3 An arc (i,j) is violating if d(j) > d(i) + cij. -4 2  3 6  Pick a violating arc (i,j) and replace d(j) by d(i) + cij. No arc is violating We now show the predecessor arcs. The distance labels are optimal

  13. Modified Label Correcting Algorithm

  14. 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).

  15. 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.

  16. 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.

  17. 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.

  18. 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.

  19. 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.

  20. 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.

  21. 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.

  22. 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.

  23. 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

More Related