13.07.2015 Views

Informed and Uninformed Search

Informed and Uninformed Search

Informed and Uninformed Search

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Summary of Last Lecture• Practical Motivation– Voice recognition (i.e. checking flight status)– Written letter recognition (i.e. zip codes on letters)– Planning (i.e. a robot path planning)– Medical diagnosis systems• Academic Motivation– Game playing (i.e. Checkers, Rubik’s cube, Chess)– Robotics, Theorem proving• Designing algorithms to accomplish the above, algorithmswill be rational.– (i.e. minimize # moves, maximize expected # of wins)• In defense of my simple examples through the course,assignments will be more pragmatic.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1Chapter 2 – Russell <strong>and</strong> Norvig(not on exam)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>21


Environment Properties - 3• Static versus Dynamic– Semi-dynamic• Discrete versus continuous– Applies to actions, states• Single agent versus multiple agents– Co-operative <strong>and</strong> competitive agentsCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5Name the Environment Properties• Chess• Monopoly• Robocupsimulation league• Email crawlerCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>63


Goal Oriented <strong>Search</strong> – Ex:1CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>9Four Step Process• Goal formulation, problem formulation,search, execute• What does this tell you about theenvironment?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>105


Problem TypesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11Single State Problem DefinitionCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>126


State Space DefinitionCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>13Eight State PuzzleCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>147


Eight State PuzzleCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>15Converting the Problem to a GraphCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>168


What is a State <strong>and</strong> a Node?Why? ThinkAbout GoalStatesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>17<strong>Search</strong> Strategies <strong>and</strong> EffectivenessCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>189


Basic <strong>Search</strong> AlgorithmCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>19<strong>Uninformed</strong> <strong>Search</strong>CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>2010


Breadth First <strong>Search</strong>Complete?Time?Space?Optimal?What queue type should the fringe be?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>21Uniform <strong>Search</strong>Fringe queue order?Complete?Time?Space?Optimal?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>2211


Depth First <strong>and</strong> Depth LimitedComplete?Time?Space?Optimal?Fringe queue order?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>23Classic Problem #1: Eight QueenProblemState space,Successor func.Start StateTarget Stateb, d, mBest searchtechniqueCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>2412


CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>25Iterative Deepening <strong>and</strong> Bidirectional<strong>Search</strong>Complete?Time?Space?Optimal?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>2613


Hmmm. What’s the Overhead inVisiting Node Multiple TimesInstead of Just Once• Exp<strong>and</strong> nodes just once:– 1+b^2+b^3+b^4+b^5– For b = 10, d = 5, 111,111 expansions• Exp<strong>and</strong> nodes multiple times– d+1 + d(b) + (d-1)b^2 + (d-2)b^3 + (d-3)b^4 +(d-4)b^5 = 123,456CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>27Formalizing the State Space - 1• A state space is a graph, (V, E), where V is a setof nodes <strong>and</strong> E is a set of arcs, where each arc isdirected from a node to another node• Each node is a data structure, represents aparticular state• Each arc corresponds to an instance of one of theoperators. When the operator is applied to the stateassociated with the arc's source node, then theresulting state is the state associated with the arc'sdestination node• Each arc has a fixed, positive cost associated withit corresponding to the cost of the operator.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>2814


Formalizing the State Space - 2• Each node has a set of successor nodes = all legal operators.• One or more nodes are designated as start nodes• A goal test predicate is applied to a state to determine if itsassociated node is a goal node• A solution is a sequence of operators that is associated with a pathin a state space from a start node to a goal node• The cost of a solution is the sum of the arc costs on the solutionpath• State-space search is searching through a state space for a solutionby making explicit a sufficient portion of an implicit state-spacegraph to include a goal node. Hence, initially V={S}, where S isthe start node; when S is exp<strong>and</strong>ed <strong>and</strong> so forth until …• Each node implicitly or explicitly represents a partial solutionpath (<strong>and</strong> cost of the partial solution path) from the start nodeCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>29Basic <strong>Search</strong> AlgorithmCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>3015


<strong>Uninformed</strong> <strong>Search</strong>CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>31Simple Example - 1Non-monotonic decreaseMesses up BFCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>3216


Simple Example - 2Depth first LIFO queueUniform cost ordered queueBreadth first FIFO queueCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>33Classic Problem #1: Eight QueenProblemCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>3417


Two Key Issues in This Module• 1) Representing a goal search problem as atree or graph search• 2) Efficient representation of a graphCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>35Basic <strong>Search</strong> AlgorithmCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>3618


Simple Example - 2Depth first LIFO queueUniform cost ordered queueBreadth first FIFO queueCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>37Simple Example - 1CompleteOptimalTime ComplexitySpace ComplexityCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>3819


Classic Problem #2CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>39More Classic ProblemsCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>4020


Water Jug SolutionCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>41Uniform Cost <strong>Search</strong>CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>4221


Shortest Path Planning• Consider planning a path from a start stateto a goal state with geometric obstacles• Formulate this problem as tree searchCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>43Problem TypesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>4422


Four Step Process• Goal formulation, problem formulation,search, execute• What does this tell you about theenvironment?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>45Three Tile Problem!CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>4623


