SlideShare une entreprise Scribd logo
1  sur  73
Search Problems

 Explorating Alternatives

R&N: Chap. 3, Sect. 3.1–2 + 3.6




                                  1
Example: 8-Puzzle

   8    2                 1   2   3

   3    4   7             4   5   6

   5    1   6             7   8

  Initial state           Goal state


          Search is about the
       exploration of alternatives
                                       2
Exploratory search is an old idea:
The Labyrinth and the Ariadne Thread

According to Greek mythology, Theseus came to Crete to slay the
Minotaur, a monster who lived in a Labyrinth. Ariadne gave Theseus a
ball of yarn which he unwound as he entered the Labyrinth. After
killing the Minotaur, Theseus traced the thread back to the entrance
of the Labyrinth, rejoined Ariadne, and successfully escaped Crete




                                                                  3
Since the dawn of civilization, puzzles and
games that require the exploration of
alternative paths have fascinated mankind
and have been considered a challenge for
human intelligence

 Chess originated in Persia and India
  about 4000 years ago
 Checkers appeared as early as 1600 B.C
  in Egyptian paintings
 Go originated in China over 3000 years
  ago
                                           4
5
15-Puzzle
 Introduced in 1878 by Sam Loyd, who dubbed
 himself “America’s greatest puzzle-expert”



 1    2    3    4

 5    6    7    8

 9    10   11   12

 13   14   15
                                              6
7
15-Puzzle
 Sam Loyd offered $1,000 of his own money to
 the first person who would solve the following
 problem:


 1    2    3    4           1   2    3    4

 5    6    7    8    ?      5   6    7    8

 9    10   11   12          9   10   11   12

 13   14   15              13   15   14
                                               8
But no one ever won the prize !!
                                   9
8-Puzzle: State Space

                             ...
             8   2   7

             3   4
 8   2       5   1   6

 3   4   7

 5   1   6   8       2       8   2
             3   4   7   3   4   7

             5   1   6   5   1   6


                                     10
8-Puzzle: Successor Function
              8   2   7

              3   4
              5   1   6



  8   2       8   2   7   8   2   7
  3   4   7   3   4   6   3       4

  5   1   6   5   1       5   1   6


                                      11
Stating a Problem as
a Search Problem

S                 State space S
     1            Successor function:
         3   2
                    x ∈ S → SUCCESSORS(x) ∈ 2S
                  Arc cost
                  Initial state s0
                  Goal test:
                    x∈S → GOAL?(x) =T or F


                                           12
State Graph
 It is defined as follows:
   • Each state is represented by a distinct
     node
   • An arc connects a node s to a node s’ if
     s’ ∈ SUCCESSORS(s)
 The state graph may contain more than
  one connected component


                                           13
14
Solution to the Search Problem
 A solution is a path connecting the initial
 node to a goal node (any one)




                                           15
16
Solution to the Search Problem
 A solution is a path connecting the initial
  to a goal node (any one)
 The cost of a path is the sum of the
  edge costs along this path
 An optimal solution is a solution path of
  minimum cost
 There might be no solution !

                                              17
18
How big is the state space of
the (n2-1)-puzzle?

 8-puzzle  9! = 362,880 states
 15-puzzle  16! ~ 1.3 x 1012 states
 24-puzzle  25! ~ 1025 states
 But only half of these states are
 reachable from any given state


                                        19
Permutation Inversions
 Let the goal be:              1   2     3   4
                                5   6     7   8
                                9 10 11 12
                                13 14 15

 Let ni be the number of tiles j < i that appear after tile i
    (from left to right and top to bottom)
   N = n2 + n3 + … + n15 + row number of empty tile

      1   2   3   4   n2 = 0    n3 = 0    n4 = 0
      5 10 7      8   n5 = 0    n6 = 0    n7 = 1
                      n8 = 1    n9 = 1    n10 = 4   N=7+4
      9   6   11 12
                      n11 = 0   n12 = 0   n13 = 0
     13 14 15         n14 = 0   n15 = 0                      20
 Proposition: (N mod 2) is invariant under
  any legal move of the empty tile
 Proof:
  • Any horizontal move of the empty tile
    leaves N unchanged
  • A vertical move of the empty tile changes
    N by an even increment

     1   2   3   4          1   2   3   4
     5   6       7          5   6 11 7
s=                   s’ =                   N(s’) = N(s) + 3 + 1
     9 10 11 8              9 10        8
     13 14 15 12            13 14 15 12
                                                             21
 Proposition: (N mod 2) is invariant under
 any legal move of the empty tile

  For a goal state g to be reachable
 from a state s, a necessary condition is
 that N(g) and N(s) have the same parity

 It can be shown that this is also a
 sufficient condition

  The state graph consists of two
 connected components of equal size
                                          22
15-Puzzle
Sam Loyd offered $1,000 of his own money to
the first person who would solve the following
problem:


1    2    3    4           1   2    3    4

5    6    7    8    ?      5   6    7    8

9    10   11   12          9   10   11   12

