Download presentation
Presentation is loading. Please wait.
Published byDonald Kelley Modified over 9 years ago
1
15.082 & 6.855J & ESD.78J Algorithm visualizations Modified Label Correcting Algorithm
2
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 2 The Modified Label Correcting Algorithm 3 Initialize d(1) := 0; d(j) := for j 1 1 2 5 4 36 7 2 3 3 1 6 -2 3 2 -4 43 0 In next slides: the number inside the node will be d(j). LIST := {1} FIFO Version
3
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 3 LIST := { 1 } An Example 3 Generic Step Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 LIST := {1}LIST := { } 6 LIST := { 2 }LIST := { 2, 3 } 3 LIST := { 2, 3, 4 } 0
4
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 4 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 LIST := {1}LIST := { } 6 LIST := { 2 }LIST := { 2, 3 } 3 LIST := { 2, 3, 4 } 3 LIST := { 3, 4 } 4 5 LIST := { 3, 4, 5 }
5
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 5 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } 3 LIST := { 4, 5 }
6
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 6 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 } 4 LIST := { 5 } 6 LIST := { 5, 6 }
7
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 7 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 }LIST := { 5 } 6 LIST := { 5, 6 } 5 LIST := { 6 }
8
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 8 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 }LIST := { 5 } 6 LIST := { 5, 6 }LIST := { 6 } 6 LIST := { } 2 LIST := { 3 } 9 LIST := { 3, 7 }
9
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 9 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 }LIST := { 5 } 6 LIST := { 5, 6 }LIST := { 6 }LIST := { } 2 LIST := { 3 } 9 LIST := { 3, 7 } 2 LIST := { 7 }
10
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 10 An Example 3 Take a node i from LIST 0 2 3 3 1 6 -2 3 2 -4 43 Update(i): for each arc (i,j) with d(j) > d(i) + c ij replace d(j) by d(i) + c ij. 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 }LIST := { 5 } 6 LIST := { 5, 6 }LIST := { 6 }LIST := { } 2 LIST := { 3 } 9 LIST := { 3, 7 }LIST := { 7 } 9 LIST := { }
11
3 1 2 5 4 36 7 3 3 1 6 -2 3 2 -4 43 0 2 11 An Example 3 LIST is empty. The distance labels are optimal 0 2 3 3 1 6 -2 3 2 -4 43 3 6 3 4 5 LIST := { 3, 4, 5 } LIST := { 4, 5 }LIST := { 5 } 6 LIST := { 5, 6 }LIST := { 6 }LIST := { } 2 LIST := { 3 } 9 LIST := { 3, 7 }LIST := { 7 }LIST := { } Here are the predecessors
12
MITOpenCourseWare http://ocw.mit.edu 15.082J / 6.855J / ESD.78J Network Optimization Fall 2010 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms.http://ocw.mit.edu/terms
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.