09.07.2015 Views

slides - Computer Science - University of San Francisco

slides - Computer Science - University of San Francisco

slides - Computer Science - University of San Francisco

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

17-54: Improving DijkstraTo improve the running time <strong>of</strong> Dijkstra:Place all <strong>of</strong> the vertices on a min-heapKey value for min-heap = distance <strong>of</strong> vertexfrom initialWhile min-heap is not empty:Pop smallest value <strong>of</strong>f min-heapUpdate tableProblems with this method?When we update the table, we need torearrange the heap

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!