13   14   15              13   15   14

     N=4                       N=5
                                             So, the second state is
                                             not reachable from the
                                             first, and Sam Loyd took
                                             no risk with his money ...

                                                                    23
What is the Actual State Space?
•   The set of all states?
    [e.g., a set of 16! states for the 15-puzzle]
•   The set of all states from which a given goal
    state is reachable?
    [e.g., a set of 16!/2 states for the 15-puzzle]
•   The set of all states reachable from a given
    initial state?
In general, the answer is a)




                                                      24
What is the Actual State Space?
•   The set of all states?
    [e.g., a set of 16! states for the 15-puzzle]
•   The set of all states from which a given goal
    state is reachable?
    [e.g., a set of 16!/2 states for the 15-puzzle]
•   The set of all states reachable from a given
    initial state?
In general, the answer is a)
But a fast test determining whether a state is reachable
from another is very useful, as search-based problem
solvers are often very inefficient when a problem has no
solution
                                                      25
Stating a Problem as
a Search Problem

S                 State space S
     1            Successor function:
         3   2
                    x ∈ S → SUCCESSORS(x) ∈ 2S
                  Arc cost
                  Initial state s0
                  Goal test:
                    x∈S → GOAL?(x) =T or F
                  A solution is a path joining
                   the initial to a goal node
                                            26
Searching the State Space
                     Often it is not
                      feasible to build
                      a complete
                      representation
                      of the state
                      graph




                                    27
8-, 15-, 24-Puzzles
                  8-puzzle  362,880 states

                                       0.036 sec

       15-puzzle  1.3 x 1012 states

                           < 4 hours


24-puzzle  1025 states
                    > 109 years


                             100 millions states/sec

                                                       28
Searching the State Space
                     Often it is not
                        feasible to build
                        a complete
                        representation
                        of the state
                        graph
                       A problem solver
                        must construct a
                        solution by
                        exploring a small
                        portion of the
                        graph


                                      29
Searching the State Space




                            30
Searching the State Space




                     Search tree




                                   31
Searching the State Space




                     Search tree




                                   32
Searching the State Space




                     Search tree




                                   33
Searching the State Space




                     Search tree




                                   34
Searching the State Space




                     Search tree




                                   35
Simple Problem-Solving-Agent
Algorithm


     s0  sense/read initial state
     GOAL?  select/read goal test
     Succ  select/read successor function
     solution  search(s0, GOAL?, Succ)
     perform(solution)


                                              36
State Space
 Each state is an abstract representation
 of a collection of possible worlds sharing
 some crucial properties and differing on
 non-important details only
 E.g.: In assembly planning, a state does not
 define exactly the absolute position of each part




 The state space is discrete. It may be
 finite, or infinite                           37
Successor Function
 It implicitly represents all the actions
 that are feasible in each state




                                             38
Successor Function
 It implicitly represents all the actions
  that are feasible in each state
 Only the results of the actions (the
  successor states) and their costs are
  returned by the function
 The successor function is a “black box”:
  its content is unknown
 E.g., in assembly planning, the function does
 not say if it only allows two sub-assemblies to
 be merged or if it makes assumptions about
 subassembly stability                           39
Path Cost
 An arc cost is a positive number
 measuring the “cost” of performing the
 action corresponding to the arc, e.g.:
  • 1 in the 8-puzzle example
  • expected time to merge two sub-assemblies
 We will assume that for any given
 problem the cost c of an arc always
 verifies: c ≥ ε > 0, where ε is a constant


                                            40
Path Cost
 An arc cost is a positive number
 measuring the “cost” of performing the
 action corresponding to the arc, e.g.:
  • 1 in the 8-puzzle example
  • expected time to merge two sub-assemblies
 We will assume that for any given
 problem the cost c of an arc always
 verifies: c ≥ ε > 0, where ε is a constant
 [This condition guarantees that, if path becomes
 arbitrarily long, its cost also becomes arbitrarily large]
                                 Why is this needed?    41
Goal State                            1   2 3
 It may be explicitly described:     4 5 6
                                      7 8
                            1 a a
   or partially described:
                            a 5 a
                                     (“a” stands for “any”)
                            a 8 a
 or defined by a condition,
    e.g., the sum of every row, of every column,
    and of every diagonals equals 30 15 1 2 12
                                      4 10 9      7
                                      8   6   5 11
                                      3 13 14
                                                       42
Other examples




                 43
8-Queens Problem
Place 8 queens in a chessboard so that no two
queens are in the same row, column, or diagonal.




       A solution            Not a solution


                                              44
Formulation #1
                   States: all arrangements of 0,
                      1, 2, ..., or 8 queens on the
                      board
                     Initial state: 0 queen on the
                      board
                     Successor function: each of
                      the successors is obtained by
                      adding one queen in an empty
                      square
                     Arc cost: irrelevant
                     Goal test: 8 queens are on the
                      board, with no two of them
                      attacking each other
  64x63x...x53 ~ 3x1014 states
                                                  45
