SlideShare une entreprise Scribd logo
1  sur  36
Télécharger pour lire hors ligne
Search Problems
Palacode Narayana Iyer Anantharaman
gmail: Narayana dot Anantharaman
12 Aug 2017
Credits
• The figures pertaining to Romania maps are referred/copied from Peter Norvig,
Sebastian Thrun, Russel books and Udacity courses.
• Some of the figures are attributable to the EDX AI by Columbia University
• A big THANKS to the original authors for these figures and wonderfully articulated
concepts through their books and courses.
Agents
• Reflex Agents
• Action depends only on the current input or percept
• Goal based agents
• Agents attempt to achieve a goal through a series of actions
• Agents consider the impact of actions on future states
• Often the requirement is not only to reach the goal state but do so as per an optimality
condition
• Approach: Search through the solution space
Examples : Finding the exit out of a maze
Example: Eight Queen Problem
• On the chess board place the 8 queens so that
no queen is attacked by any other queen
• Number of possible sequences: 64 * 63 * 62…*
57 = 1.8 × 1014
Problem Solving Approach
• Define the problem
• Formulate the goal
• Problem formulation
• Solve the problem as a two
stage process
• Perform the search through
the search space
• Execute the action
Defining the problem
• Initial State
• ACTIONS(s) = {a1, a2…an} set of possible actions the agent can execute when it is
in a particular state – possible actions may depend on the state
• RESULT(s, a) = s’
• GOALTEST(s) = True if it the state s is a goal state or not
• PATHCOST(path) = cost of the path
• STEPCOST(s, a, s’) = n
Problem Formulation: Arad to Bucharest
• Goal: Reach Bucharest from
Arad
• State Space: Cities
• Initial state: Arad
• Actions: Go to adjacent city
with cost = distance
• Goal test: Is the state we
reached == Bucharest?
Example
• Problem of going from Arad to Bucharest
• All cities constitute the state space, we need to navigate through the state space
and reach the goal
• In our case Bucharest is the goal state and all other states are non-goal state
• There are many possible actions that we can take when in a given state
• Assume each edge is a path of length 1, we can compute the number of edges to
traverse before reaching the goal state
Regions
• Explored
• Refers to the states already explored
• Frontier
• Farthest point in the explored space, also called fringe
• It is the leaves of the partially constructed tree
• This constitutes the partial plan as we explore through the search space
• Unexplored
• Unexplored states
Tree Search
Fig Credits: EDX AI Course –
Columbia University
Exercise
• Draw the tree for the Arad to
Bucharest problem
• Build the tree one step at a
time and show the explored
states, frontier and
unexplored states
Graph Search : Avoid repeated visits to same state
Fig Credits: EDX AI Course –
Columbia University
Breadth First Search
Fig Credits: EDX AI Course –
Columbia University
DFS
Fig Credits: EDX AI Course –
Columbia University
DFS
Fig Credits: EDX AI Course –
Columbia University
Uniform Cost Search – cheapest path
• In the breadth first search algorithm we considered each edge to have same cost
• Breadth first search algorithm will find the shortest path to the goal state
• Now we can consider each edge to have some step cost
• Uniform cost search is guaranteed to find the cheapest path provided the paths
are non-negative
Uniform Cost Search Illustration
Uniform Cost Search : Cheapest cost solution
Fig Credits: EDX AI Course –
Columbia University
Optimality
• Out of the 3 algorithms we looked at, which satisfy optimality property? That is,
finding the best solution?
• Are they complete? – i.e if there is a goal somewhere, will the algorithm find it?
• Depth First: No guarantee it will find the optimal path, but has n nodes of storage
for frontier. If the tree has infinite nodes, the DFS is not complete either.
• Breadth First: Guaranteed optimality but requires 2 ** n nodes to keep the
explored paths
Uniform Cost Search
• The search process proceeds in an uniform manner
while exploring the search space towards the goal
• The search is not directed or guided
• If the goal is far away, the search wouldn’t find it
quickly enough.
• If we want to more efficiently find the goal, we need to
add more “knowledge” that directs the search process.
G
S
Informed Search
• The search for the goal state is
directed using some knowledge
• In our example, the piece of
knowledge we may add is the
shortest (straight line) distance
between each state to the goal state.
• If Bucharest is the goal state and if it is
towards the south east of the start state
Arad, it makes sense to direct the
search towards the south east first,
instead of trying all possible directions
Exercise
• Suppose you are to walk from this building to the main building how many ways
you can do that and which path you would select?
Greedy Best First Search
• Key Idea: Always expand the node that is closer
to the goal
• This runs in to problems when there are
obstacles (dead ends). As the search is greedy,
the solution may not be optimal
S
G
A* Search : Key idea
• Greedy best search may not satisfy optimality
• What might help is to combine the two approaches:
• “knowledge” that helps us to minimize the number of nodes to explore
• Uniform cost search that is guaranteed to find the path of minimum cost
• A* algorithm is based on this key idea
A* algorithm
• A* algorithm works by choosing to expand the node that has the minimum cost of a
function f, where f is defined as:
𝑓 = 𝑔 + ℎ 𝑤ℎ𝑒𝑟𝑒 𝑔 𝑖𝑠 𝑡ℎ𝑒 𝑝𝑎𝑡ℎ 𝑐𝑜𝑠𝑡 𝑎𝑛𝑑 ℎ 𝑖𝑠 𝑡ℎ𝑒 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑡𝑜 𝑔𝑜𝑎𝑙
𝑔 𝑝𝑎𝑡ℎ = 𝑝𝑎𝑡ℎ 𝑐𝑜𝑠𝑡, ℎ 𝑝𝑎𝑡ℎ = ℎ 𝑠 = 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑡𝑜 𝑡ℎ𝑒 𝑔𝑜𝑎𝑙
• g(x) ensures that the path to X from S is kept to minimum and h(s) helps keeping
focus on the goal
A* Algorithm Example
Fig Credits: http://cs-alb-pc3.massey.ac.nz/notes/59302/all.html
A* Search Illustration
Fig Credits: http://cs-alb-pc3.massey.ac.nz/notes/59302/all.html
Constraints on h-function
• Is the algorithm guaranteed to find the optimal path? : It depends on the h-
function
• A* algorithm finds the lowest cost path if: h(s) < true cost
• h should never overestimate the distance to the goal – that is h should be
optimistic. This is referred as h being admissible.
• Since in our case, the heuristic is to choose h as the straight line distance, the
required condition is satisfied
Admissiblity Intuition
• We have: f = g + h and at the goal state h(s) = 0.
• Hence at the goal state : f = g. That is, the total estimated distance is exactly same
as the path computed.
• Our algorithm always selects the node to expand based on the path cost f.
• Any other node in the frontier has a higher cost compared to the selected node
that has g and h.
• By stipulating that h is the shortest distance, what we are saying is that no other
node in the frontier can have a distance to goal smaller than the selected node.
State Spaces
• State spaces can be more diverse, not just the cities that we just discussed
• They also can have abstract properties, not just coordinates information
• Consider the problem of a vacuum cleaner that can be in one of the 2 chambers.
Each chamber may have dirt or not. How many states this system represent and
what are the state transitions?
Exercise
• What is the size of the state space when:
• There are 10 chambers, each can be clean or dirty
• The vacuum cleaner has a power switch with 3 positions (On/Off/Sleep)
• The machine also has a camera that has 2 positions
• Brush height can be in one of 5 positions
Sliding Blocks Problem
• Heuristics (h)
• h1 : # misplaced blocks
• h2 : Sum(distance of blocks to their right
position)
• Are they admissible heuristics?
• How do we arrive at the “right” heuristics?
Exercise
• Implement a solution to the Sliding block puzzle. Assume a 3 x 3 grid with blocks
1 to 8 and a blank block. Use BFS and A* algorithms.
• What is the size of state space?
Sliding puzzle heuristics
• Key rule:
A block can move from A to B if (A is adjacent to B) AND B is blank
• By crossing out B, we get the heuristic h2
• By also crossing out the first part of the rule we get h1
• We can then treat the problem as the minimization problem
Summary: Problem Solving using Search
• The methodology works for problems that have the following characteristics:
• Fully observable
• Known
• Discrete
• Deterministic
• Static
• We will look at Probability Theory and other techniques that help address
partially observable, stochastic and dynamic natured problems

