1 / 19

State Space Representation:

State Space Representation:. Representing Logic by Graph. Motivations. You have seen how to use first-order logic to represent knowledge and programs. Prolog is happy to do reasoning by this kind of logical representation.

sumitra
Download Presentation

State Space Representation:

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. State Space Representation: Representing Logic by Graph

  2. Motivations • You have seen how to use first-order logic to represent knowledge and programs. • Prolog is happy to do reasoning by this kind of logical representation. • Humans, however, prefer to reason with pictures, diagrams, geometries, and mathematical spaces. • In this lecture, you will learn about one such representation call state space.

  3. Objectives • Logical representation to graph representation • Finite state machines • State space

  4. Königsberg bridges • Königsberg is today's Kaliningrad in Russia. • Problem: Is there a walk around the city that crosses each bridge exactly once? • Swiss Mathematician, Leonhard Euler, solved the problem.

  5. Predicate representation Predicate calculus: • connect(X, Y, B) connect(Y, X, B)X, Y are land places • Interpretation: connect(i1, i2, b1) connect(i2, i1, b1) connect(rb1, i1, b2) connect(i1, rb1, b2) connect(rb1, i1, b3) connect(i1, rb1, b3) connect(rb1, i2, b4) connect(i2, rb1, b4) connect(rb2, i1, b5) connect(i1, rb2, b5) connect(rb2, i1, b6) connect(i1, rb2, b6) connect(rb2, i2, b7) connect(i2, rb2, b7) • Again: Is there a walk around the city that crosses each bridge exactly once?

  6. Graph representation • Use a node to represent a riverbank place or an island place • 2 riverbank places • 2 island places • use an arc to represent a bridge • 7 bridges • Again: Is there a walk around the city that crosses each bridge exactly once?

  7. Euler's Proof • Degree of a node is the number arcs joining it. • Ignore the beginning and the end nodes of the walk. • Focus on just one intermediate node, you must come via one bridge and leave via a different bridge. • You cannot stay in this node because it is not the beginning node or end node. • This node must have an even number degree. • But all nodes here have odd degrees. • Therefore, the walk is impossible.

  8. A labeled directed graph

  9. A rooted tree

  10. Finite State Machine: Flip Flop (a) The finite state graph for a flip flop and (b) its transition matrix.

  11. String Recognition • The finite state graph • The transition matrix for string recognition example

  12. Portion of the state space for tic-tac-toe

  13. State Space of the 8-Puzzle • “move blank” operations •  -- up •  -- left •  -- down •  -- left

  14. Farmer, wolf, goat, and cabbage problem

  15. FW F FG FC FW State space graph F, W, G, C

  16. Travelling salesperson problem Find the shortest path for the salesperson to travel, visiting each city and returning to the starting city.

  17. Search tree

  18. Greedy heuristic: Visit the closest one next Nearest neighbour path (A, E, D, B, C, A).Cost is 550. Are there better ways to search in this intractable space?

  19. Summary • Given a problem • The right representation will facilitate in finding a solution. • In some cases, graph representation is better map representation or predicates. • In programming, choosing the right data structures will help you to write better codes or software.

More Related