AI Lecture 9
AI Lecture 9
Lecture 9
Problem Solving as Search
& State Space Search
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.
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:
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.
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.