SlideShare uma empresa Scribd logo
1 de 52
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

Mais conteĂşdo relacionado

Mais procurados

State Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxState Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxRSAISHANKAR
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)Tajim Md. Niamat Ullah Akhund
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agentsMegha Sharma
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structureAmey Kerkar
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemMohammad Imam Hossain
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDigiGurukul
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptarunsingh660
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AIvikas dhakane
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searchingLuigi Ceccaroni
 
8 queen problem
8 queen problem8 queen problem
8 queen problemNagajothiN1
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite AutomataRatnakar Mikkili
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptkarthikaparthasarath
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAndrew Ferlitsch
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithmvikas dhakane
 

Mais procurados (20)

Tic tac toe simple ai game
Tic tac toe simple ai gameTic tac toe simple ai game
Tic tac toe simple ai game
 
A* Algorithm
A* AlgorithmA* Algorithm
A* Algorithm
 
State Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptxState Space Search and Control Strategies in Artificial Intelligence.pptx
State Space Search and Control Strategies in Artificial Intelligence.pptx
 
AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)AI Lecture 4 (informed search and exploration)
AI Lecture 4 (informed search and exploration)
 
Problem solving agents
Problem solving agentsProblem solving agents
Problem solving agents
 
weak slot and filler structure
weak slot and filler structureweak slot and filler structure
weak slot and filler structure
 
AI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction ProblemAI 7 | Constraint Satisfaction Problem
AI 7 | Constraint Satisfaction Problem
 
Dempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th SemDempster Shafer Theory AI CSE 8th Sem
Dempster Shafer Theory AI CSE 8th Sem
 
Problem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.pptProblem reduction AND OR GRAPH & AO* algorithm.ppt
Problem reduction AND OR GRAPH & AO* algorithm.ppt
 
I. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AII. Mini-Max Algorithm in AI
I. Mini-Max Algorithm in AI
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
 
8 queen problem
8 queen problem8 queen problem
8 queen problem
 
AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)AI Lecture 3 (solving problems by searching)
AI Lecture 3 (solving problems by searching)
 
Introduction TO Finite Automata
Introduction TO Finite AutomataIntroduction TO Finite Automata
Introduction TO Finite Automata
 
Heuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.pptHeuristic Search Techniques Unit -II.ppt
Heuristic Search Techniques Unit -II.ppt
 
Branch and bound
Branch and boundBranch and bound
Branch and bound
 
Predicate logic
 Predicate logic Predicate logic
Predicate logic
 
AI - Local Search - Hill Climbing
AI - Local Search - Hill ClimbingAI - Local Search - Hill Climbing
AI - Local Search - Hill Climbing
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 

Destaque

John paton
John patonJohn paton
John patonslamerson
 
02 problem solving_search_control
02 problem solving_search_control02 problem solving_search_control
02 problem solving_search_controlPraveen Kumar
 
State Space Search(2)
State Space Search(2)State Space Search(2)
State Space Search(2)luzenith_g
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial IntelligenceBise Mond
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 aiRadhika Srinivasan
 
Amit ppt
Amit pptAmit ppt
Amit pptamitp26
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligenceu053675
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017LinkedIn
 

Destaque (10)

John paton
John patonJohn paton
John paton
 
02 problem solving_search_control
02 problem solving_search_control02 problem solving_search_control
02 problem solving_search_control
 
Problem space
Problem spaceProblem space
Problem space
 
State Space Search(2)
State Space Search(2)State Space Search(2)
State Space Search(2)
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai(Radhika) presentation on chapter 2 ai
(Radhika) presentation on chapter 2 ai
 
Chapter 2 (final)
Chapter 2 (final)Chapter 2 (final)
Chapter 2 (final)
 
Amit ppt
Amit pptAmit ppt
Amit ppt
 
Artificial Intelligence
Artificial IntelligenceArtificial Intelligence
Artificial Intelligence
 
The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017The Top Skills That Can Get You Hired in 2017
The Top Skills That Can Get You Hired in 2017
 

Semelhante a Rai practical presentations.

AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxPankaj Debbarma
 
03_UninformedSearch.pdf
03_UninformedSearch.pdf03_UninformedSearch.pdf
03_UninformedSearch.pdfkaxeca4096
 
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
 
UninformedSearch (2).pptx
UninformedSearch (2).pptxUninformedSearch (2).pptx
UninformedSearch (2).pptxSankarTerli
 
