Download Artificial Intelligence Lecture 3: Problem Solving by Searching - CS613 and more Slides Introduction to Computing in PDF only on Docsity!
CS613 INTRODUCTION TO
ARTIFICIAL INTELLIGENCE
Lecture 3 b
Problem Solving by Searching
Today’s Class
Introduction to Problem solving and Search Strategies
- Problem solving agents, and examples
- Problem Statement, Selecting a state space
- Introduction to Search
- Defining a Search Problem and Some
Examples
- The most popular classical problem domains
- Knowledge, Problem Types
- Problem Statement, Examples and Real World
Problems
Finding the shortest path from Arad to Bucharest
Problem Statement
How do I get from initial state to goal?
Use a search algorithm.
From initial state, apply actions to the current state to generate new states ( expand).
find all adjacent cities in the shortest path Puzzle
Choose one of the adjacent states, and expand the state from there.
Continue until you find solution.
Search strategy : Which states do you expand first?
Defining a Search Problem
State Space : described by an initial space
and the set of possible actions available ( operators ).
A path is any sequence of actions that lead
from one state to another.
Goal test : applicable to a single state
problem to determine if it is the goal state.
Path cost : relevant if more than one path
leads to the goal, and we want the shortest path with minimum cost.
Selecting a state space
In general, real world is complex, so we would like to
determine an abstract state space as an alternative.
Abstract state is equivalent to the real states
Abstract solutions should map to real solutions.
Abstract actions easier than the real one. (This is a
must not an optional).
Example: Tourist in Romania
- On holiday in Romanian; currently in Arad , Flight
leaves tomorrow from Bucharest
- Formulate Goal:
- Formulate Problem:
- states: various cities
- operators: drive between cities
- Find Solution:
- sequence of cities, e.g. Arad, Sibiu, Fagaras,
Bucharest
Finding the shortest path from Arad to Bucharest
The Most Popular Classical Problem Domains
- toy problems
- vacuum world
- 8-puzzle
- 8-queens
- cryptarithmetic
- vacuum agent
- missionaries and cannibals - real-world problems - route finding - touring problems - traveling salesperson - VLSI layout - robot navigation - assembly sequencing - Web search
Example: Vacuum World Domain as an illustration
- Let the world be consist of only 2 locations - Left and Right Box
- Each location may contain dirt
- The agent may be in either box
- There are 8 possible states
- The agent can have 3 possible actions - Left, Right and Suck (^) The 8 possible states of a Vacuum World
More Complex Vacuum Agent
- states
- configuration of the room
- dimensions, obstacles, dirtiness
- initial state
- successor function (operators)
- goal test
- path cost
Properties: discrete locations, discrete dirt, deterministic, d * 2n^ states for dirt degree d , n locations
8-Puzzle
- states
- location of tiles (including blank tile)
- initial state
- any legitimate configuration
- successor function (operators)
- move tile
- alternatively: move blank
- goal test
- any legitimate configuration of tiles
- path cost
Properties: abstraction leads to discrete configurations, discrete moves, deterministic 9!/2 = 181,440 reachable states
8-Queens
- incremental formulation
- states
- arrangement of up to 8 queens on the board
- initial state
- successor function (operators) - add a queen to any square
- goal test
- all queens on board
- no queen attacked
- path cost
- irrelevant (all solutions equally valid)
- Properties: 3*10^14 possible sequences; can be reduced to 2, - complete-state formulation - states - arrangement of 8 queens on the board - initial state - all 8 queens on board - successor function (operators) - move a queen to a different square - goal test - no queen attacked - path cost - irrelevant (all solutions equally valid) - Properties: good strategies can reduce the number of possible sequences considerably
8-Queens Refined
- simple solutions may lead to very high search costs
- 64 fields, 8 queens ==> 64^8 possible sequences
- more refined solutions trim the search space, but
may introduce other constraints
- place queens on “unattacked” places
- much more efficient
- may not lead to a solutions depending on the initial moves
- move an attacked queen to another square in the
same column, if possible to an “unattacked” square