Uniform-cost search is a searching algorithm used for traversing a weighted tree or graph.
This algorithm returns the path connecting the start node and the goal state which has the least path cost.
As and when a goal state is reached, it stops any further traversals.
A uniform-cost search algorithm is implemented by the priority queue. It gives maximum priority to the lowest cumulative cost. Uniform cost search is equivalent to BFS algorithm if the path cost of all edges is the same.