Uniform-cost Search

In computer science, uniform-cost search (UCS) is a tree search algorithm used for traversing or searching a weighted tree, tree structure, or graph. The search begins at the root node. The search continues by visiting the next node which has the least total cost from the root. Nodes are visited in this manner until a goal state is reached.

Typically, the search algorithm involves expanding nodes by adding all unexpanded neighboring nodes that are connected by directed paths to a priority queue. In the queue, each node is associated with its total path cost from the root, where the least-cost paths are given highest priority. The node at the head of the queue is subsequently expanded, adding the next set of connected nodes with the total path cost from the root to the respective node. The uniform-cost search is complete and optimal if the cost of each step exceeds some positive bound ε. The worst-case time and space complexity is O(b1 + C*/ε), where C* is the cost of the optimal solution. When all step costs are equal, this becomes O(bd + 1).

Read more about Uniform-cost Search:  Pseudocode, Example, Relationship To Other Algorithms

Famous quotes containing the word search:

    So often has my judgment deceived me in my life, that I always suspect it, right or wrong,—at least I am seldom hot upon cold subjects. For all this, I reverence truth as much as any body; and ... if a man will but take me by the hand, and go quietly and search for it ... I’ll go to the world’s end with him:MBut I hate disputes.
    Laurence Sterne (1713–1768)