Back

UCSUniform Cost Search

Edit the graph and the cost on each link, pick a start and a goal, then press Play. UCS always expands the cheapest unexplored route first, using a priority queue, so the first time it reaches the goal it has found the cheapest path.

Not found yet In the queue Expanding now Final cost Cheapest path The number on a link is its cost. "cost" under a node is the cheapest total found so far.
Step 0 of 0

Order of expansion

Nodes appear here in the order they leave the queue. The number beside each one is its final cost from the start.

Adjacency table

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

NodeConnected to (cost)Best costStatus

The algorithm

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