SlideShare a Scribd company logo
Problem SolvingProblem Solving
and Searchand Search
Introduction to Artificial
Intelligence
CS440/ECE448
Lecture 2
This LectureThis Lecture
• Problem representation
• Problem solving through search
ReadingReading
• Chapter 2
AnnouncementsAnnouncements
• My office hours: Weds. From 2 to 3pm.
The 8-puzzleThe 8-puzzle
2 8 3
1 6 4
7 5
Start
2
8
31
6
4
7 5
Goal
How do we goal from start configuration to the
goal configuration?
The corresponding search treeThe corresponding search tree
2 8 3
1 6 4
7 5
2 8 3
1 6 4
7 5
2 8 3
1
6
4
7 5
2 8 3
1 6 4
7 5
2 8 3
1
6 4
7 5
2 8 3
1
6
4
7 5
2
8
3
1
6
4
7 5
2 8 3
1 6 4
7 5
Toy Problems and Real ProblemsToy Problems and Real Problems
• 8-puzzle
• Vacuum World
• Cryptarithmetic
• 8-queens
• The water jug problem
• Missionaries and Cannibals
• Towers of Hanoi
• Traveling salesman
• Robot navigation
• Process or assembly planning
• VLSI Layout
Problem Solving:Problem Solving:
• World State – values of all attributes of interest in the world.
• State Space – the set of all possible world states.
• Operators – change one state into another; cost of applying
operator.
• Goal – An (often partial) world state or states; in an agent,
often implemented as a function of state and current percept.
• Initial State – The values of attributes that are in effect at the
beginning of a problem before any operators have been
applied.
• Note: The states and the operators define a directed (possibly
weighted) graph.
• Solution (path) – a sequence of operators leading from the initial
state to a goal state.
• Path cost – e.g. sum of distances, number of operators executed…
In the real worldIn the real world
• The real world is absurdly complex.
– Real state space must be abstracted for problem solving.
– An abstract state is equivalent to a set of real states.
• Abstract operator is equivalent to a complex combination of
real actions.
– Robot operator: Move down hall – In practice, this
might involve a complex set of sensor and motor
activities.
• An abstract solution is equivalent to a set of real paths that
are solutions in the real world.
Example: The 8-puzzleExample: The 8-puzzle
• States:
• Operators:
• Goal Test:
• Path Cost:
• Constraints:
2 8 3
1 6 4
7 5
Start
2
8
31
6
4
7 5
Goal
3£ 3 array of integer values
Move tile number i left, right, up, down
= goal state (given)
1 per move
Can only move in a direction if that space is empty
Example: The 8-puzzleExample: The 8-puzzle
• States:
• Operators:
• Goal Test:
• Path Cost:
• Constraints:
2 8 3
1 6 4
7 5
Start
2
8
31
6
4
7 5
Goal
Integer location of tiles (ignore intermediate positions)
Move blank left, right, up, down
= goal state (given)
1 per move
Can only move blank in a direction if it stays in puzzle
Example: The 8-puzzleExample: The 8-puzzle
2 8 3
1 6 4
7 5
Start
2
8
31
6
4
7 5
Goal
Initial State = [4, 1, 3, 6, 9, 5, 7, 2]
Goal State = [1, 2, 3, 6, 9, 8, 7, 4]
1 2 3
4 5 6
7 8 9
Missionaries and cannibalsMissionaries and cannibals
• Three missionaries and three cannibals are on the
left bank of a river.
• There is one canoe which can hold one or two
people.
• Find a way to get everyone to the right bank,
without ever leaving a group of missionaries in
one place outnumbered by cannibals in that place.
Missionaries and cannibalsMissionaries and cannibals
• States: three numbers (i,j,k) representing the
number of missionaries, cannibals, and canoes on
the left bank of the river.
• Initial state: (3, 3, 1)
• Operators: take one missionary, one cannibal, two
missionaries, two cannibals, one missionary and
one cannibal across the river in a given direction
(I.e. ten operators).
• Goal Test: reached state (0, 0, 0)
• Path Cost: Number of crossings.
Missionaries and Cannibals
(3,3,1)
Missionaries and Cannibals
A missionary and cannibal cross
Missionaries and Cannibals
(2,2,0)
Missionaries and Cannibals
One missionary returns
Missionaries and Cannibals
(3,2,1)
Missionaries and Cannibals
Two cannibals cross
Missionaries and Cannibals
(3,0,0)
Missionaries and Cannibals
A cannibal returns
Missionaries and Cannibals
(3,1,1)
Missionaries and Cannibals
Two missionaries cross
Missionaries and Cannibals
(1,1,0)
Missionaries and Cannibals
A missionary and cannibal return
Missionaries and Cannibals
(2,2,1)
Missionaries and Cannibals
Two Missionaries cross
Missionaries and Cannibals
(0,2,0)
Missionaries and Cannibals
A cannibal returns
Missionaries and Cannibals
(0,3,1)
Missionaries and Cannibals
Two cannibals cross
Missionaries and Cannibals
(0,1,0)
Missionaries and Cannibals
A cannibal returns
Missionaries and Cannibals
(0,2,1)
Missionaries and Cannibals
The last two cannibals cross
Missionaries and Cannibals
(0,0,0)
Water JugsWater Jugs
• You are given:
– a spigot,
– a 3 Gallon jug,
– a 4 Gallon jug.
• The goal: Get 2 gallons of water in the 4 gallon jug.
• Actions: Filling jugs from spigot, dumping water in jugs
onto ground, dumping 4 gallon into 3 gallon jug until 3
gallon jug is full. Dumping 3 gallon jug into 4 gallon jug
until empty or until 4 gallon is full, etc, etc.
Water JugsWater Jugs
• States: How full are the
two jugs?
• State Representation:
4G = ?
3G = ?
• Constraints:
0 ≤ 4G ≤ 4
0 ≤ 3G ≤ 3
• Initial State:
4G = 0
3G=0
• Goal State:
4G=2
OperatorsOperators
• F3: Fill the 3 Gallon jug from the tap.
• F4: Fill the 4 Gallon jug from the tap.
• E4: Empty the 4-Gallon jug on the ground.
• P43: Pour water from 4G jug into the 3G jug until
3G jug is full.
• P34: Pour water from 3G jug into the 4G jug until
4G jug is full or 3G is empty.
• F3: Fill the 3 Gallon jug from
the tap.
• F4: Fill the 4 Gallon jug from
the tap.
• E4: Empty the 4-Gallon jug
on the ground.
• P43: Pour water from 4G jug
into the 3G jug until 3G jug
is full.
• P34: Pour water from 3G jug
into the 4G jug until 4G jug
is full or 3G is empty.
Partial State Graph
And
Solution Path
Search MethodsSearch Methods
A Toy Example: A RomanianA Toy Example: A Romanian
HolidayHoliday
• State space: Cities in Romania
• Initial state: Town of Arad
• Goal: Airport in Bucharest
• Operators: Drive between cities
• Solution: Sequence of cities
• Path cost: number of cities, distance, time, fuel
The state spaceThe state space
Search AlgorithmsSearch Algorithms
• Basic Idea: Off-line exploration of state space by generating
successors of already-explored states (also known as
expanding states).
Function GENERAL-SEARCH (problem, strategy)
returns a solution or failure
Initialize the search tree using the initial state of problem
loop do
if there are no candidates for expansion, then return failure
Choose a leaf node for expansion according to strategy
if node contains goal state then return solution
else expand node and add resulting nodes to search tree.
end
Function GENERAL-SEARCH (problem, strategy)
returns a solution or failure
Initialize the search tree using the initial state of problem
loop do
if there are no candidates for expansion, then return failure
Choose a leaf node for expansion according to strategy
if node contains goal state then return solution
else expand node and add resulting nodes to search tree.
end
General Search ExampleGeneral Search Example
Arad
Zerind Sibiu Timisoara
Arad Oradea Fagaras Rimnicu Vilcea
Sibiu Bucharest
The solutionThe solution
Tree search exampleTree search example
Tree search exampleTree search example
Expanded node
Fringe
Tree search exampleTree search example
Implementation of Search AlgorithmsImplementation of Search Algorithms
Function GENERAL-SEARCH (problem, queing-fn)
returns a solution or failure
queue  MAKE-QUEUE (MAKE-NODE(INITIAL-STATE[problem]))
loop do
if queue is empty, then return failure
node  Remove-Front(queue)
if GOAL-TEST [problem] applied to STATE(node) succeeds
then return node
else queueQUEING-FN(queue,EXPAND(node,operators[problem]))
end
Function GENERAL-SEARCH (problem, queing-fn)
returns a solution or failure
queue  MAKE-QUEUE (MAKE-NODE(INITIAL-STATE[problem]))
loop do
if queue is empty, then return failure
node  Remove-Front(queue)
if GOAL-TEST [problem] applied to STATE(node) succeeds
then return node
else queueQUEING-FN(queue,EXPAND(node,operators[problem]))
end
Nodes: state, parent-node,operator, depth, path cost
States vs. nodesStates vs. nodes
• A state is a (representation of a) physical configuration.
• A node is a data structure constituting part of a search
tree includes parent, children, depth, path cost g(n).
• States do not have parents, children, depth, or path cost!
Search StrategiesSearch Strategies
A strategy is defined by picking the order of node expansion.
Strategies are evaluated along the following dimensions:
– completeness – does it always find a solution if one exists?
– optimality – does it always find a least-cost solution?
– time complexity – number of nodes generated/expanded
– space complexity – maximum number of nodes in memory
Time and space complexity are measured in terms of:
b – maximum branching factor of the search tree
d – depth of the least-cost solution
m – maximum depth of the state space (may be infinite)
Uninformed Search StrategiesUninformed Search Strategies
Uninformed (blind) strategies use only the
information available in the problem definition.
Informed search techniques which might have
additional information (e.g. a compass).
• Breadth-first search
• Uniform-cost search
• Depth-first search
• Depth-limited search
• Iterative deepening search