Formulation #2
                   States: all arrangements of k =
                      0, 1, 2, ..., or 8 queens in the k
                      leftmost columns with no two
                      queens attacking each other
                     Initial state: 0 queen on the
                      board
                     Successor function: each
                      successor is obtained by adding
                      one queen in any square that is
                      not attacked by any queen
                      already in the board, in the
                      leftmost empty column
                     Arc cost: irrelevant
                     Goal test: 8 queens are on the
  2,057 states       board                            46
n-Queens Problem
 A solution is a goal node, not a path to this
    node (typical of design problem)
   Number of states in state space:
    • 8-queens  2,057
    • 100-queens  1052
 But techniques exist to solve n-queens
    problems efficiently for large values of n
    They exploit the fact that there are many
    solutions well distributed in the state space


                                                    47
Path Planning




   What is the state space?
                              48
Formulation #1




   Cost of one horizontal/vertical step = 1
   Cost of one diagonal step = √2
                                              49
Optimal Solution




   This path is the shortest in the discretized state
   space, but not in the original continuous space
                                                   50
Formulation #2
sweep-line




                   51
Formulation #2




                 52
States




         53
Successor Function




                     54
Solution Path




    A path-smoothing post-processing step is
    usually needed to shorten the path further
                                                 55
Formulation #3




    Cost of one step: length of segment
                                          56
Formulation #3




   Visibility graph

     Cost of one step: length of segment
                                           57
Solution Path




    The shortest path in this state space is also the
    shortest in the original continuous space
                                                    58
Assembly (Sequence) Planning




                               59
Possible Formulation
 States: All decompositions of the assembly
    into subassemblies (subsets of parts in their
    relative placements in the assembly)
   Initial state: All subassemblies are made of a
    single part
   Goal state: Un-decomposed assembly
   Successor function: Each successor of a state
    is obtained by merging two subassemblies (the
    successor function must check if the merging
    is feasible: collision, stability, grasping, ...)
   Arc cost: 1 or time to carry the merging
                                                   60
A Portion of State Space




                           61
But the formulation rules out
“non-monotonic” assemblies




                                62
But the formulation rules out
“non-monotonic” assemblies




                                63
But the formulation rules out
“non-monotonic” assemblies




                                64
But the formulation rules out
“non-monotonic” assemblies




                                65
But the formulation rules out
“non-monotonic” assemblies




                                66
But the formulation rules out
“non-monotonic” assemblies




    X
               This “subassembly” is not
               allowed in the definition of
               the state space: the 2 parts
               are not in their relative
               placements in the assembly

           Allowing any grouping of parts
           as a valid subassembly would
           make the state space much
           bigger and more difficult
           to search
                                              67
Assumptions in Basic Search

 The world is static
 The world is discretizable
 The world is observable
 The actions are deterministic

 But many of these assumptions can be
 removed, and search still remains an
 important problem-solving tool

                                        68
Vacuum Cleaner Problem
 A vacuum robot lives in a two-room environment


 States: The robot is in one of the two rooms,
    and each room may or may not contain dirt
     8 states
   Successor function: the successors of a state
    correspond to trying 3 actions: Right, Left,
    Suck.
   Initial state: Unknown (not observable)
   Goal state: No dust in the rooms
                                               69
Re-Formulation with “Belief States”
 Belief states: sets of states  28 =256
  belief states
 Initial belief state: set of 8 states
 Successor function: the successors of a
  belief state correspond to trying Right,
  Left, Suck on all states in the belief
  state.
 Goal belief state: any set of states with
  none having dust in any of the rooms
                                         70
Left   Suck   Right




                      71
Search and AI
 Search methods are ubiquitous in AI systems.
    They often are the backbones of both core
    and peripheral modules
   An autonomous robot uses search methods:
    • to decide which actions to take and which sensing
      operations to perform,
    • to quickly anticipate and prevent collision,
    • to plan trajectories,
    • to interpret large numerical datasets provided by
      sensors into compact symbolic representations,
    • to diagnose why something did not happen as
      expected,
    • etc...
                                                        72
                                                        72
Applications
Search plays a key role in many applications, e.g.:

   Route finding: airline travel, networks
   Package/mail distribution
   Pipe routing
   Comparison and classification of protein folds
   Pharmaceutical drug design
   Design of protein-like molecules
   Video games

                                                 73

Contenu connexe

Tendances

Nov. 17 Rational Inequalities
Nov. 17 Rational InequalitiesNov. 17 Rational Inequalities
Nov. 17 Rational InequalitiesRyanWatt
 
09 sistema de equação do primeiro grau
09 sistema de equação do primeiro grau09 sistema de equação do primeiro grau
09 sistema de equação do primeiro grauWollker Colares
 
Solving Trinomial Equations with Negatives X Coefficient
Solving Trinomial Equations with Negatives X CoefficientSolving Trinomial Equations with Negatives X Coefficient
Solving Trinomial Equations with Negatives X Coefficientjames.northrup
 
Day 8 - Rational Inequalities
Day 8 - Rational InequalitiesDay 8 - Rational Inequalities
Day 8 - Rational InequalitiesKate Nowak
 