Contenu connexe

Tendances

Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
Luigi Ceccaroni
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
Rushdi Shams
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
Nilu Desai
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI
Bharat Bhushan
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
JenishaR1
 

Tendances (20)

Local search algorithm
Local search algorithmLocal search algorithm
Local search algorithm
 
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)
 
Hill climbing
Hill climbingHill climbing
Hill climbing
 
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
 
Heuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligenceHeuristic search-in-artificial-intelligence
Heuristic search-in-artificial-intelligence
 
2. forward chaining and backward chaining
2. forward chaining and backward chaining2. forward chaining and backward chaining
2. forward chaining and backward chaining
 
search strategies in artificial intelligence
search strategies in artificial intelligencesearch strategies in artificial intelligence
search strategies in artificial intelligence
 
Solving problems by searching
Solving problems by searchingSolving problems by searching
Solving problems by searching
 
A* algorithm
A* algorithmA* algorithm
A* algorithm
 
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
 
Propositional logic
Propositional logicPropositional logic
Propositional logic
 
Informed and Uninformed search Strategies
Informed and Uninformed search StrategiesInformed and Uninformed search Strategies
Informed and Uninformed search Strategies
 
Adversarial search
Adversarial searchAdversarial search
Adversarial search
 
Heuristics Search Techniques in AI
Heuristics Search Techniques in AI Heuristics Search Techniques in AI
Heuristics Search Techniques in AI
 
