SlideShare uma empresa Scribd logo
1 de 46
Agent
An agent is anything that can be viewed as perceiving its environment through sensors
and acting upon that environment through effectors.
Environment
Agent
Sensor Actors / effectors
Jyoti Lakhani
Agent
The job of AI is to design the agent program.
Agent program is a function that implements the mapping from percepts to actions.
A problem is-
a collection of information
that will the agent use
to decide
what to do.
1. The initial state that the agent knows itself to be in
2. Set of possible actions available to the agent, called Operators
3. The state space of the problem: The set of all states reachable from the initial state
by any sequence of actions.
4. A path in the state space is simply any sequence of actions leading from one state to
another.
5. The goal test, which the agent can apply to a single state description to determine if
it is a goal state
6. A path cost function is a function that assigns a cost to a path.
Together, the initial state, operator
set, goal test, and path cost function
define a problem.
Jyoti Lakhani
Measuring problem-solving performance
The effectiveness of a search can be measured in at least three ways -
First, does it find a solution at all?
Second, is it a good solution (one with a low path cost)?
Third, what is the search cost associated with the time and memory required to find a solution?
The total cost of the search is-
The sum of the path cost + The search cost.
SEARCHING FOR SOLUTIONS
finding a solution—is done by a search through the state space
•applying the operators to the current state
•thereby generating a new set of states.
•The process is called expanding the state
This is the essence of search—choosing one option and putting the others aside for later,
in case the first choice does not lead to a solution.
Jyoti Lakhani
Search Strategy
The Search Strategy determines which state to expand first.
It is helpful to think of the search process as building up a search tree that is
superimposed over the state space.
•The root of the search tree is a search node corresponding to the initial state.
•The leaf nodes of the tree correspond to states that do not have successors in the tree,
either because they have not been expanded yet, or because they were expanded, but
generated the empty set.
•At each step, the search algorithm chooses one leaf node to expand.
Jyoti Lakhani
Problem Solving As Search
Initial State
State 2
State 3
State 4
State 1
State 5
State 6
State 7
State 8
State 9
State 10
State 11
State 12
State 13
State 14
State 15
State 16
State 17
State 18
State 19
State 20
Jyoti Lakhani
Data-Driven Search Goal-Driven Search
Data-driven search starts from an
initial state and uses actions that are
allowed to move forward until a goal is
reached. This approach is also known as
forward chaining.
Alternatively, search can start at the goal and
work back toward a start state, by seeing what
moves could have led to the goal state. This is
goal-driven search, also known as backward
chaining.
goal-driven search is preferable to data driven search
Goal-driven search and data-driven search will end up producing the same results, but
depending on the nature of the problem being solved, in some cases one can run more
efficiently than the other
Goal-driven search is particularly useful in situations in which the goal can be clearly
specified (for example, a theorem that is to be proved or finding an exit from a maze).
It is also clearly the best choice in situations such as medical diagnosis where the goal (the
condition to be diagnosed) is known, but the rest of the data (in this case, the causes of
the condition) need to be found.
There are two main approaches to searching a search tree-
Jyoti Lakhani
Data-driven search is most useful when the initial data are provided, and it is not clear
what the goal is.
It is nearly always far easier to start from the end point and work back toward the
start point. This is because a number of dead end paths have been set up from the
start (data) point, and only one path has been set up to the end (goal) point. As a
result, working back from the goal to the start has only one possible path.
Initial State
Goal State
Goal State
Initial State
Data Driven Search
Or
Forward Chaining
Goal Driven Search
Or
Backward ChainingJyoti Lakhani
Search Methodologies
OR
Search Techniques
1. Generate and Test
2. Depth First Search
3. Breath First Search
Un- Informed Informed
Brute Force Search
No Information Required Additional Information required
i.e. called Heuristics
Informed
Techniques are
more intelligent
than Un-informed
techniques
We are talking
about
Methodologies
not methods
SiMpLeSt
CoMmOn
AlTeRnAtIvE Jyoti Lakhani
Generate and Test
Or Brute Force Search
•Simplest Approach
• Examine every node in the tree until it finds a goal
•Solve problems where there is no additional information about
how to reach a solution.
State Space
1
4
2
6
8
3
7
5
1
4
6
8
3
7
5
Goal State
Jyoti Lakhani
To successfully operate
Generate and Test needs to have a suitable Generator
with three properties-
1. It must be complete
2. It must be non-redundant
3. It must be well informed
It must generate every possible solution
It should not generate the same solution twice
It should only propose suitable solutions and
should not examine possible solutions that do
not match the search space
Jyoti Lakhani
Depth-First Search
it follows each path to its
greatest depth
before moving on to the next path
A
B C
D FE
G H I J K L
Goal State
Initial State
Current StateSearch Tree
Blind End
Jyoti Lakhani
Depth-first search is often used by computers for search problems
such as locating files on a disk, or by search engines for spidering
the Internet.
A
B C
D FE
G H I J K L
1
2
3
4 5
6
7
8 9
10
Search Sequence A B D G H C E I J F
Jyoti Lakhani
Jyoti Lakhani
Depth First Algorithm
Function depth ()
{
queue = []; // initialize an empty queue
state = root_node; // initialize the start state
while (true)
{
if is_goal (state)
then return SUCCESS
else add_to_front_of_queue
(successors (state));
if queue == []
then report FAILURE;
state = queue [0]; // state = first item in
queue
remove_first_item_from (queue);
}
}
Breadth-First Search
This approach involves traversing a tree by breadth rather than by depth.
The breadth-first algorithm starts by examining all nodes one
level (sometimes called one ply) down from the root node.
A
B C
D FE
G H I J K L
Ply 1
Ply 2
Ply 3
Ply 4
Jyoti Lakhani
IF goal Then
success
Else
search continues to the next ply
Else
Fail
Breadth-first search is
a far better method to
use in situations
where the
tree may have very
deep paths
Breadth-first search is a poor idea in trees where all paths lead to a
goal node with similar length paths
A
B C
D FE
G H I J K L
1
2 3
4 5 6
Jyoti Lakhani
Jyoti Lakhani
Search Sequence
A
B C
D FE
G H I J K L
1
2 3
4 5 6
A B D G HC E I JF
Jyoti Lakhani
Breadth First Algorithm
Function breadth ()
{
queue = []; // initialize an empty queue
state = root_node; // initialize the start state
while (true)
{
(state if is_goal)
then return SUCCESS
else add_to_back_of_queue
(successors (state));
if queue == []
then report FAILURE;
state = queue [0];
remove_first_item_from (queue);
}
}
Jyoti Lakhani
Scenario Depth First Search Breath First Search
Some paths are extremely
long, or even infinite
Performs badly Performs well
All paths are of similar length Performs well Performs well
All paths are of similar length,
and all
paths lead to a goal state
Performs well Wasteful of time and
memory
High branching factor Performance depends on
other factors
Performs poorly
Difference Between Depth and Breadth First Search
Function: SUCCESSOR(State)
If GOAL STATE
SUCCESS
EXIT
Jyoti Lakhani
Implementing Breadth-First Search
Variable : CURRENT
Queue: STATES
B
A
A
B C
D FE
G H I J K L
Current State
Goal Test
A
CD
Jyoti Lakhani
Step Current
State
Queue Comment
1 A [] Queue Empty
2 A [BC] A is not a Goal State,
Expend A
3 B [C] B is Current State
4 B [CD] B is not a Goal State,
Expend B
5 C [D]
6 .
.
.
7
Jyoti Lakhani
Implementing Depth-First Search
Variable : CURRENT
Function: SUCCESSOR(State)
Stack: STATES
A
B C
D FE
G H I J K L
Current State
Goal Test
Jyoti Lakhani
Properties of Search Methods
• Space Complexity
• Time Complexity
Complexity
Depth-first search is very efficient in
space because it only needs to store
information about the path it is
currently examining
But it is not efficient in time because it
can end up examining very deep
branches of the tree.
Jyoti Lakhani
Completeness
A Search Method should guaranteed to find a goal
state if one exists
Properties of Search Methods
Breadth-first search is complete, but depth-first
search is not because it may explore a path of
infinite length and never find a goal node that
exists on another path.
Jyoti Lakhani
A search method is optimal if it is guaranteed to find
the best solution that exists.
Optimality
Properties of Search Methods
Breadth-first search is an optimal search method, but
depth-first search is not.
Depth-first search returns the first solution it happens to
find, which may be the worst solution that exists.
Because breadth-first search examines all nodes at a
given depth before moving on to the next depth, if it
finds a solution, there cannot be another solution
before it in the search tree.
Jyoti Lakhani
Irrevocability
Properties of Search Methods
Methods that use backtracking are described as tentative
Methods that do not use backtracking, and which
therefore examine just one path, are described as
irrevocable.
Depth-first search is an example of tentative search.
Jyoti Lakhani
Using Heuristics for Search: Informed Search
Depth-first and breadth-first search were described as brute-force
search methods.
This is because they do not employ any special knowledge of the
search trees they are examining
but simply examine every node in order until the goal.
This kind of information is called a heuristic
Heuristics can reduce an impossible problem to a relatively simple
one.
Heuristic Search Uses a Heuristic Evaluation Function or
Heuristic Function
Jyoti Lakhani
Heuristic Function
Heuristic Function apply on a Node
It will Give the Estimate of Distance of goal from Node
H(Node) = Distance of Node from Goal
Suppose there are two nodes m and n and
H(m,g) < H(n,g)
m is more likely to be on an optimal path to the goal node than n.
Jyoti Lakhani
A
B C
D FE
G H I J K L
H( A, F ) = H( A, C ) + H( C, F)
H(A,C)
H(C, F)
Suppose “ F “ is the Goal node
Heuristic Estimate from A to Goal node F is the Summation of –
H(A,C) and H(C,F)
In choosing heuristics, we usually consider
that a heuristic that reduces the number of
nodes that need to be examined in the
search tree is a good heuristic.
Jyoti Lakhani
More than One Heuristics can be applied to the same search
A
B C
D FE
G H I J K L
Suppose we have to Reach the Goal Node , which is F
H1 (A, F) H2 (A, F)
H2 (node, Goal) ≥ H1 (node, Goal)
H2 dominates H1
Which means that a search method using heuristic h2 will
always perform more efficiently than the same search method using h1.
Jyoti Lakhani
Informed SearchesHill Climbing
Best First Search
Branch and Bound A*
Beam Search
AO*
In examining a search tree,
hill climbing will move to the first successor node
that is “better” than the current node
—in other words, the first node that it comes across with a heuristic value lower than
that of the current node.
Hill Climbing
If all directions lead lower than your current position, then you stop and assume
you have reached the summit. As we see later, this might not necessarily always
be true.
Jyoti Lakhani
Steepest Ascent Hill Climbing
Similar to Hill Climbing
Except that rather than moving to the first position you find that is higher
than the current position
you always check around you in all four directions and choose the
position that is highest.
Jyoti Lakhani
Three Problems with Hill Climbing
1. Local Maxima or Foot Hill
Global Maxima
Local Maxima
A local maximum is a part of the search space
that appears to be preferable to the parts around it,
but which is in fact just a foothill of a larger hill
Jyoti Lakhani
Three Problems with Hill Climbing
2. Plateau
Maximum
Plateau
A plateau is a region in a search space where all the
values are the same
Jyoti Lakhani
Three Problems with Hill Climbing
3. Ridge
A ridge is a long, thin region of high land with low land on either side.
Jyoti Lakhani
Best First Search
Depth First Search is good becoz it –
Found solution without expanding all competing branches
= Features of Depth First Search
+
Features of Breadth First Search
Breadth First is good becoz it –
Does not get trapped on dead end paths
Best First search combine both these characters
At each step of Best First Search process
select the most promising nodes,
we have generated so far
Jyoti Lakhani
A
B C
D FE
G H I G K G
Best First Search
50 80
Current Node
f(n)= h(n)
20
10
Jyoti Lakhani
Beam Search
Same like Best First Search,
but n promising states are kept for future considerations
A* Algorithm
Variation of Best First Search
Along each node
on a path to the goal,
A* generates all successor nodes and
estimates the distance (cost)
from the start node to the goal node
Jyoti Lakhani
A * Combines the cost so far and the estimated cost to the goal
That is evaluation function f(n) = g(n) + h(n)
An estimated cost of the cheapest solution via n
Jyoti Lakhani
A
B C
D FE
G H I G K G
A* Search
50 h(n)=80 g(n)=0
Current Node
f(n)= g(n) + h(n)
h(n)=20
g(n)= 50
h(n)=10
g(n)= 50
Jyoti Lakhani
Jyoti Lakhani
Jyoti Lakhani
Jyoti Lakhani
Jyoti Lakhani
Jyoti Lakhani
Jyoti Lakhani
A* (Start, Goal)
{
CLOSE={ }
OPEN= { root }
g[ root ] = 0
f [ root ]
}

Mais conteúdo relacionado

Mais procurados

I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmvikas dhakane
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search StrategiesAmey Kerkar
 
Problems problem spaces and search
Problems problem spaces and searchProblems problem spaces and search
Problems problem spaces and searchAmey Kerkar
 
Ai lecture 14(unit03)
Ai lecture  14(unit03)Ai lecture  14(unit03)
Ai lecture 14(unit03)vikas dhakane
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesDr. C.V. Suresh Babu
 
Semantic net in AI
Semantic net in AISemantic net in AI
Semantic net in AIShahDhruv21
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4DigiGurukul
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligencegrinu
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language ProcessingSaurabh Kaushik
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AIAmey Kerkar
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI Bharat Bhushan
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: ParsingRushdi Shams
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AIvikas dhakane
 
AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAsst.prof M.Gokilavani
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AIMegha Sharma
 
Uninformed search
Uninformed searchUninformed search
Uninformed searchBablu Shofi
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependencyJismy .K.Jose
 

Mais procurados (20)

I. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithmI. Hill climbing algorithm II. Steepest hill climbing algorithm
I. Hill climbing algorithm II. Steepest hill climbing algorithm
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
Problems problem spaces and search
Problems problem spaces and searchProblems problem spaces and search
Problems problem spaces and search
 
Ai lecture 14(unit03)
Ai lecture  14(unit03)Ai lecture  14(unit03)
Ai lecture 14(unit03)
 
AI: Logic in AI
AI: Logic in AIAI: Logic in AI
AI: Logic in AI
 
Problem Solving
Problem Solving Problem Solving
Problem Solving
 
Artificial Intelligence Searching Techniques
Artificial Intelligence Searching TechniquesArtificial Intelligence Searching Techniques
Artificial Intelligence Searching Techniques
 
Semantic net in AI
Semantic net in AISemantic net in AI
Semantic net in AI
 
Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4Artificial Intelligence Notes Unit 4
Artificial Intelligence Notes Unit 4
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
 
Natural Language Processing
Natural Language ProcessingNatural Language Processing
Natural Language Processing
 
Control Strategies in AI
Control Strategies in AIControl Strategies in AI
Control Strategies in AI
 
Control Strategies in AI
Control Strategies in AI Control Strategies in AI
Control Strategies in AI
 
Natural Language Processing: Parsing
Natural Language Processing: ParsingNatural Language Processing: Parsing
Natural Language Processing: Parsing
 
Informed search
Informed searchInformed search
Informed search
 
I.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AII.BEST FIRST SEARCH IN AI
I.BEST FIRST SEARCH IN AI
 
AI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptxAI_Session 7 Greedy Best first search algorithm.pptx
AI_Session 7 Greedy Best first search algorithm.pptx
 
Forward and Backward chaining in AI
Forward and Backward chaining in AIForward and Backward chaining in AI
Forward and Backward chaining in AI
 
Uninformed search
Uninformed searchUninformed search
Uninformed search
 
Conceptual dependency
Conceptual dependencyConceptual dependency
Conceptual dependency
 

Destaque

What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligenceSulbha Gath
 
Perform brute force
Perform brute forcePerform brute force
Perform brute forceSHC
 
Artificial intelligence - TSP
Artificial intelligence - TSP Artificial intelligence - TSP
Artificial intelligence - TSP Tung Le
 
An Introduction to Soft Computing
An Introduction to Soft ComputingAn Introduction to Soft Computing
An Introduction to Soft ComputingTameem Ahmad
 
soft-computing
 soft-computing soft-computing
soft-computingstudent
 
2 lectures 16 17-informed search algorithms ch 4.3
2 lectures 16 17-informed search algorithms ch 4.32 lectures 16 17-informed search algorithms ch 4.3
2 lectures 16 17-informed search algorithms ch 4.3Ravi Balout
 
Lecture1 AI1 Introduction to artificial intelligence
Lecture1 AI1 Introduction to artificial intelligenceLecture1 AI1 Introduction to artificial intelligence
Lecture1 AI1 Introduction to artificial intelligenceAlbert Orriols-Puig
 
Introduction to soft computing
Introduction to soft computingIntroduction to soft computing
Introduction to soft computingAnkush Kumar
 

Destaque (14)

What is artificial intelligence
What is artificial intelligenceWhat is artificial intelligence
What is artificial intelligence
 
Perform brute force
Perform brute forcePerform brute force
Perform brute force
 
Artificial intelligence - TSP
Artificial intelligence - TSP Artificial intelligence - TSP
Artificial intelligence - TSP
 
Soft computing
Soft computingSoft computing
Soft computing
 
An Introduction to Soft Computing
An Introduction to Soft ComputingAn Introduction to Soft Computing
An Introduction to Soft Computing
 
Breadth first search
Breadth first searchBreadth first search
Breadth first search
 
soft-computing
 soft-computing soft-computing
soft-computing
 
Chapter 2 (final)
Chapter 2 (final)Chapter 2 (final)
Chapter 2 (final)
 
Computer Vision
Computer VisionComputer Vision
Computer Vision
 
2 lectures 16 17-informed search algorithms ch 4.3
2 lectures 16 17-informed search algorithms ch 4.32 lectures 16 17-informed search algorithms ch 4.3
2 lectures 16 17-informed search algorithms ch 4.3
 
Soft computing
Soft computingSoft computing
Soft computing
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
Lecture1 AI1 Introduction to artificial intelligence
Lecture1 AI1 Introduction to artificial intelligenceLecture1 AI1 Introduction to artificial intelligence
Lecture1 AI1 Introduction to artificial intelligence
 
Introduction to soft computing
Introduction to soft computingIntroduction to soft computing
Introduction to soft computing
 

Semelhante a Agent-based problem solving as search

4-200626030058kpnu9avdbvionipnmvdadzvdavavd
4-200626030058kpnu9avdbvionipnmvdadzvdavavd4-200626030058kpnu9avdbvionipnmvdadzvdavavd
4-200626030058kpnu9avdbvionipnmvdadzvdavavdmmpnair0
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxkitsenthilkumarcse
 
Production systems
Production systemsProduction systems
Production systemsAdri Jovin
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxPankaj Debbarma
 
AI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxAI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxYousef Aburawi
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchTekendra Nath Yogi
 
Amit ppt
Amit pptAmit ppt
Amit pptamitp26
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptxssuserbda195
 
Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)Nazir Ahmed
 
Lecture 07 search techniques
Lecture 07 search techniquesLecture 07 search techniques
Lecture 07 search techniquesHema Kashyap
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceJay Nagar
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchTaymoor Nazmy
 
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchJarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchPalGov
 
Artificial intelligence 2 Part 1
Artificial intelligence 2 Part 1Artificial intelligence 2 Part 1
Artificial intelligence 2 Part 1SURBHI SAROHA
 
24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptxManiMaran230751
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfMrRRThirrunavukkaras
 
study material for Artificial Intelligence
study material for Artificial Intelligencestudy material for Artificial Intelligence
study material for Artificial Intelligencekarmastrike9441
 

Semelhante a Agent-based problem solving as search (20)

4-200626030058kpnu9avdbvionipnmvdadzvdavavd
4-200626030058kpnu9avdbvionipnmvdadzvdavavd4-200626030058kpnu9avdbvionipnmvdadzvdavavd
4-200626030058kpnu9avdbvionipnmvdadzvdavavd
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 
Production systems
Production systemsProduction systems
Production systems
 
AI-03 Problems State Space.pptx
AI-03 Problems State Space.pptxAI-03 Problems State Space.pptx
AI-03 Problems State Space.pptx
 
AI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptxAI_03_Solving Problems by Searching.pptx
AI_03_Solving Problems by Searching.pptx
 
Unit3:Informed and Uninformed search
Unit3:Informed and Uninformed searchUnit3:Informed and Uninformed search
Unit3:Informed and Uninformed search
 
Amit ppt
Amit pptAmit ppt
Amit ppt
 
Machine Learning.pptx
Machine Learning.pptxMachine Learning.pptx
Machine Learning.pptx
 
Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)
 
Lecture 07 search techniques
Lecture 07 search techniquesLecture 07 search techniques
Lecture 07 search techniques
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
Artificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-searchArtificial intelligent Lec 3-ai chapter3-search
Artificial intelligent Lec 3-ai chapter3-search
 
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearchJarrar.lecture notes.aai.2011s.ch3.uniformedsearch
Jarrar.lecture notes.aai.2011s.ch3.uniformedsearch
 
AI Lesson 04
AI Lesson 04AI Lesson 04
AI Lesson 04
 
Uninformed search
Uninformed searchUninformed search
Uninformed search
 
Artificial intelligence 2 Part 1
Artificial intelligence 2 Part 1Artificial intelligence 2 Part 1
Artificial intelligence 2 Part 1
 
24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx24.09.2021 Reinforcement Learning Algorithms.pptx
24.09.2021 Reinforcement Learning Algorithms.pptx
 
Search-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdfSearch-Beyond-Classical-no-exercise-answers.pdf
Search-Beyond-Classical-no-exercise-answers.pdf
 
study material for Artificial Intelligence
study material for Artificial Intelligencestudy material for Artificial Intelligence
study material for Artificial Intelligence
 

Mais de jyoti_lakhani

CG02 Computer Graphic Systems.ppsx
CG02 Computer Graphic Systems.ppsxCG02 Computer Graphic Systems.ppsx
CG02 Computer Graphic Systems.ppsxjyoti_lakhani
 
CG04 Color Models.ppsx
CG04 Color Models.ppsxCG04 Color Models.ppsx
CG04 Color Models.ppsxjyoti_lakhani
 
CG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxCG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxjyoti_lakhani
 
CG02 Computer Graphic Systems.pptx
CG02 Computer Graphic Systems.pptxCG02 Computer Graphic Systems.pptx
CG02 Computer Graphic Systems.pptxjyoti_lakhani
 
CG01 introduction.ppsx
CG01 introduction.ppsxCG01 introduction.ppsx
CG01 introduction.ppsxjyoti_lakhani
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary treejyoti_lakhani
 
Ds006 linked list- delete from front
Ds006   linked list- delete from frontDs006   linked list- delete from front
Ds006 linked list- delete from frontjyoti_lakhani
 
Ds06 linked list- insert a node after a given node
Ds06   linked list-  insert a node after a given nodeDs06   linked list-  insert a node after a given node
Ds06 linked list- insert a node after a given nodejyoti_lakhani
 
Ds06 linked list- insert a node at end
Ds06   linked list- insert a node at endDs06   linked list- insert a node at end
Ds06 linked list- insert a node at endjyoti_lakhani
 
Ds06 linked list- insert a node at beginning
Ds06   linked list- insert a node at beginningDs06   linked list- insert a node at beginning
Ds06 linked list- insert a node at beginningjyoti_lakhani
 
Ds06 linked list- intro and create a node
Ds06   linked list- intro and create a nodeDs06   linked list- intro and create a node
Ds06 linked list- intro and create a nodejyoti_lakhani
 
Ds04 abstract data types (adt) jyoti lakhani
Ds04 abstract data types (adt) jyoti lakhaniDs04 abstract data types (adt) jyoti lakhani
Ds04 abstract data types (adt) jyoti lakhanijyoti_lakhani
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhanijyoti_lakhani
 
Ds03 algorithms jyoti lakhani
Ds03 algorithms jyoti lakhaniDs03 algorithms jyoti lakhani
Ds03 algorithms jyoti lakhanijyoti_lakhani
 
Ds02 flow chart and pseudo code
Ds02 flow chart and pseudo codeDs02 flow chart and pseudo code
Ds02 flow chart and pseudo codejyoti_lakhani
 
Ds01 data structure introduction - by jyoti lakhani
Ds01 data structure  introduction - by jyoti lakhaniDs01 data structure  introduction - by jyoti lakhani
Ds01 data structure introduction - by jyoti lakhanijyoti_lakhani
 

Mais de jyoti_lakhani (20)

CG02 Computer Graphic Systems.ppsx
CG02 Computer Graphic Systems.ppsxCG02 Computer Graphic Systems.ppsx
CG02 Computer Graphic Systems.ppsx
 
Projections.pptx
Projections.pptxProjections.pptx
Projections.pptx
 
CG04 Color Models.ppsx
CG04 Color Models.ppsxCG04 Color Models.ppsx
CG04 Color Models.ppsx
 
CG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsxCG03 Random Raster Scan displays and Color CRTs.ppsx
CG03 Random Raster Scan displays and Color CRTs.ppsx
 
CG02 Computer Graphic Systems.pptx
CG02 Computer Graphic Systems.pptxCG02 Computer Graphic Systems.pptx
CG02 Computer Graphic Systems.pptx
 
CG01 introduction.ppsx
CG01 introduction.ppsxCG01 introduction.ppsx
CG01 introduction.ppsx
 
Doubly linked list
Doubly linked listDoubly linked list
Doubly linked list
 
