Structures and Strategies For Space State Search To

  • Slides: 22
Download presentation
Structures and Strategies For Space State Search To be discussed later 3. 0 Introduction

Structures and Strategies For Space State Search To be discussed later 3. 0 Introduction 3. 1 Graph Theory 3. 2 Strategies for Space State Search 3. 3 Using Space State to Represent Reasoning with the Predicate Calculus 3. 4 Epilogue and References 3. 5 Exercises George F Luger ARTIFICIAL INTELLIGENCE 5 th edition Structures and Strategies for Complex Problem Solving Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 1

Figure 3. 1: The city of Königsberg. Luger: Artificial Intelligence, 5 th edition. ©

Figure 3. 1: The city of Königsberg. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 2

Figure 3. 2: Graph of the Königsberg bridge system. Luger: Artificial Intelligence, 5 th

Figure 3. 2: Graph of the Königsberg bridge system. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 3

Figure 3. 3: A labeled directed graph. Luger: Artificial Intelligence, 5 th edition. ©

Figure 3. 3: A labeled directed graph. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 4

Figure 3. 4: A rooted tree, exemplifying family relationships. Luger: Artificial Intelligence, 5 th

Figure 3. 4: A rooted tree, exemplifying family relationships. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 5

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 6

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 6

Fig 3. 5 (a) The finite state graph for a flip flop and (b)

Fig 3. 5 (a) The finite state graph for a flip flop and (b) its transition matrix. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 7

Fig 3. 6 (a) The finite state graph and (b) the transition matrix for

Fig 3. 6 (a) The finite state graph and (b) the transition matrix for string recognition example Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 8

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 9

Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 9

Fig 3. 8 State space of the 8 -puzzle generated by “move blank” operations

Fig 3. 8 State space of the 8 -puzzle generated by “move blank” operations Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 10

Fig 3. 9 An instance of the travelling salesperson problem Luger: Artificial Intelligence, 5

Fig 3. 9 An instance of the travelling salesperson problem Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 11

Fig 3. 10 Search for the travelling salesperson problem. Each arc is marked with

Fig 3. 10 Search for the travelling salesperson problem. Each arc is marked with the total weight of all paths from the start node (A) to its endpoint. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 12

Fig 3. 11 An instance of the travelling salesperson problem with the nearest neighbor

Fig 3. 11 An instance of the travelling salesperson problem with the nearest neighbor path in bold. Note this path (A, E, D, B, C, A), at a cost of 550, is not the shortest path. The comparatively high cost of arc (C, A) defeated the heuristic. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 13

Fig 3. 12 State space in which goal-directed search effectively prunes extraneous search paths.

Fig 3. 12 State space in which goal-directed search effectively prunes extraneous search paths. Stop Here!! Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 14

Fig 3. 13 State space in which data-directed search prunes irrelevant data and their

Fig 3. 13 State space in which data-directed search prunes irrelevant data and their consequents and determines one of a number of possible goals. Skip!! Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 15

Function backtrack algorithm Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005

Function backtrack algorithm Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 16

Luger Backtracking vs. Nilsson’s “True Backtracking” • Nilsson’s algorithms forgets all paths (and the

Luger Backtracking vs. Nilsson’s “True Backtracking” • Nilsson’s algorithms forgets all paths (and the states that are on the path) that lead to failure. Luger memorizes all previously visited states. • Storage cost Nilsson (O(logb(n)); Luger (O(n))—b being the branching factor; the number of operators applicable for a given state. • Nilsson creates new states only when necessary; Luger creates new states beforehand, which is inefficient. • Luger backtracks for states that have been previously visited; Nilsson only backtracks for states that already occur on the current path. • Nilssons algorithm only memorizes the currently explored path; for each state on the path it memorizes the operators that are left to be applied • Nilssons’ code is kind of interpretive and recursive; however, it is easy to replace the recursive version by an iterative version. • Nilsson contains plug-in functions for incorporating domain specific knowledge into the algorithm; Luger does not—which is bizarre for AI book.

A trace of backtrack on the graph of figure 3. 12 Luger: Artificial Intelligence,

A trace of backtrack on the graph of figure 3. 12 Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 17

Fig 3. 14 Backtracking search of a hypothetical state space. Luger: Artificial Intelligence, 5

Fig 3. 14 Backtracking search of a hypothetical state space. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 18

Fig 3. 15 Graph for breadth - and depth - first search examples. Luger:

Fig 3. 15 Graph for breadth - and depth - first search examples. Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 19

Function breadth_first search algorithm Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited,

Function breadth_first search algorithm Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 20

A trace of breadth_first_search on the graph of Figure 3. 13 Luger: Artificial Intelligence,

A trace of breadth_first_search on the graph of Figure 3. 13 Luger: Artificial Intelligence, 5 th edition. © Pearson Education Limited, 2005 21