Uninformed Search

Search Problem Definition

Real World → Search problem → Search Algorithm

We define states, actions, solutions (= selecting a state space) through abstraction.

Then we turn states into nodes for the search algorithm.

Solution

A solution is a sequence of actions leading from the initial state to a goal state.

  1. Initial state
  1. Successor function
  1. Goal test
  1. path cost (additive)

Goal testing

Tree-Search algorithm TS

Offline, simulated exploration of state space.

The frontier / open list set contains all child nodes that can be expanded.

Graph-Search algorithm GS

Same as tree search but also stores all visited nodes in an explored set / closed list of already considered states to prevent endless looping.

Can be exponentially more efficient than tree search.

Uninformed search algorithms

completeness always finds existing solutions

space complexity max number of nodes in memory

time complexity max number of nodes generated/expanded.

solution optimality always finds the least-cost solution

bb maximum branching factor of search tree

dd depth of shallowest solution

mm maximum depth (may be \infin )

\ell depth limit

Overview

under the conditions:

α\alpha- if bb is finite

β\beta- if step costs ε\geq \varepsilon for positive ε\varepsilon

γ\gamma- optimal with identical step costs

1) Breadth-first search BFS

Frontier as queue.

The space and time complexity is too high.

Here the goal test is done at generation time.

completeness yes, if bb is finite

time complexityO(bd)O(b^d)

  • in depth

    If solution is at depth dd and max branching is bb :

    ∑i=0dbi=bd+1−1b−1=bb−1⋅bd=O(bd)\sum_{i=0}^{d} b^i = \frac{b^{d+1}-1}{b-1} = \frac{b}{b-1} \cdot b^d = O(b^d)i=0∑d​bi=b−1bd+1−1​=b−1b​⋅bd=O(bd)

    Goal test at generation time: 1+b+b2+b3+...+bd=O(bd)1 + b + b^2 + b^3 + ... + b^d = O(b^d)

    Goal test at expansion time: 1+b+b2+b3+...+bd+bd+1=O(bd+1) 1 + b + b^2 + b^3 + ... + b^d + \textcolor{pink}{b^{d+1}}= O(b^{d+1}) 

space complexityO(bd)O(b^d)

solution optimality yes, if step costs ≥ 1

2) Uniform-cost search UCS

Fronier as priority queue ordered by costs.

Here the goal test is done at expansion time.

completeness Yes, if step-cost ε\geq \varepsilon and bb is finite

time complexityO(bC/ε+1)O(b^{\lfloor C^*/ \varepsilon \rfloor +1})

  • in depth

    if all step-costs ε\geq\varepsilon

    and CC^* is the cost of the optimal solution

    then d=Cε+1 d = {\lfloor \frac{ C^* }{ \varepsilon}\rfloor +1}  and therefore O(bC/ε+1)O(b^{\lfloor C^*/ \varepsilon \rfloor +1})

    if goal-tested at expansion, not generation - therefore bd+1b^{d+1} .

space complexityO(bC/ε+1)O(b^{\lfloor C^*/ \varepsilon \rfloor +1})

solution optimality Yes, if goal-tested at expansion.

3) Depth-first search DFS

Fronier as stack.

Much faster than BFS if solutions are dense.

Backtracking variant: store one successor node at a time - generate child node with Δ\Delta change.

completeness No - only complete with explored-set (graph search) and in finite spaces.

time complexityO(bm)O(b^m) - Terrible results if mdm \geq d .

space complexityO(bm)O(bm)

solution optimality No

4) Depth-limited search DLS

DFS limited with \ell - returns a cutoff\text{cutoff} subtree/subgraph.

completeness No - May not terminate (even for finite search space)

time complexityO(b)O(b^\ell)

space complexityO(b)O(b\ell )

solution optimality No

5) Iterative deepening search IDS

Iteratively increasing \ell in DLS to gain completeness.

completeness Yes

time complexityO(bd)O(b^d)

  • in depth

    Only bb1\frac{b}{b-1} times more inefficient than BFS therefore O(bd)O(b^d)

    IDS(d)=∑i=0dDFS(i)=∑i=0d(∑j=0ibj)=∑i=0dbd+1−1b−1⩽∑i=0dbd+1b−1=bb−1⋅∑i=0dbi=bb−1⋅bd+1−1b−1=bb−1⋅(bb−1⋅bd)=O(bd)IDS(d) = \sum_{i=0}^{d} DFS(i)=\sum_{i=0}^{d} \big( \sum_{j=0}^{i} b^j \big) = \\\sum_{i=0}^{d} \frac{b^{d+1}-1}{b-1} \leqslant \sum_{i=0}^{d} \frac{b^{d+1}}{b-1} = \frac{b}{b-1} \cdot \sum_{i=0}^{d} b^i = \frac{b}{b-1} \cdot \frac{b^{d+1}-1}{b-1} = \\ \frac{b}{b-1} \cdot (\frac{b}{b-1} \cdot b^d) = O(b^d)IDS(d)=i=0∑d​DFS(i)=i=0∑d​(j=0∑i​bj)=i=0∑d​b−1bd+1−1​⩽i=0∑d​b−1bd+1​=b−1b​⋅i=0∑d​bi=b−1b​⋅b−1bd+1−1​=b−1b​⋅(b−1b​⋅bd)=O(bd)

space complexityO(bd)O(bd)

  • in depth

    The total number of nodes generated in the worst case is:

    (d)b+(d1)b+...+(1)b=O(db)(d)b +(d-1)b+...+(1)b=O(db)

    Most of the nodes are in the bottom level, so it does not matter much that the upper levels are generated multiple times. In IDS, the nodes on the bottom level (depth dd ) are generated once, those on the next-to-bottom level are generated twice, and so on, up to the children of the root, which are generated dd times.

    Therefore asymptotically the same as DFS.

solution optimality Yes, if step cost ≥ 1

In general IDS is very attractive and prefered when the search space is large and the depth of the solution is unknown.

It is usually only a little more expensive than BFS.