Multiplying & dividing rational expressions
Multiplying & dividing rational expressionsMultiplying & dividing rational expressions
Multiplying & dividing rational expressionsDaisyListening
 
Day 8 dividing polynomials by monomials
Day 8 dividing polynomials by monomialsDay 8 dividing polynomials by monomials
Day 8 dividing polynomials by monomialsErik Tjersland
 
Lesson29 Intro To Difference Equations Slides
Lesson29   Intro To Difference Equations SlidesLesson29   Intro To Difference Equations Slides
Lesson29 Intro To Difference Equations SlidesMatthew Leingang
 
Formulas de taylor
Formulas de taylorFormulas de taylor
Formulas de taylorERICK CONDE
 
Picture arithmetic cryptosystem module explanation
Picture arithmetic cryptosystem module explanationPicture arithmetic cryptosystem module explanation
Picture arithmetic cryptosystem module explanationhari krishnan.n
 
Solving Trinomial Equations
Solving Trinomial EquationsSolving Trinomial Equations
Solving Trinomial Equationsjames.northrup
 
STUDY MATERIAL FOR IIT-JEE on Complex number
STUDY MATERIAL FOR IIT-JEE on Complex numberSTUDY MATERIAL FOR IIT-JEE on Complex number
STUDY MATERIAL FOR IIT-JEE on Complex numberAPEX INSTITUTE
 
8-5 Adding and Subtracting Rational Expressions
8-5 Adding and Subtracting Rational Expressions8-5 Adding and Subtracting Rational Expressions
8-5 Adding and Subtracting Rational Expressionsrfrettig
 

Tendances (20)

Chapter 15
Chapter 15Chapter 15
Chapter 15
 
10.1
10.110.1
10.1
 
Nov. 17 Rational Inequalities
Nov. 17 Rational InequalitiesNov. 17 Rational Inequalities
Nov. 17 Rational Inequalities
 
Stepenovanje
StepenovanjeStepenovanje
Stepenovanje
 
09 sistema de equação do primeiro grau
09 sistema de equação do primeiro grau09 sistema de equação do primeiro grau
09 sistema de equação do primeiro grau
 
Solving Trinomial Equations with Negatives X Coefficient
Solving Trinomial Equations with Negatives X CoefficientSolving Trinomial Equations with Negatives X Coefficient
Solving Trinomial Equations with Negatives X Coefficient
 
Day 8 - Rational Inequalities
Day 8 - Rational InequalitiesDay 8 - Rational Inequalities
Day 8 - Rational Inequalities
 
Multiplying & dividing rational expressions
Multiplying & dividing rational expressionsMultiplying & dividing rational expressions
Multiplying & dividing rational expressions
 
Day 8 dividing polynomials by monomials
Day 8 dividing polynomials by monomialsDay 8 dividing polynomials by monomials
Day 8 dividing polynomials by monomials
 
Lesson29 Intro To Difference Equations Slides
Lesson29   Intro To Difference Equations SlidesLesson29   Intro To Difference Equations Slides
Lesson29 Intro To Difference Equations Slides
 
Chapter 01
Chapter 01Chapter 01
Chapter 01
 
Jejemon
JejemonJejemon
Jejemon
 
Formulas de taylor
Formulas de taylorFormulas de taylor
Formulas de taylor
 
Picture arithmetic cryptosystem module explanation
Picture arithmetic cryptosystem module explanationPicture arithmetic cryptosystem module explanation
Picture arithmetic cryptosystem module explanation
 
Solving Trinomial Equations
Solving Trinomial EquationsSolving Trinomial Equations
Solving Trinomial Equations
 
STUDY MATERIAL FOR IIT-JEE on Complex number
STUDY MATERIAL FOR IIT-JEE on Complex numberSTUDY MATERIAL FOR IIT-JEE on Complex number
STUDY MATERIAL FOR IIT-JEE on Complex number
 
Dev
DevDev
Dev
 
8-5 Adding and Subtracting Rational Expressions
8-5 Adding and Subtracting Rational Expressions8-5 Adding and Subtracting Rational Expressions
8-5 Adding and Subtracting Rational Expressions
 
Algebra Lineal. Tarea1
Algebra Lineal. Tarea1Algebra Lineal. Tarea1
Algebra Lineal. Tarea1
 
Lesson 15: The Chain Rule
Lesson 15: The Chain RuleLesson 15: The Chain Rule
Lesson 15: The Chain Rule
 

En vedette

Cse 402 offline b2
Cse 402 offline b2Cse 402 offline b2
Cse 402 offline b2sujoyhnkc
 
Applications of Artificial Intelligence
Applications of Artificial IntelligenceApplications of Artificial Intelligence
Applications of Artificial IntelligenceMehr Un Nisa Manjotho
 
Artificial intelligence and its application
Artificial intelligence and its applicationArtificial intelligence and its application
Artificial intelligence and its applicationMohammed Abdel Razek
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtrackingmandlapure
 
Discrete Mathematics Presentation
Discrete Mathematics PresentationDiscrete Mathematics Presentation
Discrete Mathematics PresentationSalman Elahi
 
