Professional Documents
Culture Documents
01/06/21 1
What the different approaches defining AI
Thinking humanly
Thinking rationally
Acting humanly
Acting rationally
01/06/21 2
Suppose you are designing a machine to pass the Turing test. What
are the capabilities such a machine must have?
01/06/21 3
Question form Lecture 1
01/06/21 4
Question form Lecture 2
Define Agent:
An agent is anything that can be viewed as perceiving its
environment through sensors and acting upon that
environment through actuators
Intelligent Agent:
a)must sense
b)must act
c)must be autonomous
d)must be rational
01/06/21 5
Question form Lecture 2
Rational Agent:
01/06/21 6
Question form Lecture 2
Autonomous Agent:
01/06/21 7
Question form Lecture 2
01/06/21 8
Question form Lecture 2
01/06/21 9
Question form Lecture 2
01/06/21 10
Question form Lecture 2
01/06/21 11
Question form Lecture 2
01/06/21 12
Question form Lecture 2
Performance:
01/06/21 13
Question form Lecture 2
What sort of agent architecture do you think most suitable
for this agent?
01/06/21 14
Goal Directed Agent
A goal directed agent needs to achieve certain goals.
01/06/21 15
Solving problems by
searching
Chapter 3
01/06/21 16
Agent & Problem Solving
• Simple Reflexive Agent
• Base their action on a direct mapping from
• STATEs to ACTIONs
• Goal Based Agent
• Consider future Actions and the desirability of their outcomes
• Problem Solving Agent
• Goal based Agent
• Use Atomic representation of Environment
• Planning Agent
• Goal based Agent
• Use more advanced factored/structured representation
State Based Search
Each state is an abstract representation of the agent’s
environment. It is an abstraction that denotes a configuration of
the agent.
01/06/21 20
State Based Search
A goal is a description of a set of the desirable states of the
world. Goal states are often specified by a goal test which any
goal state must satisfy.
01/06/21 21
State Based Search
Problem formulation means choosing a relevant set of states
to consider and feasible set of operators to move from one
state to another.
01/06/21 22
Example: Romania
01/06/21 23
Example: Romania
01/06/21 24
Single-state problem formulation
01/06/21 25
Search Problem
Finds a sequence of actions which transfers the agent from the initial
state to a goal state.
01/06/21 26
Pegs and Disks
01/06/21 27
8 Queens
01/06/21 29
N Queens problem formulation 1
01/06/21 30
N Queens problem formulation 2
01/06/21 31
N Queens problem formulation 3
States: Any arrangement of k queens in the first k rows such that none
are attacked.
Successor function: Add a queen to the (k+1)th row so that none are
attacked.
01/06/21 32
Example: The 8-puzzle
• states?
• actions?
• goal test?
• path cost?
01/06/21 33
Example: The 8-puzzle
01/06/21 36
Basic search algorithm: Key issues
Shortest Path
E
Any Path
B
Blind Search A D F H
BFS
DFS
C
G
01/06/21 38
Search Tree
List all possible paths
A
Eliminate Cycles from Path
Result: A search tree
B C
D E D G
E
B
C F B F
A D F H
C G H
G G E
G H
01/06/21 39
Search Tree- Terminology
Root Node A
Leaf Node
B C
Ancestor/
Descendant E G
D D
Branching Factor
Complete Path/
Partial Path C F B F
Expanding Open
G H
Nodes results in G E
G H
closed nodes.
01/06/21 40
Basic search algorithms
01/06/21 41
Evaluating Search Strategies
• Completeness: Is the strategy guaranteed to find a
solution if one exists?
• Optimallity: If a solution is found, is the solution
guaranteed to have the minimum cost?
• Time complexity: Time taken (number of nodes
expanded) (Worst case or average case) to find a
solution.
• Space? Space used by the algorithm measured in
terms of the maximum size of the fringe.
01/06/21 42
Search Strategies
• Blind Search
Depth First search
Breadth First Search
Iterative deepening search
Bidirectional Search
• Informed Search
• Constraint satisfaction Search
• Adversary Search
01/06/21 43
Search strategies
01/06/21 45
Breadth First search
01/06/21 46
A
B C
E
B D E D G
A D F H
C C F B F
G
G H
G G E
H
FRINGE: A B C D E D G
01/06/21 47
Implementation: states vs. nodes
01/06/21 48
Uninformed search strategies
• Uninformed search strategies use only the information available in the
problem definition
• Breadth-first search
• Uniform-cost search
• Depth-first search
• Depth-limited search
• Iterative deepening search
01/06/21 49
Breadth-first search
01/06/21 50
Breadth-first search
01/06/21 51
Breadth-first search
01/06/21 52
Breadth-first search
01/06/21 53
Properties of breadth-first search
• Complete? Yes (if b is finite)
01/06/21 54
Uniform-cost search
01/06/21 55
Uniform-cost search
01/06/21 56
Now try by yourself(UCS)
01/06/21 57
Depth-first search
01/06/21 58
Depth-first search
01/06/21 59
Depth-first search
01/06/21 60
Depth-first search
01/06/21 61
Depth-first search
01/06/21 62
Depth-first search
01/06/21 63
Depth-first search
01/06/21 64
Depth-first search
01/06/21 65
Depth-first search
01/06/21 66
Depth-first search
01/06/21 67
Depth-first search
01/06/21 68
Depth-first search
01/06/21 69
Properties of depth-first search
• Complete? No: fails in infinite-depth spaces,
spaces with loops
– Modify to avoid repeated states along path
complete in finite spaces
• Time? O(bm): terrible if m is much larger than d
– but if solutions are dense, may be much faster than
breadth-first
• Space? O(bm), i.e., linear space!
• Optimal? No
•
01/06/21 70
Depth-limited search
01/06/21 72
Iterative deepening search l =0
01/06/21 73
Iterative deepening search l =1
01/06/21 74
Iterative deepening search l =2
01/06/21 75
Iterative deepening search l =3
01/06/21 76
Properties of iterative deepening search
• Complete? Yes
• Time?
(d+1)b0 + d b1 + (d-1)b2 + … + bd = O(bd)
• Space? O(bd)
• Optimal? Yes, if step cost = 1
•
01/06/21 77
Summary of algorithms
01/06/21 78
Bidirectional Search
01/06/21 79
Bidirectional Search
01/06/21 80
Bidirectional Search
• Works well only when there are unique start and goal states,
but performs ambiguously when there are multiple goals.
• Should able to search backwards from goal. Requires the
ability to generate predecessor states.
• Can (sometimes) lead to finding a solution more quickly.
01/06/21 81
Bidirectional Search
01/06/21 82
Summary
01/06/21 83