Three Tile Problem!• Sensor-less problems– How do we formulate as a tree search solvingthe three tile problem … if we don’t know theinitial start state, but we know the goal state!CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>47Three Tile Problem!• Sensor-less problems– How do we formulate as a tree search solvingthe three tile problem … if we don’t know theinitial start state, but we know the goal state!• Partial sensors– How do we formulate as a tree search solvingthe tree tile problem … if we can observepartial information after each step.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>4824


Motivation for <strong>Informed</strong> <strong>Search</strong>• What we have covered so far is effectivelyblind/uninformed search.• At best we have used the cost to get to a particularsolution• We only have a predicate to test for the goal state.• But in many problems, if we know what state weare in, we can also estimate the cost to the goalstate.• A* requires this estimate to be an under-estimatedor admissible heuristic. Common admissibleheuristic???CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>49Homework #1• Formulate this problem as a tree search. List the statespace description, start state, goal state <strong>and</strong> successorfunction(s).• Using the above, draw the search tree <strong>and</strong> solve theproblem.• What is the complexity of each search algorithm for thisparticular problem.• What is the best search algorithm for this problem.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5025


Next Class• This class uninformed search• Next two classes are informed (heuristic)search (i.e. A*, Chapter 4, R&N)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>51Summary of Last Class• We can convert single state problems(complete observability <strong>and</strong> deterministicenvironment) into tree searches.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5226


More Classic ProblemsCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>53Water Jug SolutionCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5427


A More Complicated ProblemHow do weDescribe all possibleStates (including thisone) to a machineCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>55A More Complicated ProblemHow do weDescribe all possibleStates (including thisone) to a machineCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5628


Actions? So You Can Get FromAny State to Any Other State?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>57Actions? So You Can Get FromAny State to Any Other State?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>5829


Actions? So You Can Get FromAny State to Any Other State?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>59Variety of <strong>Uninformed</strong> <strong>Search</strong>Techniques<strong>Search</strong>CompleteTimeSpaceOptimalBFSYesO(b d )O(b d )No*DFSYes*O(b d )O(bd)No*IDSYesO(b d )O(bd)NoUCYesO(b d )O(b d )YesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>6030


Simple Example - 1CompleteOptimalTime ComplexitySpace ComplexityCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>61Motivation for <strong>Informed</strong> <strong>Search</strong>• What we have covered so far is effectivelyblind/uninformed search.• At best we have used the cost to get to a particularsolution. (i.e. only the problem definition, nointelligence or background information).• We only have a predicate to test for the goal state.• But in many problems, if we know what state weare in, we can also estimate the cost to the goalstate. Can we use this information to come up witha more efficient algorithm?• A* requires this estimate to be an under-estimatedor admissible heuristic.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>6231


<strong>Informed</strong> <strong>Search</strong> – Chapter 4CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>63Lecture 4 <strong>and</strong> 5• Chapter 4 – making use of problem details beyondproblem specification• More efficient that uninformed search• <strong>Uninformed</strong> search approaches can enhance basicA* algorithm• This lecture, basic A* with examples– Robot navigation, Towers of Hanoi, Rubik’s cube• Next lecture, advanced A* <strong>and</strong> iterativealgorithmsCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>6432


Best First <strong>Search</strong>• Take the basic tree search algorithm• f(n) evaluation function determines expansion order• f(n)=g(n)+h(n)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>65Simplest <strong>Informed</strong> <strong>Search</strong>• f(n) = h(n)– h is some heuristic function that estimates costfrom n to goal, h(n) = 0, if n = goal• Results in a greedy search technique thatfinds local minimaCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>6633


Greedy Algorithm <strong>and</strong> PropertiesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>67CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>6834


A* <strong>Search</strong>???A* complete <strong>and</strong> optimal, proof of optimality is trivial for treesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>69CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>7035


CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>71Example on GraphsCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>7236


<strong>Informed</strong> <strong>Search</strong> – Chapter 4CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>73CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>7437


CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>75CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>7638


Up to HereCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>77Trees vs Graphs: AvoidingRepeating StatesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>7839


Use Graph <strong>Search</strong> InsteadCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>79A* Graph <strong>Search</strong> InsteadCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>8040


A* Graph <strong>Search</strong> for Shortest PathProblem – What’s the Trend?OpenA(366)S(393) T(447) Z(449)RV(413) F(415) Z(449) *A(646)* O(671)F(415) P(417) Z(449) C(526) S(553) O(671)P(417) Z(449) B(450) C(526) S(553) S(591)O(671)B(418) Z(449) B(450) C(526) S(553) S(591)RV(607) C(615) O(671)ClosedA(366)A(366) S(393)A(366) S(393) RV(413)A(366) S(393) RV(413) F(415)A(366) S(393) RV(413) F(415) P(417)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>81That is every node with f(n) < f(G*) isexp<strong>and</strong>ed. Why?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>8241


A Star as BFS with f-ContoursCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>83Robot NavigationAdmissible Heuristic?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>8442