backtracking algorithms of ada
backtracking algorithms of adabacktracking algorithms of ada
backtracking algorithms of adaSahil Kumar
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1 Ali Usman
 

En vedette (8)

Cse 402 offline b2
Cse 402 offline b2Cse 402 offline b2
Cse 402 offline b2
 
Applications of Artificial Intelligence
Applications of Artificial IntelligenceApplications of Artificial Intelligence
Applications of Artificial Intelligence
 
Artificial intelligence and its application
Artificial intelligence and its applicationArtificial intelligence and its application
Artificial intelligence and its application
 
01 knapsack using backtracking
01 knapsack using backtracking01 knapsack using backtracking
01 knapsack using backtracking
 
Discrete Mathematics Presentation
Discrete Mathematics PresentationDiscrete Mathematics Presentation
Discrete Mathematics Presentation
 
backtracking algorithms of ada
backtracking algorithms of adabacktracking algorithms of ada
backtracking algorithms of ada
 
Discrete Structures. Lecture 1
 Discrete Structures. Lecture 1  Discrete Structures. Lecture 1
Discrete Structures. Lecture 1
 
Backtracking
BacktrackingBacktracking
Backtracking
 

Similaire à 02 search problems

AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekpavan402055
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsMenglinLiu1
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000Dips Academy
 
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...CrackVerbal
 
Battleship a
Battleship aBattleship a
Battleship ambetzel
 
Review for interim ii accelerated
Review for interim ii acceleratedReview for interim ii accelerated
Review for interim ii acceleratedMs. Jones
 
Dynamic Programming.pptx
Dynamic Programming.pptxDynamic Programming.pptx
Dynamic Programming.pptxThanga Ramya S
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework HelpExcel Homework Help
 
Msa blast 4-5
Msa blast 4-5Msa blast 4-5
Msa blast 4-5msfochler
 
