1 / 6

Unweighted Shortest Path Neil Tang 4/1/2008

Unweighted Shortest Path Neil Tang 4/1/2008. Class Overview. The unweighted shortest path problem Breadth First Search (BFS) The algorithms Time complexity. Unweighted Shortest Path Problem.

Download Presentation

Unweighted Shortest Path Neil Tang 4/1/2008

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. Unweighted Shortest Path Neil Tang4/1/2008 CS223 Advanced Data Structures and Algorithms

  2. Class Overview • The unweighted shortest path problem • Breadth First Search (BFS) • The algorithms • Time complexity CS223 Advanced Data Structures and Algorithms

  3. Unweighted Shortest Path Problem • The unweighted shortest path problem: Given an unweighted graph G and a source vertex s, find a path from s to every other vertex in G with minimum number of edges. CS223 Advanced Data Structures and Algorithms

  4. BFS CS223 Advanced Data Structures and Algorithms

  5. An Algorithm • Time complexity: O(|V|2) CS223 Advanced Data Structures and Algorithms

  6. Time Complexity • A bad case • More efficient implementation: Use a queue • Time complexity of a queue-based implementation: O(|V|+|E|) CS223 Advanced Data Structures and Algorithms

More Related