Informed search algorithms.pptx
Informed search algorithms.pptxInformed search algorithms.pptx
Informed search algorithms.pptx
 
A* Search Algorithm
A* Search AlgorithmA* Search Algorithm
A* Search Algorithm
 
Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}Heuristic Search Techniques {Artificial Intelligence}
Heuristic Search Techniques {Artificial Intelligence}
 
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...AI_Session 11: searching with Non-Deterministic Actions and partial observati...
AI_Session 11: searching with Non-Deterministic Actions and partial observati...
 
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdfUNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
UNIT - I PROBLEM SOLVING AGENTS and EXAMPLES.pptx.pdf
 
4 informed-search
4 informed-search4 informed-search
4 informed-search
 

Similaire à Search problems in Artificial Intelligence

Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
Swagat Praharaj
 
Artificial intelligence(06)
Artificial intelligence(06)Artificial intelligence(06)
Artificial intelligence(06)
Nazir Ahmed
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
kitsenthilkumarcse
 

Similaire à Search problems in Artificial Intelligence (20)

Introduction to artificial intelligence
Introduction to artificial intelligenceIntroduction to artificial intelligence
Introduction to artificial intelligence
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Lecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptxLecture 3 Problem Solving.pptx
Lecture 3 Problem Solving.pptx
 
Lecture 3 problem solving
Lecture 3   problem solvingLecture 3   problem solving
Lecture 3 problem solving
 
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...
 
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
 
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdfAI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
AI3391 ARTIFICIAL INTELLIGENCE UNIT II notes.pdf
 
Artificial intelligence(04)
Artificial intelligence(04)Artificial intelligence(04)
Artificial intelligence(04)
 
Heuristic or informed search
Heuristic or informed searchHeuristic or informed search
Heuristic or informed search
 
Heuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptxHeuristic Searching Algorithms Artificial Intelligence.pptx
Heuristic Searching Algorithms Artificial Intelligence.pptx
 
lecture 6 AI - A star.pdf
lecture 6 AI - A star.pdflecture 6 AI - A star.pdf
lecture 6 AI - A star.pdf
 
Artificial intelligence(06)
Artificial intelligence(06)Artificial intelligence(06)
Artificial intelligence(06)
 
Artificial intelligence(06)
Artificial intelligence(06)Artificial intelligence(06)
Artificial intelligence(06)
 
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
What is A * Search? What is Heuristic Search? What is Tree search Algorithm?
 
Informed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptxInformed Search Techniques new kirti L 8.pptx
Informed Search Techniques new kirti L 8.pptx
 
uninformed search part 2.pptx
uninformed search part 2.pptxuninformed search part 2.pptx
uninformed search part 2.pptx
 
Chap11 slides
Chap11 slidesChap11 slides
Chap11 slides
 
