15.082 and 6.855J

11
1 15.082 and 6.855J Modified Label Correcting Algorithm

description

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}. - PowerPoint PPT Presentation

Transcript of 15.082 and 6.855J

Page 1: 15.082 and 6.855J

1

15.082 and 6.855J

Modified Label Correcting Algorithm

Page 2: 15.082 and 6.855J

2

The Modified Label Correcting Algorithm

3

Initialize

d(1) := 0; d(j) := for j 1

1

2 5

4

3 6

7

2

331

6 -2

32

-443

0

In next slides: the number inside the node will be d(j).

LIST := {1}

Page 3: 15.082 and 6.855J

3

LIST := { 1 }

An Example

3

Generic Step

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3LIST := {1}LIST := { }

6

LIST := { 2 }LIST := { 2, 3 }

3

LIST := { 2, 3, 4 }

0

Page 4: 15.082 and 6.855J

4

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3LIST := {1}LIST := { }

6

LIST := { 2 }LIST := { 2, 3 }

3

LIST := { 2, 3, 4 } 3LIST := { 3, 4 }

4

5LIST := { 3, 4, 5 }

Page 5: 15.082 and 6.855J

5

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 3, 4, 5 }

3

LIST := { 4, 5 }

Page 6: 15.082 and 6.855J

6

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 3, 4, 5 }LIST := { 4, 5 }

4

LIST := { 5 }

6

LIST := { 5, 6 }

Page 7: 15.082 and 6.855J

7

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 3, 4, 5 }LIST := { 4, 5 }LIST := { 5 }

6

LIST := { 5, 6 } 5LIST := { 6 }

Page 8: 15.082 and 6.855J

8

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 3, 4, 5 }LIST := { 4, 5 }LIST := { 5 }

6

LIST := { 5, 6 }LIST := { 6 }

6

LIST := { }

2

LIST := { 3 }

9

LIST := { 3, 7 }

Page 9: 15.082 and 6.855J

9

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 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 }

Page 10: 15.082 and 6.855J

10

An Example

3

Take a node i from LIST

0

2

331

6 -2

32

-443

Update(i): for each arc (i,j) with d(j) > d(i) + cij

replace d(j) by d(i) + cij.

3

6

3

4

5LIST := { 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 := { }

Page 11: 15.082 and 6.855J

11

An Example

3

LIST is empty.

The distance labels are optimal

0

2

331

6 -2

32

-443

3

6

3

4

5LIST := { 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