Greedy <strong>Search</strong>?Robot Navigationf(N) = h(N), with h(N) = Manhattan distance to the goal8 76543 2 34 5 6754356 3 210 1 24765876 5 4 3 2 3 4 56CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>85Robot Navigationf(N) = h(N), with h(N) = Manhattan distance to the goal8 76543 2 34 5 6754356 3 210 1 24765876 5 4 3 2 3 4 56CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>8643


Robot Navigationf(N) = g(N)+h(N), with h(N) = Manhattan distance to goal8+3 8 7+4 7 6+5 6+3 65+6 54+7 43+8 3 2+9 2 32+9 3+104 5 67+2 75+6 5 4+7 43+8 356+1 6 3 2+9 2 1+10 11+10 0+110 1 27+0 76+1 68+1 87+2 76+3 6 5+4 5 4+5 4 3+6 32+7 2 3+8 3 4 5456CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>87Robot navigationf(N) = g(N) + h(N), with h(N) = straight-line distance from N to goalCost of one horizontal/vertical step = 1Cost of one diagonal step = √2CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>8844


A* - Is Admissible HeuristicsGood Enough• In our examples we found that items on theclosed lists need to be updated as there weremultiple paths to the same node?• Can we overcome this?CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>89Consistent Heuristic• The admissible heuristic h is consistent (orsatisfies the monotone restriction) if for everynode N <strong>and</strong> every successor N’ of N:h(N) ≤ c(N,N’) + h(N’)• i.e. its always quicker to go• Directly to the goal• (triangular inequality)Nc(N,N’)N’ h(N)h(N’)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>9045


Some Proofs of A* Behavior - 1• In A*, for any node n, n is extracted from OPEN iff f(n) (If part)• Consider any node m in the optimal path in the state searchgraph: f(m) = g(m)+h(m) = g*(m)+h(m)


Some Proofs of A* Behavior - 3• FACT: Any consistent heuristic h isadmissible.• Proof: We need to show that for all n, h(n)


8-Puzzle581 2 34214 5 673N67 8goal• h1(N) = number of misplaced tiles• h2(N) = sum of distances of each tile to goalare both consistentCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>95Claims• If h is consistent, then the function f alongany path is non-decreasing:f(N) = g(N) + h(N)f(N’) = g(N) +c(N,N’) + h(N’)h(N) ≤ c(N,N’) + h(N’)f(N) ≤ f(N’)• If h is consistent, then whenever A* exp<strong>and</strong>s anode it has already found an optimal path to thestate associated with this nodeNc(N,N’)N’ h(N)h(N’)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>9648


Avoiding Repeated States in A*If the heuristic h is consistent, then:• Let CLOSED be the list of states associatedwith exp<strong>and</strong>ed nodes• When a new node N is generated:– If its state is in CLOSED, then discard N– If it has the same state as another node in thefringe, then discard the node with the largest fCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>97Complexity of Consistent A*• Let s be the size of the state space• Let b be the maximal number of states thatcan be attained in one step from any state• Assume that the time needed to test if astate is in CLOSED is O(1)• The time complexity of A* is O(sblogs)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>9849


A* <strong>Search</strong> PropertiesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>99Inventing Admissible Heuristics• List constraints• Relax constraints to obtain admissibleheuristics (constraints increase cost)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>10050


Examples• For each, specify the state space, operators,constraints of the problem <strong>and</strong> admissibleheuristics– Towers of Hanoi– Robot path planning– TSP– Rubik’s CubeCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>101Towers of HanoiCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>10251


A*Consider the optimal path.Every node on this path has what propertyWhat about the start state. Therefore A* has what property wrt nodeexpansion? . If A* is optimal what other property wrt nodeexpansion must hold.CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>103Iterative Deepening A* (IDA*)• Use f(N) = g(N) + h(N) with admissible h• Each iteration is depth-first with cutoff onthe value of f of exp<strong>and</strong>ed nodesCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>10452


8-Puzzlef(N) = g(N) + h(N)with h(N) = number of misplaced tiles4Cutoff=46CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1058-Puzzle4Cutoff=4466CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>10653


8-Puzzle4Cutoff=44566CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1078-Puzzle54Cutoff=44566CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>10854


8-Puzzle654Cutoff=44566CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1098-Puzzle4Cutoff=56CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11055


8-Puzzle4Cutoff=5466CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1118-Puzzle4Cutoff=54566CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11256


8-Puzzle4Cutoff=545766CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1138-Puzzle4Cutoff=5455766CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11457


8-Puzzle4Cutoff=5455 5766CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>1158-Puzzle4Cutoff=5455 5766CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11658


Examples• For each, specify the state space, operators,constraints of the problem <strong>and</strong> admissibleheuristics– Towers of Hanoi– Robot path planning– TSP– Rubik’s CubeCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>117TSP Example42BA48What is the admissibleHeuristic?23D20C40LConsider the constraintsof the problem4229EF2010G42K20H4041M10I3223JCSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>11859


CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>119N-Queens (Again)CSI 435/535 - Introduction to A.I. : <strong>Informed</strong><strong>and</strong> <strong>Uninformed</strong> <strong>Search</strong>12060

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!