3.informed search
3.informed search3.informed search
3.informed search
 
Searching
SearchingSearching
Searching
 
Problem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptxProblem solving in Artificial Intelligence.pptx
Problem solving in Artificial Intelligence.pptx
 

Plus de ananth

Plus de ananth (20)

Generative Adversarial Networks : Basic architecture and variants
Generative Adversarial Networks : Basic architecture and variantsGenerative Adversarial Networks : Basic architecture and variants
Generative Adversarial Networks : Basic architecture and variants
 
Convolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular ArchitecturesConvolutional Neural Networks : Popular Architectures
Convolutional Neural Networks : Popular Architectures
 
Foundations: Artificial Neural Networks
Foundations: Artificial Neural NetworksFoundations: Artificial Neural Networks
Foundations: Artificial Neural Networks
 
Overview of Convolutional Neural Networks
Overview of Convolutional Neural NetworksOverview of Convolutional Neural Networks
Overview of Convolutional Neural Networks
 
Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models Artificial Intelligence Course: Linear models
Artificial Intelligence Course: Linear models
 
An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier An Overview of Naïve Bayes Classifier
An Overview of Naïve Bayes Classifier
 
Mathematical Background for Artificial Intelligence
Mathematical Background for Artificial IntelligenceMathematical Background for Artificial Intelligence
Mathematical Background for Artificial Intelligence
 
Introduction to Artificial Intelligence
Introduction to Artificial IntelligenceIntroduction to Artificial Intelligence
Introduction to Artificial Intelligence
 
Word representation: SVD, LSA, Word2Vec
Word representation: SVD, LSA, Word2VecWord representation: SVD, LSA, Word2Vec
Word representation: SVD, LSA, Word2Vec
 
Deep Learning For Speech Recognition
Deep Learning For Speech RecognitionDeep Learning For Speech Recognition
Deep Learning For Speech Recognition
 
Overview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language ProcessingOverview of TensorFlow For Natural Language Processing
Overview of TensorFlow For Natural Language Processing
 
Convolutional Neural Networks: Part 1
Convolutional Neural Networks: Part 1Convolutional Neural Networks: Part 1
Convolutional Neural Networks: Part 1
 
Machine Learning Lecture 3 Decision Trees
Machine Learning Lecture 3 Decision TreesMachine Learning Lecture 3 Decision Trees
Machine Learning Lecture 3 Decision Trees
 
Machine Learning Lecture 2 Basics
Machine Learning Lecture 2 BasicsMachine Learning Lecture 2 Basics
Machine Learning Lecture 2 Basics
 
Introduction To Applied Machine Learning
Introduction To Applied Machine LearningIntroduction To Applied Machine Learning
Introduction To Applied Machine Learning
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
 
MaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - OverviewMaxEnt (Loglinear) Models - Overview
MaxEnt (Loglinear) Models - Overview
 
An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)An overview of Hidden Markov Models (HMM)
An overview of Hidden Markov Models (HMM)
 
L06 stemmer and edit distance
L06 stemmer and edit distanceL06 stemmer and edit distance
L06 stemmer and edit distance
 
L05 language model_part2
L05 language model_part2L05 language model_part2
L05 language model_part2
 

Dernier

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
jaanualu31
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
AldoGarca30
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
Epec Engineered Technologies
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 

Dernier (20)

Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills KuwaitKuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
Kuwait City MTP kit ((+919101817206)) Buy Abortion Pills Kuwait
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Online electricity billing project report..pdf
Online electricity billing project report..pdfOnline electricity billing project report..pdf
Online electricity billing project report..pdf
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
NO1 Top No1 Amil Baba In Azad Kashmir, Kashmir Black Magic Specialist Expert ...
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
AIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech studentsAIRCANVAS[1].pdf mini project for btech students
AIRCANVAS[1].pdf mini project for btech students
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
COST-EFFETIVE  and Energy Efficient BUILDINGS ptxCOST-EFFETIVE  and Energy Efficient BUILDINGS ptx
COST-EFFETIVE and Energy Efficient BUILDINGS ptx
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 

