Back

A*A Star Search

Edit the graph and the cost on each link, pick a start and a goal, then press Play. A* ranks every node by f = g + h: g is the cost of the path so far and h is the straight-line distance to the goal. It expands the node with the smallest f, so it balances "cheap so far" against "looks close to the goal". Drag nodes around to change h.

Not found yet In the queue Expanding now Expanded Path found Under a node: g = cost so far, h = distance to the goal, f = g + h. The number on a link is its cost.

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 f value when it was expanded.

Adjacency table

Every node with its links, costs, and g, h and f values. Click a row to select that node.

NodeConnected to (cost)ghfStatus

The algorithm

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