Skip to content

Greedy Best First Search

Soumya Sharma edited this page Jul 24, 2020 · 2 revisions

Greedy Best-First Search

The Greedy Best-First-Search algorithm works in a similar Dijkstra, except that it has some estimate (called a heuristic) of how far from the goal any vertex is. Instead of selecting the vertex closest to the starting point, it selects the vertex closest to the goal. Greedy Best-First-Search is not guaranteed to find the shortest path. However, it runs much quicker than Dijkstra’s Algorithm because it uses the heuristic function to guide its way towards the goal very quickly. For example, if the goal is to the south of the starting position, Greedy Best-First-Search will tend to focus on paths that lead southwards.

Code file.

Clone this wiki locally