Uniform-Cost Search
A more general version of breadth-first search.
Processes states in order of increasing path cost from the start state.
The list OPEN is maintained as a priority queue. Associated with each state is its current best estimate of its distance from the start state.
As a state si from OPEN is processed, its successors are generated. The tentative distance for a successor sj of state si is computed by adding w(si, sj) to the distance for si.
If sj occurs on OPEN, the smaller of its old and new distances is retained. If sj occurs on CLOSED, and its new distance is smaller than its old distance, then it is taken off of CLOSED, put back on OPEN, but with the new, smaller distance.