PROJECTENGRAM

UNIFORM COST SEARCH

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: O(nlog⁡n)O(n \log n), where nn is the number of states that are closer to the start state than the goal state.

◇Important Formulas

Dynamic Programming Minimum Cost Function
MinCost(s)={0if IsEnd(s)min⁡a∈Actions(s)(Cost(s,a)+MinCost(Succ(s,a)))otherwise\text{MinCost}(s) = \begin{cases} 0 & \text{if IsEnd}(s) \\ \min_{a \in \text{Actions}(s)} \left( \text{Cost}(s, a) + \text{MinCost}(\text{Succ}(s, a)) \right) & \text{otherwise} \end{cases}

◇Worked Examples

Algorithm Walkthrough

  1. Add sstarts_{start} to FRONTIER with priority 00.
  2. While FRONTIER is not empty:
    Remove state ss with the lowest priority pp from FRONTIER.
    If IsEnd(s)\text{IsEnd}(s), then return the solution.
    Add ss to EXPLORED.
    For each action a∈Actions(s)a \in \text{Actions}(s):
    Get successor s′=Succ(s,a)s' = \text{Succ}(s, a)
    If s′s' is not yet in EXPLORED:
    Update s′s' in FRONTIER with priority p+Cost(s,a)p + \text{Cost}(s, a).

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

CONFIRMATION // 理解度の確認

ACTIVE RECALL VERIFICATION

Select an answer to verify conceptual comprehension and reveal the technical rationale.

Q1

Which issue found in basic search algorithms does Uniform Cost Search (UCS) address by applying Dynamic Programming?

Q2

What is a key limitation of Uniform Cost Search (UCS)?

Q3

In the Dynamic Programming Minimum Cost formula for UCS, what is the value of MinCost(s)\text{MinCost}(s) if ss is a goal state (IsEnd(s)\text{IsEnd}(s) is true)?

Q4

How does UCS determine which state to explore next from the FRONTIER?

Q5

When a new successor s′s' is generated and is not yet in the EXPLORED set, how is its priority calculated before being added to the FRONTIER?