[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdfEleanor McHugh
 
Chapter 3 – review packet solutions
Chapter 3 – review packet solutionsChapter 3 – review packet solutions
Chapter 3 – review packet solutionsRass Dunn
 
Journey to structure from motion
Journey to structure from motionJourney to structure from motion
Journey to structure from motionJa-Keoung Koo
 
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docxDivide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docxjacksnathalie
 

Similaire à 02 search problems (20)

Stochastic Process Assignment Help
Stochastic Process Assignment HelpStochastic Process Assignment Help
Stochastic Process Assignment Help
 
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjekAIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
AIMA_ch3_L2-complement.ppt kjekfkjekjfkjefkjefkjek
 
Mathematicalgames
MathematicalgamesMathematicalgames
Mathematicalgames
 
Stochastic Process Exam Help
Stochastic Process Exam HelpStochastic Process Exam Help
Stochastic Process Exam Help
 
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus ProblemsRecurrent problems: TOH, Pizza Cutting and Josephus Problems
Recurrent problems: TOH, Pizza Cutting and Josephus Problems
 
GATE Mathematics Paper-2000
GATE Mathematics Paper-2000GATE Mathematics Paper-2000
GATE Mathematics Paper-2000
 
Review for final exam
Review for final examReview for final exam
Review for final exam
 
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
GMAT Quant Strategy- What to expect in Quantitative Reasoning Section on the ...
 
Battleship a
Battleship aBattleship a
Battleship a
 
Review for interim ii accelerated
Review for interim ii acceleratedReview for interim ii accelerated
Review for interim ii accelerated
 
Monopole zurich
Monopole zurichMonopole zurich
Monopole zurich
 
Dynamic Programming.pptx
Dynamic Programming.pptxDynamic Programming.pptx
Dynamic Programming.pptx
 
Ch 01
Ch 01Ch 01
Ch 01
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework Help
 
Msa blast 4-5
Msa blast 4-5Msa blast 4-5
Msa blast 4-5
 
[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf[2023] Putting the R! in R&D.pdf
[2023] Putting the R! in R&D.pdf
 
Chapter 3 – review packet solutions
Chapter 3 – review packet solutionsChapter 3 – review packet solutions
Chapter 3 – review packet solutions
 
Journey to structure from motion
Journey to structure from motionJourney to structure from motion
Journey to structure from motion
 
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docxDivide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
Divide-and-Conquer & Dynamic ProgrammingDivide-and-Conqu.docx
 
Np cooks theorem
Np cooks theoremNp cooks theorem
Np cooks theorem
 

Dernier

Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...ritikasharma
 
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...rahim quresi
 
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser... Shivani Pandey
 
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...ritikasharma
 
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...mriyagarg453
 
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls ServiceCollege Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls ServiceNitya salvi
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Riya Pathan
 
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...russian goa call girl and escorts service
 
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...rahim quresi
 
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.Nitya salvi
 
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...ritikasharma
 
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...ritikasharma
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...aamir
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Riya Pathan
 
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...SUHANI PANDEY
 
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With... Shivani Pandey
 
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...SUHANI PANDEY
 
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...rajveermohali2022
 
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24... Shivani Pandey
 

Dernier (20)

Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
Hotel And Home Service Available Kolkata Call Girls Sonagachi ✔ 6297143586 ✔C...
 
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
Sonagachi ( Call Girls ) Kolkata ✔ 6297143586 ✔ Hot Model With Sexy Bhabi Rea...
 
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
Model Call Girls In Pazhavanthangal WhatsApp Booking 7427069034 call girl ser...
 
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort GoaDesi Bhabhi Call Girls  In Goa  💃 730 02 72 001💃desi Bhabhi Escort Goa
Desi Bhabhi Call Girls In Goa 💃 730 02 72 001💃desi Bhabhi Escort Goa
 
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
Hotel And Home Service Available Kolkata Call Girls Howrah ✔ 6297143586 ✔Call...
 
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
Navsari Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girl...
 
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls ServiceCollege Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
College Call Girls Pune 8617697112 Short 1500 Night 6000 Best call girls Service
 
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
Independent Hatiara Escorts ✔ 9332606886✔ Full Night With Room Online Booking...
 
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...Call Girls  Agency In Goa  💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
Call Girls Agency In Goa 💚 9316020077 💚 Call Girl Goa By Russian Call Girl ...
 
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
𓀤Call On 6297143586 𓀤 Sonagachi Call Girls In All Kolkata 24/7 Provide Call W...
 
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
❤Personal Whatsapp Number Keylong Call Girls 8617697112 💦✅.
 
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
Top Rated Kolkata Call Girls Dum Dum ⟟ 6297143586 ⟟ Call Me For Genuine Sex S...
 
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...
Hotel And Home Service Available Kolkata Call Girls South End Park ✔ 62971435...
 
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
Dakshineswar Call Girls ✔ 8005736733 ✔ Hot Model With Sexy Bhabi Ready For Se...
 
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
Independent Sonagachi Escorts ✔ 9332606886✔ Full Night With Room Online Booki...
 
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
VIP Model Call Girls Budhwar Peth ( Pune ) Call ON 8005736733 Starting From 5...
 
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
(TOP CLASS) Call Girls In Nungambakkam Phone 7427069034 Call Girls Model With...
 
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
VIP Model Call Girls Vijayawada ( Pune ) Call ON 8005736733 Starting From 5K ...
 
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
Zirakpur Call Girls👧 Book Now📱8146719683 📞👉Mohali Call Girl Service No Advanc...
 
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...
Model Call Girls In Ariyalur WhatsApp Booking 7427069034 call girl service 24...
 

02 search problems

  • 1. Search Problems Explorating Alternatives R&N: Chap. 3, Sect. 3.1–2 + 3.6 1
  • 2. Example: 8-Puzzle 8 2 1 2 3 3 4 7 4 5 6 5 1 6 7 8 Initial state Goal state Search is about the exploration of alternatives 2
  • 3. Exploratory search is an old idea: The Labyrinth and the Ariadne Thread According to Greek mythology, Theseus came to Crete to slay the Minotaur, a monster who lived in a Labyrinth. Ariadne gave Theseus a ball of yarn which he unwound as he entered the Labyrinth. After killing the Minotaur, Theseus traced the thread back to the entrance of the Labyrinth, rejoined Ariadne, and successfully escaped Crete 3
  • 4. Since the dawn of civilization, puzzles and games that require the exploration of alternative paths have fascinated mankind and have been considered a challenge for human intelligence  Chess originated in Persia and India about 4000 years ago  Checkers appeared as early as 1600 B.C in Egyptian paintings  Go originated in China over 3000 years ago 4
  • 5. 5
  • 6. 15-Puzzle Introduced in 1878 by Sam Loyd, who dubbed himself “America’s greatest puzzle-expert” 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6
  • 7. 7
  • 8. 15-Puzzle Sam Loyd offered $1,000 of his own money to the first person who would solve the following problem: 1 2 3 4 1 2 3 4 5 6 7 8 ? 5 6 7 8 9 10 11 12 9 10 11 12 13 14 15 13 15 14 8
  • 9. But no one ever won the prize !! 9
  • 10. 8-Puzzle: State Space ... 8 2 7 3 4 8 2 5 1 6 3 4 7 5 1 6 8 2 8 2 3 4 7 3 4 7 5 1 6 5 1 6 10
  • 11. 8-Puzzle: Successor Function 8 2 7 3 4 5 1 6 8 2 8 2 7 8 2 7 3 4 7 3 4 6 3 4 5 1 6 5 1 5 1 6 11
  • 12. Stating a Problem as a Search Problem S  State space S 1  Successor function: 3 2 x ∈ S → SUCCESSORS(x) ∈ 2S  Arc cost  Initial state s0  Goal test: x∈S → GOAL?(x) =T or F 12
  • 13. State Graph  It is defined as follows: • Each state is represented by a distinct node • An arc connects a node s to a node s’ if s’ ∈ SUCCESSORS(s)  The state graph may contain more than one connected component 13
  • 14. 14
  • 15. Solution to the Search Problem  A solution is a path connecting the initial node to a goal node (any one) 15
  • 16. 16
  • 17. Solution to the Search Problem  A solution is a path connecting the initial to a goal node (any one)  The cost of a path is the sum of the edge costs along this path  An optimal solution is a solution path of minimum cost  There might be no solution ! 17
  • 18. 18
  • 19. How big is the state space of the (n2-1)-puzzle?  8-puzzle  9! = 362,880 states  15-puzzle  16! ~ 1.3 x 1012 states  24-puzzle  25! ~ 1025 states But only half of these states are reachable from any given state 19
  • 20. Permutation Inversions  Let the goal be: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15  Let ni be the number of tiles j < i that appear after tile i (from left to right and top to bottom)  N = n2 + n3 + … + n15 + row number of empty tile 1 2 3 4 n2 = 0 n3 = 0 n4 = 0 5 10 7 8 n5 = 0 n6 = 0 n7 = 1 n8 = 1 n9 = 1 n10 = 4 N=7+4 9 6 11 12 n11 = 0 n12 = 0 n13 = 0 13 14 15 n14 = 0 n15 = 0 20
  • 21.  Proposition: (N mod 2) is invariant under any legal move of the empty tile  Proof: • Any horizontal move of the empty tile leaves N unchanged • A vertical move of the empty tile changes N by an even increment 1 2 3 4 1 2 3 4 5 6 7 5 6 11 7 s= s’ = N(s’) = N(s) + 3 + 1 9 10 11 8 9 10 8 13 14 15 12 13 14 15 12 21
  • 22.  Proposition: (N mod 2) is invariant under any legal move of the empty tile   For a goal state g to be reachable from a state s, a necessary condition is that N(g) and N(s) have the same parity  It can be shown that this is also a sufficient condition   The state graph consists of two connected components of equal size 22
  • 23. 15-Puzzle Sam Loyd offered $1,000 of his own money to the first person who would solve the following problem: 1 2 3 4 1 2 3 4 5 6 7 8 ? 5 6 7 8 9 10 11 12 9 10 11 12 13 14 15 13 15 14 N=4 N=5 So, the second state is not reachable from the first, and Sam Loyd took no risk with his money ... 23
  • 24. What is the Actual State Space? • The set of all states? [e.g., a set of 16! states for the 15-puzzle] • The set of all states from which a given goal state is reachable? [e.g., a set of 16!/2 states for the 15-puzzle] • The set of all states reachable from a given initial state? In general, the answer is a) 24
  • 25. What is the Actual State Space? • The set of all states? [e.g., a set of 16! states for the 15-puzzle] • The set of all states from which a given goal state is reachable? [e.g., a set of 16!/2 states for the 15-puzzle] • The set of all states reachable from a given initial state? In general, the answer is a) But a fast test determining whether a state is reachable from another is very useful, as search-based problem solvers are often very inefficient when a problem has no solution 25
  • 26. Stating a Problem as a Search Problem S  State space S 1  Successor function: 3 2 x ∈ S → SUCCESSORS(x) ∈ 2S  Arc cost  Initial state s0  Goal test: x∈S → GOAL?(x) =T or F  A solution is a path joining the initial to a goal node 26
  • 27. Searching the State Space  Often it is not feasible to build a complete representation of the state graph 27
  • 28. 8-, 15-, 24-Puzzles 8-puzzle  362,880 states 0.036 sec 15-puzzle  1.3 x 1012 states < 4 hours 24-puzzle  1025 states > 109 years 100 millions states/sec 28
  • 29. Searching the State Space  Often it is not feasible to build a complete representation of the state graph  A problem solver must construct a solution by exploring a small portion of the graph 29
  • 31. Searching the State Space Search tree 31
  • 32. Searching the State Space Search tree 32
  • 33. Searching the State Space Search tree 33
  • 34. Searching the State Space Search tree 34
  • 35. Searching the State Space Search tree 35
  • 36. Simple Problem-Solving-Agent Algorithm  s0  sense/read initial state  GOAL?  select/read goal test  Succ  select/read successor function  solution  search(s0, GOAL?, Succ)  perform(solution) 36
  • 37. State Space  Each state is an abstract representation of a collection of possible worlds sharing some crucial properties and differing on non-important details only E.g.: In assembly planning, a state does not define exactly the absolute position of each part  The state space is discrete. It may be finite, or infinite 37
  • 38. Successor Function  It implicitly represents all the actions that are feasible in each state 38
  • 39. Successor Function  It implicitly represents all the actions that are feasible in each state  Only the results of the actions (the successor states) and their costs are returned by the function  The successor function is a “black box”: its content is unknown E.g., in assembly planning, the function does not say if it only allows two sub-assemblies to be merged or if it makes assumptions about subassembly stability 39
  • 40. Path Cost  An arc cost is a positive number measuring the “cost” of performing the action corresponding to the arc, e.g.: • 1 in the 8-puzzle example • expected time to merge two sub-assemblies  We will assume that for any given problem the cost c of an arc always verifies: c ≥ ε > 0, where ε is a constant 40
  • 41. Path Cost  An arc cost is a positive number measuring the “cost” of performing the action corresponding to the arc, e.g.: • 1 in the 8-puzzle example • expected time to merge two sub-assemblies  We will assume that for any given problem the cost c of an arc always verifies: c ≥ ε > 0, where ε is a constant [This condition guarantees that, if path becomes arbitrarily long, its cost also becomes arbitrarily large] Why is this needed? 41
  • 42. Goal State 1 2 3  It may be explicitly described: 4 5 6 7 8 1 a a  or partially described: a 5 a (“a” stands for “any”) a 8 a  or defined by a condition, e.g., the sum of every row, of every column, and of every diagonals equals 30 15 1 2 12 4 10 9 7 8 6 5 11 3 13 14 42
  • 44. 8-Queens Problem Place 8 queens in a chessboard so that no two queens are in the same row, column, or diagonal. A solution Not a solution 44
  • 45. Formulation #1  States: all arrangements of 0, 1, 2, ..., or 8 queens on the board  Initial state: 0 queen on the board  Successor function: each of the successors is obtained by adding one queen in an empty square  Arc cost: irrelevant  Goal test: 8 queens are on the board, with no two of them attacking each other  64x63x...x53 ~ 3x1014 states 45
  • 46. Formulation #2  States: all arrangements of k = 0, 1, 2, ..., or 8 queens in the k leftmost columns with no two queens attacking each other  Initial state: 0 queen on the board  Successor function: each successor is obtained by adding one queen in any square that is not attacked by any queen already in the board, in the leftmost empty column  Arc cost: irrelevant  Goal test: 8 queens are on the  2,057 states board 46
  • 47. n-Queens Problem  A solution is a goal node, not a path to this node (typical of design problem)  Number of states in state space: • 8-queens  2,057 • 100-queens  1052  But techniques exist to solve n-queens problems efficiently for large values of n They exploit the fact that there are many solutions well distributed in the state space 47
  • 48. Path Planning What is the state space? 48
  • 49. Formulation #1 Cost of one horizontal/vertical step = 1 Cost of one diagonal step = √2 49
  • 50. Optimal Solution This path is the shortest in the discretized state space, but not in the original continuous space 50
  • 53. States 53
  • 55. Solution Path A path-smoothing post-processing step is usually needed to shorten the path further 55
  • 56. Formulation #3 Cost of one step: length of segment 56
  • 57. Formulation #3 Visibility graph Cost of one step: length of segment 57
  • 58. Solution Path The shortest path in this state space is also the shortest in the original continuous space 58
  • 60. Possible Formulation  States: All decompositions of the assembly into subassemblies (subsets of parts in their relative placements in the assembly)  Initial state: All subassemblies are made of a single part  Goal state: Un-decomposed assembly  Successor function: Each successor of a state is obtained by merging two subassemblies (the successor function must check if the merging is feasible: collision, stability, grasping, ...)  Arc cost: 1 or time to carry the merging 60
  • 61. A Portion of State Space 61
  • 62. But the formulation rules out “non-monotonic” assemblies 62
  • 63. But the formulation rules out “non-monotonic” assemblies 63
  • 64. But the formulation rules out “non-monotonic” assemblies 64
  • 65. But the formulation rules out “non-monotonic” assemblies 65
  • 66. But the formulation rules out “non-monotonic” assemblies 66
  • 67. But the formulation rules out “non-monotonic” assemblies X This “subassembly” is not allowed in the definition of the state space: the 2 parts are not in their relative placements in the assembly Allowing any grouping of parts as a valid subassembly would make the state space much bigger and more difficult to search 67
  • 68. Assumptions in Basic Search  The world is static  The world is discretizable  The world is observable  The actions are deterministic But many of these assumptions can be removed, and search still remains an important problem-solving tool 68
  • 69. Vacuum Cleaner Problem  A vacuum robot lives in a two-room environment  States: The robot is in one of the two rooms, and each room may or may not contain dirt  8 states  Successor function: the successors of a state correspond to trying 3 actions: Right, Left, Suck.  Initial state: Unknown (not observable)  Goal state: No dust in the rooms 69
  • 70. Re-Formulation with “Belief States”  Belief states: sets of states  28 =256 belief states  Initial belief state: set of 8 states  Successor function: the successors of a belief state correspond to trying Right, Left, Suck on all states in the belief state.  Goal belief state: any set of states with none having dust in any of the rooms 70
  • 71. Left Suck Right 71
  • 72. Search and AI  Search methods are ubiquitous in AI systems. They often are the backbones of both core and peripheral modules  An autonomous robot uses search methods: • to decide which actions to take and which sensing operations to perform, • to quickly anticipate and prevent collision, • to plan trajectories, • to interpret large numerical datasets provided by sensors into compact symbolic representations, • to diagnose why something did not happen as expected, • etc... 72 72
  • 73. Applications Search plays a key role in many applications, e.g.:  Route finding: airline travel, networks  Package/mail distribution  Pipe routing  Comparison and classification of protein folds  Pharmaceutical drug design  Design of protein-like molecules  Video games 73