View on GitHub

Notes

reference notes

Outline

Introduction

State Search Representation

Example 1: Navigating a Maze

In this example, the state space representation would include all the possible positions you can be in within the maze. The actions are moving in different directions, and the goal state is reaching the exit.

State Space

Path

Path Cost

Goal Test

Classical Search Domains

Example: 8-Puzzle

Example: Traveling Salesman

Example: Search of the traveling salesperson problem, with each arc marked with the total weight of all paths from the start node to its endpoint.

Search Trees

Questions to Consider:

We’ll evaluate all the search methods using four criteria:

  1. Completeness
    • Is the strategy guaranteed to find a solution if one exists?
  2. Time Complexity
    • How long does it take to find a solution?
  3. Space Complexity
    • How much memory does it take to perform the search?
  4. Optimality
    • Does the strategy find the optimal solution when there are several solutions?

Search Methods

Types of Search Methods

Blind Search:

Heuristic Search:

Optimal Search:

Search Methods at the First Glance

Blind Search Methods

Depth-First Search (DFS)

Breadth-First Search (BFS)

DFS vs BFS

DFS

BFS

Depending on the data and the goal, either DFS or BFS could be advantageous. DFS may be more efficient in certain scenarios, while BFS ensures the closest path.

Benefits of Heuristics

Problems with Hill-Climbing

  1. Foothill Problem
    • Going up to the top of a hill and not advancing further.
    • Misses the overall maximum.
  2. Plateau Problem
    • Issues with multidimensional problem space where there is no hill to climb (flat).
    • Gradient equals zero, not informative.
  3. Ridges (Points)
    • Steep slopes with the search direction not towards the way up (but sideways).

Solution to Hill-Climbing

  1. Random Restart Hill-Climbing:
    • Randomly generates initial states.
  2. Simulated Annealing (Strengthening):
    • Allows for bad moves as well.
    • The probability of such a move decreases exponentially with its badness.

Best-First Search Algorithm:

  1. Delete FIRSTNODE from the start of QUEUE.
  2. Take children of FIRSTNODE.
  3. Append children to QUEUE.
  4. Order the result with the most promising first.
  5. Put the ordered result in NEWQUEUE.

Optimal search aims to produce the best possible answer based on some optimization function. Mathematical functions are utilized for improvements and optimization. One effective method for finding optimal paths with less work is the branch-and-bound algorithm.

Branch and Bound Algorithm

A* Search Algorithm:

  1. Delete FIRSTNODE from the start of QUEUE.
  2. Append children of FIRSTNODE.
  3. Order the resulting list according to (cost\text{-}so\text{-}far + \text{underestimate of remaining cost}).
  4. Put the result in NEWQUEUE.

The A* search algorithm continues this process until the goal is found, ensuring an optimal solution.

Example

Consider the following example:

The state with the least (f(n)) value is chosen at each step, ensuring optimality.

Summary

State Search Representation

Search Methods Properties

Algorithm Complete Space Time Optimal
Breadth-first Yes Exponential Exponential Yes
Depth-first No Linear Exponential No
A* Yes Exponential Exponential Yes
Greedy No Linear Exponential No

Iterative Deepening