More Related Content

PPT
Innovative-Avishkar projects
PPT
Heuristc Search Techniques
PPTX
Diabetes Mellitus
PPTX
Hypertension
PPTX
Republic Act No. 11313 Safe Spaces Act (Bawal Bastos Law).pptx
PPTX
Power Point Presentation on Artificial Intelligence
PDF
Caça palavras - Bullying
Innovative-Avishkar projects
Heuristc Search Techniques
Diabetes Mellitus
Hypertension
Republic Act No. 11313 Safe Spaces Act (Bawal Bastos Law).pptx
Power Point Presentation on Artificial Intelligence
Caça palavras - Bullying

What's hot (20)

PPTX
Bruteforce algorithm
PPTX
Knapsack Problem
PPT
Greedy Algorihm
PDF
A* Search Algorithm
PPTX
Lexical analysis - Compiler Design
PPTX
The n Queen Problem
PPTX
Webinar : P, NP, NP-Hard , NP - Complete problems
PPTX
Graph traversals in Data Structures
PPTX
Cost estimation for Query Optimization
PPTX
Merge sort algorithm power point presentation
PPT
predicate logic example
PPT
Binary Search
PPT
Heuristic Search Techniques {Artificial Intelligence}
PPT
01 knapsack using backtracking
PPTX
Dynamic programming
PPT
Intro automata theory
PPTX
Knowledge Engineering in FOL.
PPT
Pattern matching
PPTX
AI_Session 7 Greedy Best first search algorithm.pptx
PDF
I.BEST FIRST SEARCH IN AI
Bruteforce algorithm
Knapsack Problem
Greedy Algorihm
A* Search Algorithm
Lexical analysis - Compiler Design
The n Queen Problem
Webinar : P, NP, NP-Hard , NP - Complete problems
Graph traversals in Data Structures
Cost estimation for Query Optimization
Merge sort algorithm power point presentation
predicate logic example
Binary Search
Heuristic Search Techniques {Artificial Intelligence}
01 knapsack using backtracking
Dynamic programming
Intro automata theory
Knowledge Engineering in FOL.
Pattern matching
AI_Session 7 Greedy Best first search algorithm.pptx
I.BEST FIRST SEARCH IN AI
Ad

Viewers also liked (10)

PPTX
John paton
PDF
02 problem solving_search_control
PPT
Problem space
PPT
State Space Search(2)
PDF
Artificial Intelligence
PPT
(Radhika) presentation on chapter 2 ai
DOC
Chapter 2 (final)
PPT
Amit ppt
PPT
Artificial Intelligence
PDF
The Top Skills That Can Get You Hired in 2017
John paton
02 problem solving_search_control
Problem space
State Space Search(2)
Artificial Intelligence
(Radhika) presentation on chapter 2 ai
Chapter 2 (final)
Amit ppt
Artificial Intelligence
The Top Skills That Can Get You Hired in 2017
Ad

Similar to Rai practical presentations. (20)

PPTX
AI-04 Production System - Search Problem.pptx
PPT
Various Uninform Search Strategies in AI.ppt
PDF
03_UninformedSearch.pdf
PPT
Uninformed Search goal based agents Representing states and operations
PDF
Search-Beyond-Classical-no-exercise-answers.pdf
PPTX
UninformedSearch (2).pptx
PDF
Lecture 3 problem solving
PPT
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
PPT
Lecture 2
PPTX
unit 2.pptx
PPTX
PPTX
problem space and problem definition in ai
PDF
02LocalSearch.pdf
PDF
problem solve and resolving in ai domain , probloms
PDF
Ch 2 State Space Search - slides part 1.pdf
PPTX
Lecture 3 Problem Solving.pptx
PPTX
3. Module_2_Chapter_3hvghcyttrctrctfcf.pptx
PDF
chapter 2 Problem Solving.pdf
PPT
1 blind search
AI-04 Production System - Search Problem.pptx
Various Uninform Search Strategies in AI.ppt
03_UninformedSearch.pdf
Uninformed Search goal based agents Representing states and operations
Search-Beyond-Classical-no-exercise-answers.pdf
UninformedSearch (2).pptx
Lecture 3 problem solving
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
Lecture 2
unit 2.pptx
problem space and problem definition in ai
02LocalSearch.pdf
problem solve and resolving in ai domain , probloms
Ch 2 State Space Search - slides part 1.pdf
Lecture 3 Problem Solving.pptx
3. Module_2_Chapter_3hvghcyttrctrctfcf.pptx
chapter 2 Problem Solving.pdf
1 blind search

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
PPT on Performance Review to get promotions
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PDF
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Digital Logic Computer Design lecture notes
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPTX
Current and future trends in Computer Vision.pptx
PDF
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
Safety Seminar civil to be ensured for safe working.
Mohammad Mahdi Farshadian CV - Prospective PhD Student 2026
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPT on Performance Review to get promotions
CH1 Production IntroductoryConcepts.pptx
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Foundation to blockchain - A guide to Blockchain Tech
Enhancing Cyber Defense Against Zero-Day Attacks using Ensemble Neural Networks
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Digital Logic Computer Design lecture notes
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Current and future trends in Computer Vision.pptx
PRIZ Academy - 9 Windows Thinking Where to Invest Today to Win Tomorrow.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
CYBER-CRIMES AND SECURITY A guide to understanding