Lecture 3 problem solving
Lecture 3   problem solvingLecture 3   problem solving
Lecture 3 problem solvingVajira Thambawita
 
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekpavan402055
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptxGavy11
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsSlimAmiri
 
Ch 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfCh 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfKrishnaMadala1
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxAndrewKuziwakwasheMu
 
chapter 2 Problem Solving.pdf
chapter 2 Problem Solving.pdfchapter 2 Problem Solving.pdf
chapter 2 Problem Solving.pdfMeghaGupta952452
 
1 blind search
1 blind search1 blind search
1 blind searchRahel Amanda
 
Lec2 state space
Lec2 state spaceLec2 state space
Lec2 state spacePraveen Kumar
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.pptGauravWani20
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.pptjpradha86
 
16355694.ppt
16355694.ppt16355694.ppt
16355694.pptshohel rana
 

Semelhante a Rai practical presentations. (20)

AI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptxAI-04 Production System - Search Problem.pptx
AI-04 Production System - Search Problem.pptx
 
03_UninformedSearch.pdf
03_UninformedSearch.pdf03_UninformedSearch.pdf
03_UninformedSearch.pdf
 
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
 
UninformedSearch (2).pptx
UninformedSearch (2).pptxUninformedSearch (2).pptx
UninformedSearch (2).pptx
 
Lecture 3 problem solving
Lecture 3   problem solvingLecture 3   problem solving
Lecture 3 problem solving
 
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
unit 2.pptx
unit 2.pptxunit 2.pptx
unit 2.pptx
 
l2.pptx
l2.pptxl2.pptx
l2.pptx
 
02LocalSearch.pdf
02LocalSearch.pdf02LocalSearch.pdf
02LocalSearch.pdf
 
problem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , problomsproblem solve and resolving in ai domain , probloms
problem solve and resolving in ai domain , probloms
 
Ch 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdfCh 2 State Space Search - slides part 1.pdf
Ch 2 State Space Search - slides part 1.pdf
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
 
chapter 2 Problem Solving.pdf
chapter 2 Problem Solving.pdfchapter 2 Problem Solving.pdf
chapter 2 Problem Solving.pdf
 
1 blind search
1 blind search1 blind search
1 blind search
 
Lec2 state space
Lec2 state spaceLec2 state space
Lec2 state space
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.ppt
 
BeyondClassicalSearch.ppt
BeyondClassicalSearch.pptBeyondClassicalSearch.ppt
BeyondClassicalSearch.ppt
 
16355694.ppt
16355694.ppt16355694.ppt
16355694.ppt
 

Último

Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catcherssdickerson1
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionMebane Rash
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitterShivangiSharma879191
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptMadan Karki
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...121011101441
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfme23b1001
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEroselinkalist12
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - GuideGOPINATHS437943
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm Systemirfanmechengr
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvLewisJB
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction managementMariconPadriquez1
 

Último (20)

Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor CatchersTechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
TechTACÂŽ CFD Report Summary: A Comparison of Two Types of Tubing Anchor Catchers
 
US Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of ActionUS Department of Education FAFSA Week of Action
US Department of Education FAFSA Week of Action
 
8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter8251 universal synchronous asynchronous receiver transmitter
8251 universal synchronous asynchronous receiver transmitter
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Indian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.pptIndian Dairy Industry Present Status and.ppt
Indian Dairy Industry Present Status and.ppt
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...Instrumentation, measurement and control of bio process parameters ( Temperat...
Instrumentation, measurement and control of bio process parameters ( Temperat...
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Electronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdfElectronically Controlled suspensions system .pdf
Electronically Controlled suspensions system .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETEINFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
INFLUENCE OF NANOSILICA ON THE PROPERTIES OF CONCRETE
 
Transport layer issues and challenges - Guide
Transport layer issues and challenges - GuideTransport layer issues and challenges - Guide
Transport layer issues and challenges - Guide
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Class 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm SystemClass 1 | NFPA 72 | Overview Fire Alarm System
Class 1 | NFPA 72 | Overview Fire Alarm System
 
Work Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvvWork Experience-Dalton Park.pptxfvvvvvvv
Work Experience-Dalton Park.pptxfvvvvvvv
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
computer application and construction management
computer application and construction managementcomputer application and construction management
computer application and construction management
 

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