Search problems in Artificial Intelligence

  • 1. Search Problems Palacode Narayana Iyer Anantharaman gmail: Narayana dot Anantharaman 12 Aug 2017
  • 2. Credits • The figures pertaining to Romania maps are referred/copied from Peter Norvig, Sebastian Thrun, Russel books and Udacity courses. • Some of the figures are attributable to the EDX AI by Columbia University • A big THANKS to the original authors for these figures and wonderfully articulated concepts through their books and courses.
  • 3. Agents • Reflex Agents • Action depends only on the current input or percept • Goal based agents • Agents attempt to achieve a goal through a series of actions • Agents consider the impact of actions on future states • Often the requirement is not only to reach the goal state but do so as per an optimality condition • Approach: Search through the solution space
  • 4. Examples : Finding the exit out of a maze
  • 5. Example: Eight Queen Problem • On the chess board place the 8 queens so that no queen is attacked by any other queen • Number of possible sequences: 64 * 63 * 62…* 57 = 1.8 × 1014
  • 6. Problem Solving Approach • Define the problem • Formulate the goal • Problem formulation • Solve the problem as a two stage process • Perform the search through the search space • Execute the action
  • 7. Defining the problem • Initial State • ACTIONS(s) = {a1, a2…an} set of possible actions the agent can execute when it is in a particular state – possible actions may depend on the state • RESULT(s, a) = s’ • GOALTEST(s) = True if it the state s is a goal state or not • PATHCOST(path) = cost of the path • STEPCOST(s, a, s’) = n
  • 8. Problem Formulation: Arad to Bucharest • Goal: Reach Bucharest from Arad • State Space: Cities • Initial state: Arad • Actions: Go to adjacent city with cost = distance • Goal test: Is the state we reached == Bucharest?
  • 9. Example • Problem of going from Arad to Bucharest • All cities constitute the state space, we need to navigate through the state space and reach the goal • In our case Bucharest is the goal state and all other states are non-goal state • There are many possible actions that we can take when in a given state • Assume each edge is a path of length 1, we can compute the number of edges to traverse before reaching the goal state
  • 10. Regions • Explored • Refers to the states already explored • Frontier • Farthest point in the explored space, also called fringe • It is the leaves of the partially constructed tree • This constitutes the partial plan as we explore through the search space • Unexplored • Unexplored states
  • 11. Tree Search Fig Credits: EDX AI Course – Columbia University
  • 12. Exercise • Draw the tree for the Arad to Bucharest problem • Build the tree one step at a time and show the explored states, frontier and unexplored states
  • 13. Graph Search : Avoid repeated visits to same state Fig Credits: EDX AI Course – Columbia University
  • 14. Breadth First Search Fig Credits: EDX AI Course – Columbia University
  • 15. DFS Fig Credits: EDX AI Course – Columbia University
  • 16. DFS Fig Credits: EDX AI Course – Columbia University
  • 17. Uniform Cost Search – cheapest path • In the breadth first search algorithm we considered each edge to have same cost • Breadth first search algorithm will find the shortest path to the goal state • Now we can consider each edge to have some step cost • Uniform cost search is guaranteed to find the cheapest path provided the paths are non-negative
  • 18. Uniform Cost Search Illustration
  • 19. Uniform Cost Search : Cheapest cost solution Fig Credits: EDX AI Course – Columbia University
  • 20. Optimality • Out of the 3 algorithms we looked at, which satisfy optimality property? That is, finding the best solution? • Are they complete? – i.e if there is a goal somewhere, will the algorithm find it? • Depth First: No guarantee it will find the optimal path, but has n nodes of storage for frontier. If the tree has infinite nodes, the DFS is not complete either. • Breadth First: Guaranteed optimality but requires 2 ** n nodes to keep the explored paths
  • 21. Uniform Cost Search • The search process proceeds in an uniform manner while exploring the search space towards the goal • The search is not directed or guided • If the goal is far away, the search wouldn’t find it quickly enough. • If we want to more efficiently find the goal, we need to add more “knowledge” that directs the search process. G S
  • 22. Informed Search • The search for the goal state is directed using some knowledge • In our example, the piece of knowledge we may add is the shortest (straight line) distance between each state to the goal state. • If Bucharest is the goal state and if it is towards the south east of the start state Arad, it makes sense to direct the search towards the south east first, instead of trying all possible directions
  • 23. Exercise • Suppose you are to walk from this building to the main building how many ways you can do that and which path you would select?
  • 24. Greedy Best First Search • Key Idea: Always expand the node that is closer to the goal • This runs in to problems when there are obstacles (dead ends). As the search is greedy, the solution may not be optimal S G
  • 25. A* Search : Key idea • Greedy best search may not satisfy optimality • What might help is to combine the two approaches: • “knowledge” that helps us to minimize the number of nodes to explore • Uniform cost search that is guaranteed to find the path of minimum cost • A* algorithm is based on this key idea
  • 26. A* algorithm • A* algorithm works by choosing to expand the node that has the minimum cost of a function f, where f is defined as: 𝑓 = 𝑔 + ℎ 𝑤ℎ𝑒𝑟𝑒 𝑔 𝑖𝑠 𝑡ℎ𝑒 𝑝𝑎𝑡ℎ 𝑐𝑜𝑠𝑡 𝑎𝑛𝑑 ℎ 𝑖𝑠 𝑡ℎ𝑒 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑡𝑜 𝑔𝑜𝑎𝑙 𝑔 𝑝𝑎𝑡ℎ = 𝑝𝑎𝑡ℎ 𝑐𝑜𝑠𝑡, ℎ 𝑝𝑎𝑡ℎ = ℎ 𝑠 = 𝑒𝑠𝑡𝑖𝑚𝑎𝑡𝑒𝑑 𝑑𝑖𝑠𝑡𝑎𝑛𝑐𝑒 𝑡𝑜 𝑡ℎ𝑒 𝑔𝑜𝑎𝑙 • g(x) ensures that the path to X from S is kept to minimum and h(s) helps keeping focus on the goal
  • 27. A* Algorithm Example Fig Credits: http://cs-alb-pc3.massey.ac.nz/notes/59302/all.html
  • 28. A* Search Illustration Fig Credits: http://cs-alb-pc3.massey.ac.nz/notes/59302/all.html
  • 29. Constraints on h-function • Is the algorithm guaranteed to find the optimal path? : It depends on the h- function • A* algorithm finds the lowest cost path if: h(s) < true cost • h should never overestimate the distance to the goal – that is h should be optimistic. This is referred as h being admissible. • Since in our case, the heuristic is to choose h as the straight line distance, the required condition is satisfied
  • 30. Admissiblity Intuition • We have: f = g + h and at the goal state h(s) = 0. • Hence at the goal state : f = g. That is, the total estimated distance is exactly same as the path computed. • Our algorithm always selects the node to expand based on the path cost f. • Any other node in the frontier has a higher cost compared to the selected node that has g and h. • By stipulating that h is the shortest distance, what we are saying is that no other node in the frontier can have a distance to goal smaller than the selected node.
  • 31. State Spaces • State spaces can be more diverse, not just the cities that we just discussed • They also can have abstract properties, not just coordinates information • Consider the problem of a vacuum cleaner that can be in one of the 2 chambers. Each chamber may have dirt or not. How many states this system represent and what are the state transitions?
  • 32. Exercise • What is the size of the state space when: • There are 10 chambers, each can be clean or dirty • The vacuum cleaner has a power switch with 3 positions (On/Off/Sleep) • The machine also has a camera that has 2 positions • Brush height can be in one of 5 positions
  • 33. Sliding Blocks Problem • Heuristics (h) • h1 : # misplaced blocks • h2 : Sum(distance of blocks to their right position) • Are they admissible heuristics? • How do we arrive at the “right” heuristics?
  • 34. Exercise • Implement a solution to the Sliding block puzzle. Assume a 3 x 3 grid with blocks 1 to 8 and a blank block. Use BFS and A* algorithms. • What is the size of state space?
  • 35. Sliding puzzle heuristics • Key rule: A block can move from A to B if (A is adjacent to B) AND B is blank • By crossing out B, we get the heuristic h2 • By also crossing out the first part of the rule we get h1 • We can then treat the problem as the minimization problem
  • 36. Summary: Problem Solving using Search • The methodology works for problems that have the following characteristics: • Fully observable • Known • Discrete • Deterministic • Static • We will look at Probability Theory and other techniques that help address partially observable, stochastic and dynamic natured problems