Rai practical presentations.

  • 1. Problem SolvingProblem Solving and Searchand Search Introduction to Artificial Intelligence CS440/ECE448 Lecture 2
  • 2. This LectureThis Lecture • Problem representation • Problem solving through search ReadingReading • Chapter 2 AnnouncementsAnnouncements • My office hours: Weds. From 2 to 3pm.
  • 3. The 8-puzzleThe 8-puzzle 2 8 3 1 6 4 7 5 Start 2 8 31 6 4 7 5 Goal How do we goal from start configuration to the goal configuration?
  • 4. The corresponding search treeThe corresponding search tree 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5 2 8 3 1 6 4 7 5
  • 5. Toy Problems and Real ProblemsToy Problems and Real Problems • 8-puzzle • Vacuum World • Cryptarithmetic • 8-queens • The water jug problem • Missionaries and Cannibals • Towers of Hanoi • Traveling salesman • Robot navigation • Process or assembly planning • VLSI Layout
  • 6. Problem Solving:Problem Solving: • World State – values of all attributes of interest in the world. • State Space – the set of all possible world states. • Operators – change one state into another; cost of applying operator. • Goal – An (often partial) world state or states; in an agent, often implemented as a function of state and current percept. • Initial State – The values of attributes that are in effect at the beginning of a problem before any operators have been applied. • Note: The states and the operators define a directed (possibly weighted) graph. • Solution (path) – a sequence of operators leading from the initial state to a goal state. • Path cost – e.g. sum of distances, number of operators executed…
  • 7. In the real worldIn the real world • The real world is absurdly complex. – Real state space must be abstracted for problem solving. – An abstract state is equivalent to a set of real states. • Abstract operator is equivalent to a complex combination of real actions. – Robot operator: Move down hall – In practice, this might involve a complex set of sensor and motor activities. • An abstract solution is equivalent to a set of real paths that are solutions in the real world.
  • 8. Example: The 8-puzzleExample: The 8-puzzle • States: • Operators: • Goal Test: • Path Cost: • Constraints: 2 8 3 1 6 4 7 5 Start 2 8 31 6 4 7 5 Goal 3£ 3 array of integer values Move tile number i left, right, up, down = goal state (given) 1 per move Can only move in a direction if that space is empty
  • 9. Example: The 8-puzzleExample: The 8-puzzle • States: • Operators: • Goal Test: • Path Cost: • Constraints: 2 8 3 1 6 4 7 5 Start 2 8 31 6 4 7 5 Goal Integer location of tiles (ignore intermediate positions) Move blank left, right, up, down = goal state (given) 1 per move Can only move blank in a direction if it stays in puzzle
  • 10. Example: The 8-puzzleExample: The 8-puzzle 2 8 3 1 6 4 7 5 Start 2 8 31 6 4 7 5 Goal Initial State = [4, 1, 3, 6, 9, 5, 7, 2] Goal State = [1, 2, 3, 6, 9, 8, 7, 4] 1 2 3 4 5 6 7 8 9
  • 11. Missionaries and cannibalsMissionaries and cannibals • Three missionaries and three cannibals are on the left bank of a river. • There is one canoe which can hold one or two people. • Find a way to get everyone to the right bank, without ever leaving a group of missionaries in one place outnumbered by cannibals in that place.
  • 12. Missionaries and cannibalsMissionaries and cannibals • States: three numbers (i,j,k) representing the number of missionaries, cannibals, and canoes on the left bank of the river. • Initial state: (3, 3, 1) • Operators: take one missionary, one cannibal, two missionaries, two cannibals, one missionary and one cannibal across the river in a given direction (I.e. ten operators). • Goal Test: reached state (0, 0, 0) • Path Cost: Number of crossings.
  • 14. Missionaries and Cannibals A missionary and cannibal cross
  • 16. Missionaries and Cannibals One missionary returns
  • 20. Missionaries and Cannibals A cannibal returns
  • 22. Missionaries and Cannibals Two missionaries cross
  • 24. Missionaries and Cannibals A missionary and cannibal return
  • 26. Missionaries and Cannibals Two Missionaries cross
  • 28. Missionaries and Cannibals A cannibal returns
  • 32. Missionaries and Cannibals A cannibal returns
  • 34. Missionaries and Cannibals The last two cannibals cross
  • 36. Water JugsWater Jugs • You are given: – a spigot, – a 3 Gallon jug, – a 4 Gallon jug. • The goal: Get 2 gallons of water in the 4 gallon jug. • Actions: Filling jugs from spigot, dumping water in jugs onto ground, dumping 4 gallon into 3 gallon jug until 3 gallon jug is full. Dumping 3 gallon jug into 4 gallon jug until empty or until 4 gallon is full, etc, etc.
  • 37. Water JugsWater Jugs • States: How full are the two jugs? • State Representation: 4G = ? 3G = ? • Constraints: 0 ≤ 4G ≤ 4 0 ≤ 3G ≤ 3 • Initial State: 4G = 0 3G=0 • Goal State: 4G=2
  • 38. OperatorsOperators • F3: Fill the 3 Gallon jug from the tap. • F4: Fill the 4 Gallon jug from the tap. • E4: Empty the 4-Gallon jug on the ground. • P43: Pour water from 4G jug into the 3G jug until 3G jug is full. • P34: Pour water from 3G jug into the 4G jug until 4G jug is full or 3G is empty.
  • 39. • F3: Fill the 3 Gallon jug from the tap. • F4: Fill the 4 Gallon jug from the tap. • E4: Empty the 4-Gallon jug on the ground. • P43: Pour water from 4G jug into the 3G jug until 3G jug is full. • P34: Pour water from 3G jug into the 4G jug until 4G jug is full or 3G is empty. Partial State Graph And Solution Path
  • 41. A Toy Example: A RomanianA Toy Example: A Romanian HolidayHoliday • State space: Cities in Romania • Initial state: Town of Arad • Goal: Airport in Bucharest • Operators: Drive between cities • Solution: Sequence of cities • Path cost: number of cities, distance, time, fuel
  • 42. The state spaceThe state space
  • 43. Search AlgorithmsSearch Algorithms • Basic Idea: Off-line exploration of state space by generating successors of already-explored states (also known as expanding states). Function GENERAL-SEARCH (problem, strategy) returns a solution or failure Initialize the search tree using the initial state of problem loop do if there are no candidates for expansion, then return failure Choose a leaf node for expansion according to strategy if node contains goal state then return solution else expand node and add resulting nodes to search tree. end Function GENERAL-SEARCH (problem, strategy) returns a solution or failure Initialize the search tree using the initial state of problem loop do if there are no candidates for expansion, then return failure Choose a leaf node for expansion according to strategy if node contains goal state then return solution else expand node and add resulting nodes to search tree. end
  • 44. General Search ExampleGeneral Search Example Arad Zerind Sibiu Timisoara Arad Oradea Fagaras Rimnicu Vilcea Sibiu Bucharest
  • 46. Tree search exampleTree search example
  • 47. Tree search exampleTree search example Expanded node Fringe
  • 48. Tree search exampleTree search example
  • 49. Implementation of Search AlgorithmsImplementation of Search Algorithms Function GENERAL-SEARCH (problem, queing-fn) returns a solution or failure queue  MAKE-QUEUE (MAKE-NODE(INITIAL-STATE[problem])) loop do if queue is empty, then return failure node  Remove-Front(queue) if GOAL-TEST [problem] applied to STATE(node) succeeds then return node else queueQUEING-FN(queue,EXPAND(node,operators[problem])) end Function GENERAL-SEARCH (problem, queing-fn) returns a solution or failure queue  MAKE-QUEUE (MAKE-NODE(INITIAL-STATE[problem])) loop do if queue is empty, then return failure node  Remove-Front(queue) if GOAL-TEST [problem] applied to STATE(node) succeeds then return node else queueQUEING-FN(queue,EXPAND(node,operators[problem])) end Nodes: state, parent-node,operator, depth, path cost
  • 50. States vs. nodesStates vs. nodes • A state is a (representation of a) physical configuration. • A node is a data structure constituting part of a search tree includes parent, children, depth, path cost g(n). • States do not have parents, children, depth, or path cost!
  • 51. Search StrategiesSearch Strategies A strategy is defined by picking the order of node expansion. Strategies are evaluated along the following dimensions: – completeness – does it always find a solution if one exists? – optimality – does it always find a least-cost solution? – time complexity – number of nodes generated/expanded – space complexity – maximum number of nodes in memory Time and space complexity are measured in terms of: b – maximum branching factor of the search tree d – depth of the least-cost solution m – maximum depth of the state space (may be infinite)
  • 52. Uninformed Search StrategiesUninformed Search Strategies Uninformed (blind) strategies use only the information available in the problem definition. Informed search techniques which might have additional information (e.g. a compass). • Breadth-first search • Uniform-cost search • Depth-first search • Depth-limited search • Iterative deepening search