COMPSCI 61B Lecture Notes - Lecture 23: Call Stack, Ptah, Consistent Heuristic

21 views4 pages
16 Apr 2019
School
Professor

Document Summary

Correctness - do both work for all graphs. Bfs gives paths but also your paths are guaranteed to be shortest. Should be very similar as both consider all edges twice. Bfs is worse for absurdly bushy graphs. In our implementations, we have to spend (v) memory anyway to track distto and edgeto arrays. Can optimize by storing them in a map instead of an array. Neither of them are better - bfs gives shorter path. Bfs would not be a good choice for google maps as it returns path with shortest number of edges. Goal: find the shortest paths from source vertex s to some target vertex t. Observation: solution will always be a path with no cycles. Goal: find the shortest paths from source vertex s to every other vertex. Can think of as the union of the shortest paths to all vertices.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents