SlideShare a Scribd company logo
Lecture 3
Note: Some slides and/or pictures are adapted from Lecture slides / Books of
• Dr Zafar Alvi.
• Text Book - Aritificial Intelligence Illuminated by Ben Coppin, Narosa Publishers.
• Ref Books
•Artificial Intelligence- Structures & Strategies for Complex Problem Solving by George F. Luger, 4th edition,
Pearson Education.
• Artificial Intelligence A Modern Approach by Stuart Russell & Peter Norvig.
•Artificial Intelligence, Third Edition by Patrick Henry Winston
Outline
• Problems and their representation
• Goal Driven VS Data Driven
• Properties of search Methods
• Tree search algorithm
– Depth First algorithm
– Breadth First algorithm
– Iterative Deepening algorithm
Problems and their Representations
• Three men and three lions are on one side of a
river, with a boat. They all want to get to the
other side of the river. The boat can only hold
one or two at a time. At no time should there
be more lions than men on either side of the
river, as this would probably result in the men
being eaten.
• Representation could be 3, 3, 1 0, 0, 0
Problems and their Representations
• Traveling Salesman problem (NP complete)
Problems and their Representations
• Traversing a Maze
Data Driven or 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.
• 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.
Properties of Search Methods
• Complexity
• Completeness
• Optimality
• Admissibility
• Irrevocability
Complexity
• It is useful to describe how efficient that
method is, over time and space.
• The time complexity of a method is related to
the length of time that the method would take
to find a goal state.
• The space complexity is related to the amount
of memory that the method needs to use.
Completeness
• A search method is described as being
complete if it is guaranteed to find a goal state
if one exists.
• A method that is not complete has the
disadvantage that it cannot necessarily be
believed if it reports that no solution exists.
Optimality
• A search method is optimal if it finds a
solution in the quickest possible time.
Admissibility
• An algorithm is then defined as admissible if it
is guaranteed to find the best solution.
Irrevocability
• Methods that do not use backtracking, and
which therefore examine just one path, are
described as irrevocable.
• Irrevocable search methods will often find
suboptimal solutions to problems because
they tend to be fooled by local optima—
solutions that look good locally but are less
favorable when compared with other
solutions elsewhere in the search space.
Tree search algorithms
• Basic idea:
– offline, simulated exploration of state space by generating
successors of already-explored
Tree search example
Tree search example
Tree search example
Uninformed search strategies
• Uninformed search strategies use only the
information available in the problem
definition
– Depth-first search
– Breadth-first search
– Iterative deepening search
– etc
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– fringe = LIFO queue, i.e., put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– fringe = LIFO queue, i.e., put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
• Expand deepest unexpanded node
• Implementation:
– put successors at front
–
Depth-first search
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
• Expand shallowest unexpanded node
• Implementation:
– new successors go at end
–
Breadth-first search
• Expand shallowest unexpanded node
• Implementation:
– new successors go at end
–
Breadth-first search
• Expand shallowest unexpanded node
• Implementation:
– new successors go at end
–
Breadth-first search
• Expand shallowest unexpanded node
• Implementation:
– fringe is a FIFO queue, i.e., new successors go at
end
–
Breadth-first search
Function breadth ()
{
queue = []; // initialize an empty queue
state = root_node; // initialize the start state
while (true)
{
if is_goal (state)
then return SUCCESS
else add_to_back_of_queue (successors (state));
if queue == []
then report FAILURE;
state = queue [0]; // state = first item in queue
remove_first_item_from (queue);
}
}
Iterative deepening search l =0
Iterative deepening search l =1
Iterative deepening search l =2
Iterative deepening search l =3
Iterative deepening search
• Number of nodes generated in a depth-limited search to depth d with
branching factor b:
NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd
• GP
• Number of nodes generated in an iterative deepening search to depth d
with branching factor b:
NIDS = (d+1)b0 + d b^1 + (d-1)b^2 + … + 3bd-2 +2bd-1 + 1bd
• For b = 10, d = 5,
– NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111
–
– NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456
–
• Overhead = (123,456 - 111,111)/111,111 = 11%

More Related Content

Similar to Lecture 3 Problem Solving, DFS, BFS, IDF.pptx

Introduction to artificial intelligence
Introduction to artificial intelligenceIntroduction to artificial intelligence
Introduction to artificial intelligence
rishi ram khanal
 
uninformed search part 1.pptx
uninformed search part 1.pptxuninformed search part 1.pptx
uninformed search part 1.pptx
MUZAMILALI48
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
Kapil Dahal
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
Tianlu Wang
 
NEW-II.pptx
NEW-II.pptxNEW-II.pptx
NEW-II.pptx
jpradha86
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
VijayKumarLokanadam
 
Chap11 slides
Chap11 slidesChap11 slides
Chap11 slides
BaliThorat1
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
Acad
 
Search strategies BFS, DFS
Search strategies BFS, DFSSearch strategies BFS, DFS
Search strategies BFS, DFS
Kuppusamy P
 
Artificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge AcquisitionArtificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge Acquisition
The Integral Worm
 
AI IMPORTANT QUESTION
AI IMPORTANT QUESTIONAI IMPORTANT QUESTION
AI IMPORTANT QUESTION
FAREED UR RAHMAN .
 
Making sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methodsMaking sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methods
olivier gimenez
 
Research skills for Egyptology
Research skills for Egyptology Research skills for Egyptology
Research skills for Egyptology
Melanie Pitkin
 
Research Skills for Egyptology
Research Skills for EgyptologyResearch Skills for Egyptology
Research Skills for Egyptology
Melanie Pitkin
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
RaviKiranVarma4
 
Back tracking and branch and bound class 20
Back tracking and branch and bound class 20Back tracking and branch and bound class 20
Back tracking and branch and bound class 20Kumar
 
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
MrRRThirrunavukkaras
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
FellowBuddy.com
 
02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
vijaykumar95844
 
Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...
KarpagaPriya10
 

Similar to Lecture 3 Problem Solving, DFS, BFS, IDF.pptx (20)

Introduction to artificial intelligence
Introduction to artificial intelligenceIntroduction to artificial intelligence
Introduction to artificial intelligence
 
uninformed search part 1.pptx
uninformed search part 1.pptxuninformed search part 1.pptx
uninformed search part 1.pptx
 
Uninformed Search technique
Uninformed Search techniqueUninformed Search technique
Uninformed Search technique
 
08 uninformed search
08 uninformed search08 uninformed search
08 uninformed search
 
NEW-II.pptx
NEW-II.pptxNEW-II.pptx
NEW-II.pptx
 
cs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptxcs-171-05-LocalSearch.pptx
cs-171-05-LocalSearch.pptx
 
Chap11 slides
Chap11 slidesChap11 slides
Chap11 slides
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Search strategies BFS, DFS
Search strategies BFS, DFSSearch strategies BFS, DFS
Search strategies BFS, DFS
 
Artificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge AcquisitionArtificial Intelligence: Knowledge Acquisition
Artificial Intelligence: Knowledge Acquisition
 
AI IMPORTANT QUESTION
AI IMPORTANT QUESTIONAI IMPORTANT QUESTION
AI IMPORTANT QUESTION
 
Making sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methodsMaking sense of citizen science data: A review of methods
Making sense of citizen science data: A review of methods
 
Research skills for Egyptology
Research skills for Egyptology Research skills for Egyptology
Research skills for Egyptology
 
Research Skills for Egyptology
Research Skills for EgyptologyResearch Skills for Egyptology
Research Skills for Egyptology
 
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptxPPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
PPT ON INTRODUCTION TO AI- UNIT-1-PART-2.pptx
 
Back tracking and branch and bound class 20
Back tracking and branch and bound class 20Back tracking and branch and bound class 20
Back tracking and branch and bound class 20
 
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
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
 
Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...Searching is the universal technique of problem solving in Artificial Intelli...
Searching is the universal technique of problem solving in Artificial Intelli...
 

Recently uploaded

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
takuyayamamoto1800
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Shahin Sheidaei
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
Globus
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
Matt Welsh
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
abdulrafaychaudhry
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
Globus
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
Roshan Dwivedi
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Globus
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate
 

Recently uploaded (20)

Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamOpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoam
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...
 
Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024Globus Compute Introduction - GlobusWorld 2024
Globus Compute Introduction - GlobusWorld 2024
 
Large Language Models and the End of Programming
Large Language Models and the End of ProgrammingLarge Language Models and the End of Programming
Large Language Models and the End of Programming
 
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Pro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp BookPro Unity Game Development with C-sharp Book
Pro Unity Game Development with C-sharp Book
 
Enhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdfEnhancing Research Orchestration Capabilities at ORNL.pdf
Enhancing Research Orchestration Capabilities at ORNL.pdf
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
Launch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in MinutesLaunch Your Streaming Platforms in Minutes
Launch Your Streaming Platforms in Minutes
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...Developing Distributed High-performance Computing Capabilities of an Open Sci...
Developing Distributed High-performance Computing Capabilities of an Open Sci...
 
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket ManagementUtilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
Utilocate provides Smarter, Better, Faster, Safer Locate Ticket Management
 

Lecture 3 Problem Solving, DFS, BFS, IDF.pptx

  • 1. Lecture 3 Note: Some slides and/or pictures are adapted from Lecture slides / Books of • Dr Zafar Alvi. • Text Book - Aritificial Intelligence Illuminated by Ben Coppin, Narosa Publishers. • Ref Books •Artificial Intelligence- Structures & Strategies for Complex Problem Solving by George F. Luger, 4th edition, Pearson Education. • Artificial Intelligence A Modern Approach by Stuart Russell & Peter Norvig. •Artificial Intelligence, Third Edition by Patrick Henry Winston
  • 2. Outline • Problems and their representation • Goal Driven VS Data Driven • Properties of search Methods • Tree search algorithm – Depth First algorithm – Breadth First algorithm – Iterative Deepening algorithm
  • 3. Problems and their Representations • Three men and three lions are on one side of a river, with a boat. They all want to get to the other side of the river. The boat can only hold one or two at a time. At no time should there be more lions than men on either side of the river, as this would probably result in the men being eaten. • Representation could be 3, 3, 1 0, 0, 0
  • 4. Problems and their Representations • Traveling Salesman problem (NP complete)
  • 5. Problems and their Representations • Traversing a Maze
  • 6. Data Driven or 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. • 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.
  • 7. Properties of Search Methods • Complexity • Completeness • Optimality • Admissibility • Irrevocability
  • 8. Complexity • It is useful to describe how efficient that method is, over time and space. • The time complexity of a method is related to the length of time that the method would take to find a goal state. • The space complexity is related to the amount of memory that the method needs to use.
  • 9. Completeness • A search method is described as being complete if it is guaranteed to find a goal state if one exists. • A method that is not complete has the disadvantage that it cannot necessarily be believed if it reports that no solution exists.
  • 10. Optimality • A search method is optimal if it finds a solution in the quickest possible time.
  • 11. Admissibility • An algorithm is then defined as admissible if it is guaranteed to find the best solution.
  • 12. Irrevocability • Methods that do not use backtracking, and which therefore examine just one path, are described as irrevocable. • Irrevocable search methods will often find suboptimal solutions to problems because they tend to be fooled by local optima— solutions that look good locally but are less favorable when compared with other solutions elsewhere in the search space.
  • 13. Tree search algorithms • Basic idea: – offline, simulated exploration of state space by generating successors of already-explored
  • 17. Uninformed search strategies • Uninformed search strategies use only the information available in the problem definition – Depth-first search – Breadth-first search – Iterative deepening search – etc
  • 18. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 19. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 20. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 21. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 22. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 23. Depth-first search • Expand deepest unexpanded node • Implementation: – fringe = LIFO queue, i.e., put successors at front –
  • 24. Depth-first search • Expand deepest unexpanded node • Implementation: – fringe = LIFO queue, i.e., put successors at front –
  • 25. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 26. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 27. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 28. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 29. Depth-first search • Expand deepest unexpanded node • Implementation: – put successors at front –
  • 30. Depth-first search 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); } }
  • 31.
  • 32. Breadth-first search • Expand shallowest unexpanded node • Implementation: – new successors go at end –
  • 33. Breadth-first search • Expand shallowest unexpanded node • Implementation: – new successors go at end –
  • 34. Breadth-first search • Expand shallowest unexpanded node • Implementation: – new successors go at end –
  • 35. Breadth-first search • Expand shallowest unexpanded node • Implementation: – fringe is a FIFO queue, i.e., new successors go at end –
  • 36. Breadth-first search Function breadth () { queue = []; // initialize an empty queue state = root_node; // initialize the start state while (true) { if is_goal (state) then return SUCCESS else add_to_back_of_queue (successors (state)); if queue == [] then report FAILURE; state = queue [0]; // state = first item in queue remove_first_item_from (queue); } }
  • 37.
  • 42. Iterative deepening search • Number of nodes generated in a depth-limited search to depth d with branching factor b: NDLS = b0 + b1 + b2 + … + bd-2 + bd-1 + bd • GP • Number of nodes generated in an iterative deepening search to depth d with branching factor b: NIDS = (d+1)b0 + d b^1 + (d-1)b^2 + … + 3bd-2 +2bd-1 + 1bd • For b = 10, d = 5, – NDLS = 1 + 10 + 100 + 1,000 + 10,000 + 100,000 = 111,111 – – NIDS = 6 + 50 + 400 + 3,000 + 20,000 + 100,000 = 123,456 – • Overhead = (123,456 - 111,111)/111,111 = 11%