Shortest Path Algorithms By Nick Bielik Aaron Staranowicz
Shortest Path Algorithms By: Nick Bielik Aaron Staranowicz Mike Knadle
Content • • Objective Node Expansion A* Uniform Cost Dijkstra’s Bi-directional Dijkstra’s Demo
Objective • Uniform Cost Search (UCS) vs Dijkstra’s • A* vs Dijkstra’s vs Bi-directional Dijkstra’s – Differences between each – Node expansion
Node Expansion Diagram A* Most Efficient Bi-directional Dijkstra’s UCS Dijkstra’s Least Efficient
Node Expansions • Start Node: Luebeck • Goal Node: Munich • Node Expansions: – A* - 21 – Dijkstra’s – 244 – Bidirectional Dijkstra’s – 16 – UCS - 19
A* • Finds the shortest path from 1 start node to 1 goal node • Uses a distance-plus-cost heuristic function • The heuristic function includes 2 parts: – the path-cost function, which is the cost from the starting node to the current node – and an admissible "heuristic estimate" of the distance to the goal
A* • Admissible "heuristic estimate“ – considers fewer nodes – Estimate must less than or equal to total cost in all cases
Uniform Cost Search • Begins at a root node and will continually expand nodes, taking the node with the smallest total cost from the root until it reaches the goal state. • Special Case of A* if the heuristic is a constant function • Similar to Dijkstra’s
Dijkstra’s • Same as Uniform Cost Search but instead of stopping at the goal node, it continues until all nodes are covered
Bi-directional Dijkstra’s • Same as Dijkstra’s but with the search algorithm starting from both sides – Idea: • If Dijkstra’s is given 1 start node and 1 goal node, then another Dijkstra’s is given the inverse then the 2 should reach the middle node at the same time
Questions?
- Slides: 11