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

AI Lecture 9

The document discusses problem-solving in artificial intelligence through state space search strategies, using examples like Tic-Tac-Toe, the Traveling Salesperson, and the 8-Puzzle. It outlines the components of state space, including nodes, arcs, start states, and goal states, and differentiates between data-driven and goal-driven search strategies. Additionally, it provides guidance on selecting appropriate search strategies based on the problem context.

Uploaded by

abdoantar264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views

AI Lecture 9

The document discusses problem-solving in artificial intelligence through state space search strategies, using examples like Tic-Tac-Toe, the Traveling Salesperson, and the 8-Puzzle. It outlines the components of state space, including nodes, arcs, start states, and goal states, and differentiates between data-driven and goal-driven search strategies. Additionally, it provides guidance on selecting appropriate search strategies based on the problem context.

Uploaded by

abdoantar264
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 20

Artificial Intelligence

Lecture 9
Problem Solving as Search
& State Space Search

Dr. Mahmoud Bassiouni


mbassiouni@eelu.edu.eg
Lecture 8: Solving Problem by Searching,
.. & .. State Space Search Strategies and Structures
3.1 Solving problems by Searching ▪ Example: Tic-Tac-Toe
▪ Solving Problems by Searching ▪ Example: Traveling Salesperson
▪ Types of Agents (Reflex vs. Planning) ▪ State Space Search Strategies
▪ State Space Search ▪ Selecting Search Strategy
▪ Example: Tic-Tac-Toe Game
3.3 Basic Idea of Search & the Backtracking
▪ Example: Mechanical Fault Diagnosing Search Algorithm
▪ How Human Beings Think? ▪ Search: Basic idea
▪ Heuristic Search ▪ Search Tree
3.2 State Space Search Graph & Strategies ▪ Tree Search Algorithm Outline
▪ Search Problem Components ▪ Tree Search Example
▪ Example: Romania ▪ Handling repeated states
▪ State Space & State Space Graph ▪ Backtracking Search
▪ Example: Vacuum World ▪ Backtracking Algorithm Data Structures
▪ Example: The 8-Puzzle ▪ Backtracking Algorithm
▪ Example: Robot Motion Planning 3.4 Practice Exercises (Solved Problems)
State Space
A state space is represented by four-tuple [N, A, S, GD].
o N, is the set of nodes or states of the graph. These
correspond to the states in the problem-solving process.
o A, is the set of arcs between nodes. These correspond to
the steps in a problem-solving process.
o S, a nonempty subset of N, contains the start-state (s) of
the problem.
o GD, a nonempty subset of N, contains the goal-state(s) of
the problem. The states in GD are described using either:
o A measurable property of the states encountered in
the search. (Reaching a specific state as a goal state)
o A property of the solution path developed in the
search (a solution path is a path through this graph
from a node in S to a node in GD).
Example: Vacuum World

o States:
o Agent location and dirt location
o How many possible states?
o What if there are n possible locations?
o The size of the state space grows exponentially
with the “size” of the world!
o Actions:
o Left, right, suck.
o Transition Model .. ?
Example:Vacuum World State Space Graph
o Transition Model:
Transition model looks like that.
• Let’s start from the left. Agent is in A if he made left no action
• If he made suck will move to the below state
• If he made right will move to the right state
And so on
Example:Vacuum World State Space Graph
o Transition Model:
Aim: is to follow a sequence of actions that makes us reach the goal
states This is found and seen in the bottom of the image shown here.

Shortest path can be:


If you started from the left -> Suck -> right->Suck -> final state cleaned B
If you started from the right-> Suck-> Left-> Suck-> final state cleaned A
Example: the8-Puzzle
o States
o Locations of tiles
• If you have 8-puzzle: The number of
estimate legal positions 181,440.
• If you increase just only one dimension
to be 4 x 4 you will have about ~ 10
trillion states.
• If the size is 5 x 5 you will have 10^25.
It increase expansional.
This is called the state space complexity.
How many legal game position
Example: the8-Puzzle
o Actions
o Move blank left, right, up, down
o Path Cost
o 1 per move
o Each move costs 1
o Different from moving from city to city.
o Each city can cost a value in time, money
benzene when moving to the next city.
Example: Robot Motion Planning