Double ended queue
Double ended queueDouble ended queue
Double ended queue
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary tree
 
Priority queue
Priority queuePriority queue
Priority queue
 
Ds006 linked list- delete from front
Ds006   linked list- delete from frontDs006   linked list- delete from front
Ds006 linked list- delete from front
 
Ds06 linked list- insert a node after a given node
Ds06   linked list-  insert a node after a given nodeDs06   linked list-  insert a node after a given node
Ds06 linked list- insert a node after a given node
 
Ds06 linked list- insert a node at end
Ds06   linked list- insert a node at endDs06   linked list- insert a node at end
Ds06 linked list- insert a node at end
 
Ds06 linked list- insert a node at beginning
Ds06   linked list- insert a node at beginningDs06   linked list- insert a node at beginning
Ds06 linked list- insert a node at beginning
 
Ds06 linked list- intro and create a node
Ds06   linked list- intro and create a nodeDs06   linked list- intro and create a node
Ds06 linked list- intro and create a node
 
Ds04 abstract data types (adt) jyoti lakhani
Ds04 abstract data types (adt) jyoti lakhaniDs04 abstract data types (adt) jyoti lakhani
Ds04 abstract data types (adt) jyoti lakhani
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhani
 
Ds03 algorithms jyoti lakhani
Ds03 algorithms jyoti lakhaniDs03 algorithms jyoti lakhani
Ds03 algorithms jyoti lakhani
 
Ds02 flow chart and pseudo code
Ds02 flow chart and pseudo codeDs02 flow chart and pseudo code
Ds02 flow chart and pseudo code
 
Ds01 data structure introduction - by jyoti lakhani
Ds01 data structure  introduction - by jyoti lakhaniDs01 data structure  introduction - by jyoti lakhani
Ds01 data structure introduction - by jyoti lakhani
 

Último

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)lakshayb543
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfVanessa Camilleri
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfTechSoup
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEaurabinda banchhor
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parentsnavabharathschool99
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfJemuel Francisco
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptshraddhaparab530
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...JojoEDelaCruz
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...Postal Advocate Inc.
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 

Último (20)

Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
Visit to a blind student's school🧑‍🦯🧑‍🦯(community medicine)
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
ICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdfICS2208 Lecture6 Notes for SL spaces.pdf
ICS2208 Lecture6 Notes for SL spaces.pdf
 
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdfInclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
Inclusivity Essentials_ Creating Accessible Websites for Nonprofits .pdf
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Dust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSEDust Of Snow By Robert Frost Class-X English CBSE
Dust Of Snow By Robert Frost Class-X English CBSE
 
Choosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for ParentsChoosing the Right CBSE School A Comprehensive Guide for Parents
Choosing the Right CBSE School A Comprehensive Guide for Parents
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdfGrade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
Grade 9 Quarter 4 Dll Grade 9 Quarter 4 DLL.pdf
 
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptxLEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
LEFT_ON_C'N_ PRELIMS_EL_DORADO_2024.pptx
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Integumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.pptIntegumentary System SMP B. Pharm Sem I.ppt
Integumentary System SMP B. Pharm Sem I.ppt
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
ENG 5 Q4 WEEk 1 DAY 1 Restate sentences heard in one’s own words. Use appropr...
 
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
USPS® Forced Meter Migration - How to Know if Your Postage Meter Will Soon be...
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 

Agent-based problem solving as search

  • 1. Agent An agent is anything that can be viewed as perceiving its environment through sensors and acting upon that environment through effectors. Environment Agent Sensor Actors / effectors Jyoti Lakhani
  • 2. Agent The job of AI is to design the agent program. Agent program is a function that implements the mapping from percepts to actions. A problem is- a collection of information that will the agent use to decide what to do. 1. The initial state that the agent knows itself to be in 2. Set of possible actions available to the agent, called Operators 3. The state space of the problem: The set of all states reachable from the initial state by any sequence of actions. 4. A path in the state space is simply any sequence of actions leading from one state to another. 5. The goal test, which the agent can apply to a single state description to determine if it is a goal state 6. A path cost function is a function that assigns a cost to a path. Together, the initial state, operator set, goal test, and path cost function define a problem. Jyoti Lakhani
  • 3. Measuring problem-solving performance The effectiveness of a search can be measured in at least three ways - First, does it find a solution at all? Second, is it a good solution (one with a low path cost)? Third, what is the search cost associated with the time and memory required to find a solution? The total cost of the search is- The sum of the path cost + The search cost. SEARCHING FOR SOLUTIONS finding a solution—is done by a search through the state space •applying the operators to the current state •thereby generating a new set of states. •The process is called expanding the state This is the essence of search—choosing one option and putting the others aside for later, in case the first choice does not lead to a solution. Jyoti Lakhani
  • 4. Search Strategy The Search Strategy determines which state to expand first. It is helpful to think of the search process as building up a search tree that is superimposed over the state space. •The root of the search tree is a search node corresponding to the initial state. •The leaf nodes of the tree correspond to states that do not have successors in the tree, either because they have not been expanded yet, or because they were expanded, but generated the empty set. •At each step, the search algorithm chooses one leaf node to expand. Jyoti Lakhani
  • 5. Problem Solving As Search Initial State State 2 State 3 State 4 State 1 State 5 State 6 State 7 State 8 State 9 State 10 State 11 State 12 State 13 State 14 State 15 State 16 State 17 State 18 State 19 State 20 Jyoti Lakhani
  • 6. Data-Driven Search Goal-Driven Search Data-driven search starts from an initial state and uses actions that are allowed to move forward until a goal is reached. This approach is also known as forward chaining. Alternatively, search can start at the goal and work back toward a start state, by seeing what moves could have led to the goal state. This is goal-driven search, also known as backward chaining. goal-driven search is preferable to data driven search Goal-driven search and data-driven search will end up producing the same results, but depending on the nature of the problem being solved, in some cases one can run more efficiently than the other Goal-driven search is particularly useful in situations in which the goal can be clearly specified (for example, a theorem that is to be proved or finding an exit from a maze). It is also clearly the best choice in situations such as medical diagnosis where the goal (the condition to be diagnosed) is known, but the rest of the data (in this case, the causes of the condition) need to be found. There are two main approaches to searching a search tree- Jyoti Lakhani
  • 7. Data-driven search is most useful when the initial data are provided, and it is not clear what the goal is. It is nearly always far easier to start from the end point and work back toward the start point. This is because a number of dead end paths have been set up from the start (data) point, and only one path has been set up to the end (goal) point. As a result, working back from the goal to the start has only one possible path. Initial State Goal State Goal State Initial State Data Driven Search Or Forward Chaining Goal Driven Search Or Backward ChainingJyoti Lakhani
  • 8. Search Methodologies OR Search Techniques 1. Generate and Test 2. Depth First Search 3. Breath First Search Un- Informed Informed Brute Force Search No Information Required Additional Information required i.e. called Heuristics Informed Techniques are more intelligent than Un-informed techniques We are talking about Methodologies not methods SiMpLeSt CoMmOn AlTeRnAtIvE Jyoti Lakhani
  • 9. Generate and Test Or Brute Force Search •Simplest Approach • Examine every node in the tree until it finds a goal •Solve problems where there is no additional information about how to reach a solution. State Space 1 4 2 6 8 3 7 5 1 4 6 8 3 7 5 Goal State Jyoti Lakhani
  • 10. To successfully operate Generate and Test needs to have a suitable Generator with three properties- 1. It must be complete 2. It must be non-redundant 3. It must be well informed It must generate every possible solution It should not generate the same solution twice It should only propose suitable solutions and should not examine possible solutions that do not match the search space Jyoti Lakhani
  • 11. Depth-First Search it follows each path to its greatest depth before moving on to the next path A B C D FE G H I J K L Goal State Initial State Current StateSearch Tree Blind End Jyoti Lakhani
  • 12. Depth-first search is often used by computers for search problems such as locating files on a disk, or by search engines for spidering the Internet. A B C D FE G H I J K L 1 2 3 4 5 6 7 8 9 10 Search Sequence A B D G H C E I J F Jyoti Lakhani
  • 13. Jyoti Lakhani Depth First Algorithm Function depth () { queue = []; // initialize an empty queue state = root_node; // initialize the start state while (true) { if is_goal (state) then return SUCCESS else add_to_front_of_queue (successors (state)); if queue == [] then report FAILURE; state = queue [0]; // state = first item in queue remove_first_item_from (queue); } }
  • 14. Breadth-First Search This approach involves traversing a tree by breadth rather than by depth. The breadth-first algorithm starts by examining all nodes one level (sometimes called one ply) down from the root node. A B C D FE G H I J K L Ply 1 Ply 2 Ply 3 Ply 4 Jyoti Lakhani
  • 15. IF goal Then success Else search continues to the next ply Else Fail Breadth-first search is a far better method to use in situations where the tree may have very deep paths Breadth-first search is a poor idea in trees where all paths lead to a goal node with similar length paths A B C D FE G H I J K L 1 2 3 4 5 6 Jyoti Lakhani
  • 16. Jyoti Lakhani Search Sequence A B C D FE G H I J K L 1 2 3 4 5 6 A B D G HC E I JF
  • 17. Jyoti Lakhani Breadth First Algorithm Function breadth () { queue = []; // initialize an empty queue state = root_node; // initialize the start state while (true) { (state if is_goal) then return SUCCESS else add_to_back_of_queue (successors (state)); if queue == [] then report FAILURE; state = queue [0]; remove_first_item_from (queue); } }
  • 18. Jyoti Lakhani Scenario Depth First Search Breath First Search Some paths are extremely long, or even infinite Performs badly Performs well All paths are of similar length Performs well Performs well All paths are of similar length, and all paths lead to a goal state Performs well Wasteful of time and memory High branching factor Performance depends on other factors Performs poorly Difference Between Depth and Breadth First Search
  • 19. Function: SUCCESSOR(State) If GOAL STATE SUCCESS EXIT Jyoti Lakhani Implementing Breadth-First Search Variable : CURRENT Queue: STATES B A A B C D FE G H I J K L Current State Goal Test A CD
  • 20. Jyoti Lakhani Step Current State Queue Comment 1 A [] Queue Empty 2 A [BC] A is not a Goal State, Expend A 3 B [C] B is Current State 4 B [CD] B is not a Goal State, Expend B 5 C [D] 6 . . . 7
  • 21. Jyoti Lakhani Implementing Depth-First Search Variable : CURRENT Function: SUCCESSOR(State) Stack: STATES A B C D FE G H I J K L Current State Goal Test
  • 22. Jyoti Lakhani Properties of Search Methods • Space Complexity • Time Complexity Complexity Depth-first search is very efficient in space because it only needs to store information about the path it is currently examining But it is not efficient in time because it can end up examining very deep branches of the tree.
  • 23. Jyoti Lakhani Completeness A Search Method should guaranteed to find a goal state if one exists Properties of Search Methods Breadth-first search is complete, but depth-first search is not because it may explore a path of infinite length and never find a goal node that exists on another path.
  • 24. Jyoti Lakhani A search method is optimal if it is guaranteed to find the best solution that exists. Optimality Properties of Search Methods Breadth-first search is an optimal search method, but depth-first search is not. Depth-first search returns the first solution it happens to find, which may be the worst solution that exists. Because breadth-first search examines all nodes at a given depth before moving on to the next depth, if it finds a solution, there cannot be another solution before it in the search tree.
  • 25. Jyoti Lakhani Irrevocability Properties of Search Methods Methods that use backtracking are described as tentative Methods that do not use backtracking, and which therefore examine just one path, are described as irrevocable. Depth-first search is an example of tentative search.
  • 26. Jyoti Lakhani Using Heuristics for Search: Informed Search Depth-first and breadth-first search were described as brute-force search methods. This is because they do not employ any special knowledge of the search trees they are examining but simply examine every node in order until the goal. This kind of information is called a heuristic Heuristics can reduce an impossible problem to a relatively simple one. Heuristic Search Uses a Heuristic Evaluation Function or Heuristic Function
  • 27. Jyoti Lakhani Heuristic Function Heuristic Function apply on a Node It will Give the Estimate of Distance of goal from Node H(Node) = Distance of Node from Goal Suppose there are two nodes m and n and H(m,g) < H(n,g) m is more likely to be on an optimal path to the goal node than n.
  • 28. Jyoti Lakhani A B C D FE G H I J K L H( A, F ) = H( A, C ) + H( C, F) H(A,C) H(C, F) Suppose “ F “ is the Goal node Heuristic Estimate from A to Goal node F is the Summation of – H(A,C) and H(C,F) In choosing heuristics, we usually consider that a heuristic that reduces the number of nodes that need to be examined in the search tree is a good heuristic.
  • 29. Jyoti Lakhani More than One Heuristics can be applied to the same search A B C D FE G H I J K L Suppose we have to Reach the Goal Node , which is F H1 (A, F) H2 (A, F) H2 (node, Goal) ≥ H1 (node, Goal) H2 dominates H1 Which means that a search method using heuristic h2 will always perform more efficiently than the same search method using h1.
  • 30. Jyoti Lakhani Informed SearchesHill Climbing Best First Search Branch and Bound A* Beam Search AO* In examining a search tree, hill climbing will move to the first successor node that is “better” than the current node —in other words, the first node that it comes across with a heuristic value lower than that of the current node. Hill Climbing If all directions lead lower than your current position, then you stop and assume you have reached the summit. As we see later, this might not necessarily always be true.
  • 31. Jyoti Lakhani Steepest Ascent Hill Climbing Similar to Hill Climbing Except that rather than moving to the first position you find that is higher than the current position you always check around you in all four directions and choose the position that is highest.
  • 32. Jyoti Lakhani Three Problems with Hill Climbing 1. Local Maxima or Foot Hill Global Maxima Local Maxima A local maximum is a part of the search space that appears to be preferable to the parts around it, but which is in fact just a foothill of a larger hill
  • 33. Jyoti Lakhani Three Problems with Hill Climbing 2. Plateau Maximum Plateau A plateau is a region in a search space where all the values are the same
  • 34. Jyoti Lakhani Three Problems with Hill Climbing 3. Ridge A ridge is a long, thin region of high land with low land on either side.
  • 35. Jyoti Lakhani Best First Search Depth First Search is good becoz it – Found solution without expanding all competing branches = Features of Depth First Search + Features of Breadth First Search Breadth First is good becoz it – Does not get trapped on dead end paths Best First search combine both these characters At each step of Best First Search process select the most promising nodes, we have generated so far
  • 36. Jyoti Lakhani A B C D FE G H I G K G Best First Search 50 80 Current Node f(n)= h(n) 20 10
  • 37. Jyoti Lakhani Beam Search Same like Best First Search, but n promising states are kept for future considerations A* Algorithm Variation of Best First Search Along each node on a path to the goal, A* generates all successor nodes and estimates the distance (cost) from the start node to the goal node
  • 38. Jyoti Lakhani A * Combines the cost so far and the estimated cost to the goal That is evaluation function f(n) = g(n) + h(n) An estimated cost of the cheapest solution via n
  • 39. Jyoti Lakhani A B C D FE G H I G K G A* Search 50 h(n)=80 g(n)=0 Current Node f(n)= g(n) + h(n) h(n)=20 g(n)= 50 h(n)=10 g(n)= 50
  • 46. Jyoti Lakhani A* (Start, Goal) { CLOSE={ } OPEN= { root } g[ root ] = 0 f [ root ] }

Notas do Editor

  1. Jyoti Lakhani