We have discussed about Breadth First Search (BFS), Depth First Search (DFS), Dijkstra’ Search, A-star (or A*) algorithm. Let’s do a quick review and comparision of all the past 4 articles introducing Graph Traversal algorithm. This will be the last article about graph traversal.

Briefly, BFS and DFS just go through all the nodes with their own preference. One goes broadwise and the other dig deeper. Whereas Diskstra looks smarter and able to pick a smaller step for its preference. A* cheated by getting answer from user.

In a single case, which one is more efficient is all by luck…

Miao Bin

know nothing

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store