Back

GBFSGreedy Best-First Search

Edit the graph, pick a start and a goal, then press Play. Each node has a heuristic h, its straight-line distance to the goal on the canvas. Greedy best-first search always expands the node that looks closest to the goal and ignores what the path has cost so far. Drag nodes around to change h.

Not found yet In the queue Expanding now Expanded Path found "h" under a node is its distance to the goal. The number on a link is its cost, which greedy search ignores.
Step 0 of 0

Order of expansion

Nodes appear here in the order they leave the queue. The small number beside each one is its h value.

Adjacency table

Every node with its links and their costs, plus its h value. It updates as you edit the graph. Click a row to select that node.

NodeConnected to (cost)hStatus

The algorithm

The highlighted lines are the ones running in the current step.