Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Indeed, BFS, DFS, and A* are the same algorithm just with a different data structure to track unexplored nodes. BFS uses a FIFO queue, DFS uses a LIFO stack, and A* uses a priority queue (generally a heap)


A* is also importantly different for what the ordering of the priority queue is. Dijkstra's algorithm is just BFS with a priority queue, but the lack of heuristic in the comparison key keeps it clearly breadth-first.


Yeah. And A* simply generalises Dijkstra's algorithm by adding a distance heuristic to the priority expression.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: