0% found this document useful (0 votes)
32 views

Search: Introduction To Artificial Intelligence COS302 Michael L. Littman Fall 2001

This document summarizes an introduction to artificial intelligence course. It discusses what AI is, different types of search problems like Rush Hour, 8-puzzle, logistics planning, and 8-queens puzzle. It introduces the basic search algorithm template and compares different search strategies like breadth-first search, depth-first search, depth-limited search, iterative deepening, and bidirectional search. Key aspects compared are completeness, time complexity, space complexity, and optimality. Homework 1 is assigned which involves analyzing variants of BFS and DFS and estimating properties of searching the Rush Hour board.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
32 views

Search: Introduction To Artificial Intelligence COS302 Michael L. Littman Fall 2001

This document summarizes an introduction to artificial intelligence course. It discusses what AI is, different types of search problems like Rush Hour, 8-puzzle, logistics planning, and 8-queens puzzle. It introduces the basic search algorithm template and compares different search strategies like breadth-first search, depth-first search, depth-limited search, iterative deepening, and bidirectional search. Key aspects compared are completeness, time complexity, space complexity, and optimality. Homework 1 is assigned which involves analyzing variants of BFS and DFS and estimating properties of searching the Rush Hour board.
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 29

Search

Introduction to Artificial Intelligence COS302 Michael L. Littman Fall 2001

Administration
Short written homeworks each week First one today Web page is up with first lecture Send me (mlittman@cs) your email address so I can make a mailing list Office hours

Whats AI? (to me)


Computers making decisions in real-world problems

apply

formulate

solve

Search Problems
Let S be the set of states (strings) Input: Initial state: s0 Neighbor generator, N: S 2S Goal function, G: S {0,1}

Search Answer
s1,,sn such that:
s1,,sn S for all 1in, si N(si-1) G(sn) = 1

Examples
Were very impressed. Meaning? Rush Hour 8-puzzle Logistics 8-queens problem Logic puzzles Job-shop scheduling

Rush Hour
Move cars forward and backward to escape

Search Version
States: configurations of cars N(s): reachable states G(s): 1 if red car at gate

8-puzzle
Slide tiles into order
States:

1 6
N(s): G(s):

2
5 8 8 3

3 7
6 1 5

4 7 4

Logistics
Very sophisticated. What goes where when?

Desert Storm logistics paid for AI research

8 Queens Puzzle
No captures States:
N(s):

G(s):

Logic Puzzles
1. Jody, who is an ape, wasnt the ape who returned immediately after Tom and immediately before the animal who appeared in the movie with no rating. 2. The only lions that were used in the movies were the one who was the third to return, the one who appeared in the R movie, and the one who appeared in Luck.

Job-Shop Scheduling
Industrial problem: Allocate machines and machinists to time slots Constraints on orders in which parts are serviced

Search Template
fringe = {(s0, 0)}; markvisited(s0); While (1) { /* initial cost */

If empty(fringe), return failure; (s, c) = removemincost(fringe); If G(s) return s; Foreach s in N(s) if unvisited(s) fringe = fringe U {(s, cost(s)}; markvisited(s0);

Data Structures
How implement this efficiently? removemincost-U-empty?

markvisited-unvisited?

Vary Cost
How does search behavior change with cost? cost(s) = c + 1

cost(s) = c - 1

Grid Example: BFS

s0

Grid Example: DFS

G G

s0 s0

How Evaluate?
What makes one search scheme better than another?
Completeness: Find solution? Time complexity: How long? Space complexity: Memory? Optimality: Find shortest path?

Depth vs. Breadth-first


Let |T(s)| b (branching factor), goal at depth d How implement priority queue? Completeness? Time complexity? Space complexity? Optimality?

BFS
Completeness?
Time complexity? Space complexity?
O(bd)
O(bd) yes Yes

Optimality?

DFS
Completeness?
Time complexity?
Yes, assuming state space finite

O(|S |), can do well if lots of goals


O(n), n deepest point of search No

Space complexity?

Optimality?

Depth-limited Search
DFS, only expand nodes depth l. Completeness?
Time complexity?
O(bl) No, if l d.

Space complexity?
O(l)

Optimality?
No

Iterative Deepening
Depth limited, increasing l. Completeness?
Time complexity? Space complexity?
O(bd), even with repeated work! O(d) Yes Yes.

Optimality?

Bidirectional Search
BFS in both directions Need N-1 How could this help?
bl vs 2bl/2

What makes this hard to implement?

Which do you choose?


8-queens, neighbors of s add one queen to board

Which do you choose?


Big grid, goal nearby

What to Learn
How to express problems in the search framework The basic algorithms for search Strengths and weaknesses of the basic algorithms

Homework 1 (due 9/26)


1. Send your email address (right away) to littman@cs. 2. Let BFS and DFS be versions of BFS and DFS that dont check whether a state has been previously visited. Evaluate BFS and DFS on the four comparison criteria we discussed. 3. Consider the Rush Hour board from these notes. Assume a single move consists of sliding a car forward or backward some number of spaces. (a) Give an upper bound on the branching factor. (b) Assuming the solution is at depth 20, how many nodes will be searched? (c) Ignoring the search, how many states are in the search space? Give as tight an upper bound as you can.

You might also like