Uniform Cost Search
Tags: #◇Computer Science #◇CSINTSY #◇Uniform Cost Search #◇Problem Solving #◇M2
◇Overview
Uniform Cost Search (UCS) is an uninformed search algorithm designed to find the optimal path in a state space with varying step costs. It addresses the issue of backtracking, where the same states might be explored multiple times leading to inefficiencies. By applying Dynamic Programming, solutions to subproblems can be cached, effectively reducing the number of states that must be explored. UCS maintains a frontier list and consistently explores the state with the lowest cumulative cost from the start state, ensuring that the first time a goal is reached, the path is optimal.
Characteristics of Uniform Cost Search:
Cannot handle negative edge costs.
Complete if the state space is finite.
Optimal for finding the shortest path (in terms of cost).
Time and Space Complexity: , where is the number of states that are closer to the start state than the goal state.
◇Important Formulas
Dynamic Programming Minimum Cost Function
◇Worked Examples
Algorithm Walkthrough
- Add to FRONTIER with priority .
- While FRONTIER is not empty:
Remove state with the lowest priority from FRONTIER.
If , then return the solution.
Add to EXPLORED.
For each action :
Get successor
If is not yet in EXPLORED:
Update in FRONTIER with priority .
Routing Problem Context
When finding a route from QC to Taguig where edge weights represent traffic, UCS explores paths by incrementally extending the frontier towards nodes with the lowest total traffic cost from QC.
◇References & Navigation
- Previous Topic: ◇State-Based Models
- Next Topic: ◇Heuristics and A-Star Search
- Related Notes: ◇Dijkstra's Algorithm (Advanced), ◇Uninformed Search
ACTIVE RECALL VERIFICATION
Select an answer to verify conceptual comprehension and reveal the technical rationale.
Which issue found in basic search algorithms does Uniform Cost Search (UCS) address by applying Dynamic Programming?
What is a key limitation of Uniform Cost Search (UCS)?
In the Dynamic Programming Minimum Cost formula for UCS, what is the value of if is a goal state ( is true)?
How does UCS determine which state to explore next from the FRONTIER?
When a new successor is generated and is not yet in the EXPLORED set, how is its priority calculated before being added to the FRONTIER?