A robot hand try to grasp or collect objects


o States
o Real-valued joint parameters (angles, displacements).
o It can be distance of the hand or displacement, angles of the hand
that captures, the rotation of the holder to the hand.
o Actions
o They are continuous motions of the robot joints (you can move in a
continuous motion with values for example (1 meter and 2 milli,
1meter and 4.5 milli for example)
o Also the angles with degree for example 60 or 70 degrees
Example: Robot Motion Planning

o Goal State
o Configuration in which object is grasped.
o Path Cost
o Time to execute, smoothness of path, etc.
o use a smooth way means to make the arm move in short
ways to get the object.
o Or make the arm move in long or take too many distances to
get the required object (no smooth way)
Example: Tic-Tac-Toe
• Nodes(N): all the different configuration of Xs and Os that
the game can have.
• Arcs (A): generated by legal moves by placing an X or an O
in unused location.
• Start state (S): an empty board.
• Goal states (GD): a board state having three Xs in a row,
column, or diagonal.
• The arcs are directed, then no cycles in the state space,
directed acyclic graph (DAG).
o Path Cost
o 1 per move
Example: Traveling Salesperson

A salesperson has five cites to visit and then must return home.
• Nodes(N): represent 5 cites.
•Arcs(A): labeled with weight indicating the cost of traveling
between connected cites.
• Start state(S): a home city.
• Goal states(GD): an entire path contains a complete circuit
with minimum cost.
o Path Cost: It depends on the cost of the arcs or weights from
one city to another.
State Space Search Strategies
There are two distinct ways for searching a state space graph:

▪ Data-Driven Search: (Forward chaining)


• Forward chaining or forward reasoning or button up approach
• you start from the data till you reach goal. It is the available data
or known the knowledge base.
• You apply rules on these knowledge to get another knowledge
• You continue to do this till you reach your goal.

Aim: Start searching from the given data of a problem instance


toward a goal.
State Space Search Strategies
There are two distinct ways for searching a state space graph:

▪ Goal-Driven Search: (Backward chaining)


• Backward chaining backward reasoning, Top down approach
• You start with the goal, Try to check or search for sub-goals
• How to achieve these sub-goals?
• Try to find the data that support these sub-goals.
• So to achieve these goals you something and something. Till you
each the available data you have.

Aim: Start searching from a goal state to facts or data of the given
problem.
State Space Search Strategies
Applications of Search Strategies
▪ Data-Driven Search: (Forward chaining)
• This is used in expert system: System you put the decision
making of a human expert to decide the solution to your
problem if asked in the same domain.

• Goal-Driven Search: (Backward chaining)


• Used in Automated theorem prover: You start with the theorem
needed to prove. To prove it we need to prove something else
And so on till you reach the fact or data that support this theory.
• Used by the physician: He thinks that you have 2 or 3 diseases
this is the goal. Then he asks you to do some medical reports to
have data that prove that goal. This is goal driven.
State Space Search Strategies..
Selecting Search Strategy
Data-Driven Search is suggested if:
o The data are given in the initial problem statement.

o If the you have data and you apply rules to get new data.

o If the rules are few and the data produced will not explode,
will not increase expentionally use forward chaining.

o There are large number of potential goals.

o It is difficult to form a goal or hypothesis.


State Space Search Strategies..
Selecting Search Strategy
Goal- Driven Search is appropriate if:
o A goal is given in the problem statement or can easily
formulated.
o If data is not given and should be acquired by the
problem solver.

o There are large number of rules to produce a new facts.


State Space Search Strategies..
Selecting Search Strategy
If you have data and goal in the same time
What do we do?
Need to check from which path (from data path or the goal
path) the tree will be small and move in its direction
Like the example of 25 generation (need to see it)
Exercises
What have we learned?
▪ Determine whether goal-driven or data-driven search would
be preferable for solving each of the following problems.
Justify your answer.
▪ You have met a person who claims to be your distant
cousin, with a common ancestor named John Doe. You
would like to verify her claim.
▪ Another person claims to be your distant cousin. He
doesn't know the common ancestor's name but knows
that it was no more than eight generations back. You
would like to either find this ancestor or determine that
she didn't exist.
▪ A theorem prover for plane geometry.
THANK YOU

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy