What are disadvantages Uniform Cost Search Algorithm?

There can be multiple long paths with the cost ≤ C*.

Uniform Cost search must explore them all.

The Uniform Cost Search (UCS) algorithm, while effective in finding the lowest-cost path in a graph, does have some disadvantages:

  1. Space Complexity: UCS explores all possible paths to find the lowest-cost path. In scenarios where the graph is large or infinite, UCS may consume significant memory resources to store all the paths in the frontier and explored sets.
  2. Time Complexity: UCS examines every possible path incrementally, considering the cost of each step. In graphs with high branching factors or variable edge costs, the time complexity of UCS can be high, making it less efficient compared to other search algorithms like A*.
  3. Completeness with Infinite Cost: If the cost of a path in the graph is infinite, UCS may continue to explore indefinitely, resulting in an infinite loop unless proper termination conditions are implemented.
  4. Suboptimal Path Selection with Non-Unit Costs: UCS is designed to find the lowest-cost path based solely on the cumulative cost of edges traversed. However, in scenarios where the cost of each edge is not uniform or constant, UCS may not always find the optimal path.
  5. Lack of Heuristic Information: UCS does not utilize heuristic information to guide the search process, unlike A* search. In domains where heuristic information is available and useful for efficient pathfinding, UCS may not perform as well.
  6. Inability to Handle Negative Edge Costs: UCS assumes that all edge costs are non-negative. If the graph contains negative edge costs, UCS may fail to find the correct shortest path or even enter an infinite loop.

Despite these disadvantages, UCS remains a valuable algorithm, particularly in scenarios where the search space is small and the cost of paths can be accurately estimated.