recitation14

recitation14 - MIT OpenCourseWare http:/ocw.mit.edu 6.006...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
MIT OpenCourseWare http://ocw.mit.edu 6.006 Introduction to Algorithms Spring 2008 For information about citing these materials or our Terms of Use, visit: http://ocw.mit.edu/terms .
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
6.006 Recitation Build 2008.25
Background image of page 2
6.006 Proudly Presents Dijkstra: minimum-cost paths on crack Algorithm Concepts Implementation Data structures come back from the dead (not talking about the quiz)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Minimum-Path Problem Given: graph G, source vertex s, edge costs Want: paths from s to everything else with minimum costs (sum of edge costs) Approach: let d[v] be upper bounds for the real minimum costs, δ [v] Start out easy: d[v] = , d[s] = 0 Relax until values in d converge to δ
Background image of page 4
Good Dijkstra Generic initialization 4 B U = V 0 4 Choose v = argmin d[v in U], remove v from U 1 2 1 Notice d[v] = δ [v] 2 1 Relax v’s outgoing edges D 3 Rinse, repeat S A C E
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Bad Dijkstra Generic initialization U = V Choose v = argmin d[v in U], remove v from U Notice d[v] = δ [v] Relax v’s outgoing edges S A B C D -5 4 2 1 1 1 Rinse, repeat
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

recitation14 - MIT OpenCourseWare http:/ocw.mit.edu 6.006...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online