Problem Solving Ai
Problem Solving Ai
Problem Solving Ai
sensors
?
environment
agent
actuators
Problem-Solving Agent
sensors
?
environment
agent
actuators
• Formulate Goal
• Formulate Problem
• States
• Actions
• Find Solution
Example Problem
Start Street
Street with
Parking
Looking for Parking
• Going home; need to find street parking
• Formulate Goal:
Car is parked
• Formulate Problem:
States: street with parking and car at that street
Actions: drive between street segments
• Find solution:
Sequence of street segments, ending with a street with parking
Problem Formulation
Street with
Parking
Problem-solving agent
• Problem-solving agent
• A kind of goal-based agent
• It solves problem by
• finding sequences of actions that lead to desirable states (goals)
• To solve a problem,
• the first step is the goal formulation, based on the current situation
Goal formulation
• The goal is formulated
• as a set of world states, in which the goal is
satisfied
• Reaching from initial state goal state
• Actions are required
• Actions are the operators
• causing transitions between world states
• Actions should be abstract enough at a certain
degree, instead of very detailed
• E.g., turn left VS turn left 30 degree, etc.
Problem formulation
• The process of deciding
• what actions and states to consider
• E.g., driving Amman Zarqa
• in-between states and actions defined
• States: Some places in Amman & Zarqa
• Actions: Turn left, Turn right, go straight, accelerate & brake,
etc.
Search
• Because there are many ways to achieve
the same goal
• Those ways are together expressed as a tree
• Multiple options of unknown value at a point,
• the agent can examine different possible sequences
of actions, and choose the best
• This process of looking for the
best sequence is called search
• The best sequence is then a list
of actions, called solution
Search algorithm
• Defined as
• taking a problem
• and returns a solution
• Once a solution is found
• the agent follows the solution
• and carries out the list of actions – execution
phase
• Design of an agent
• “Formulate, search, execute”
Well-defined problems and
solutions
A problem is defined by 5
components:
• Initial state
• Actions
• Transition model or
(Successor functions)
• Goal Test.
• Path Cost.
Well-defined problems and
solutions
• A problem is defined by 4 components:
• The initial state
• that the agent starts in
• The set of possible actions
• Transition model: description of what each
action does.
(successor functions): refer to any state
reachable from given state by a single action
• Initial state, actions and Transition model define
the state space
• the set of all states reachable from the initial state by
any sequence of actions.
• A path in the state space:
• any sequence of states connected by a sequence of
actions.
Assumptions in Basic Search
• The environment is static
• The environment is discretizable
• The environment is observable
• The actions are deterministic
Simple Agent Algorithm
Problem-Solving-Agent
1. initial-state sense/read state
2. goal select/read goal
3. successor select/read action models
4. problem (initial-state, goal, successor)
5. solution search(problem)
6. perform(solution)
Basic Search Concepts
• Search tree
• Search node
• Node expansion
• Search strategy: At each stage it determines which
node to expand
Search Tree: Node Data Structure