You are on page 1of 19

Lecture 2

Problem Solving in Artificial


Intelligence
Problem solving
We want:
◦ To automatically solve a problem

We need:
◦ A representation of the problem

◦ Algorithms that use strategy to solve the


problem defined in that representation
Example 1: 8 Puzzle Problem
The 8 puzzle consists of eight numbered,
movable tiles set in a 3x3 frame. One cell of
the frame is always empty thus making it
possible to move an adjacent numbered tile
into the empty cell.
Example 1: 8 Puzzle Problem
The program is to change the initial
configuration into the goal configuration. A
solution to the problem is an appropriate
sequence of moves, such as “move tiles 5
to the right, move tile 7 to the left ,move tile
6 to the down.
Example 2:
Actions ?

7
8
Example 3: Route finding
On holiday in Romania; Currently in Arad.
Want arrive to Bucharest.
Example 3: Route finding
States
◦ locations

Initial state
◦ starting point

Successor function (operators)


◦ move from one location to another

Goal test
◦ arrive at a certain location

Path cost
◦ may be quite complex
◦ money, time, travel comfort, scenery, ...
Start States
Actions

Solution

Goal
Tree search
Example 4: Robotic Assembly

States? real-valued coordinates of robot joint angles parts of the


object to be assembled

Actions? continuous motions of robot joints

Goal test? complete assembly

Path cost? time to execute


Problem Formulation
The sequence of required actions to move
from current state to a goal state
Then the problem has a:
set of states S
initial state - the starting point, s0 - a member of S
set of operations - the actions that can be performed, {o1, . . . ,
on}
goal - what you are aiming at - subset of S
Well-Defined Problems
Initial state
◦ starting point from which the agent sets out
Actions (operators, successor functions)
◦ describe the set of possible actions
State space
◦ set of all states reachable from the initial state by any sequence of
actions
Path
◦ sequence of actions leading from one state in the state space to
another
Goal test
◦ determines if a given state is the goal state
Search Space
An imaginary tree showing all possible states reachable
from the initial state

724
5_6
831
Search Space
It forms a graph (or map) in which the nodes are
states and the arcs between nodes are actions.

A path in the search space is a sequence of states


connected by a sequence of actions.

The solution of the problem is part of the map


formed by the state space.
State space vs. search tree

A state is a (representation of) a physical


configuration.
A node is a data structure belong to a search tree.
State space vs. search tree
◦ A node has a parent, children, …
and includes path cost, depth, …

◦ Here node= <state, parent-node,


action, path-cost, depth>

Frontier: those states that are available for expanding


(for applying legal actions to)
Fringe is the collection of nodes that have been generated
but not (yet) expanded. Each node of the fringe is a leaf
node.

You might also like