1 / 47

Information of the LO

Information of the LO. Subject: Data Structures, Algorithms Topic: Maze Routing Education Level : UG Problem Statement: Given a n x n maze, find a path from start to finish by moving either horizontally or vertically without going through the walls. Authors: Mentor:

geordi
Download Presentation

Information of the LO

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. Information of the LO • Subject: Data Structures, Algorithms • Topic: Maze Routing • Education Level: UG • Problem Statement: • Given a n x n maze, find a path from start to finish by moving either horizontally or vertically without going through the walls. • Authors: Mentor: • Jasveer Singh T. Jethra Prof. Sachin Patkar • Priyadarshan H 1

  2. Pre requisites Before using this LO, the user should know about the following: No prerequisites 2

  3. Learning objectives • After interacting with this LO the user should be able to: • Find a path in a maze from start to finish. 3

  4. Keywords in this LO These are the keywords and their description in this LO Live Node: This is a node which has been traversed and all possible ways of expansion have not been explored. 2. E-node: E-node or Expansion Node is the current node from which we explore for possible empty nodes in the neighbourhood. There is only one E-node at any instant. 3. Dead Node: If we leave a E-node from the direction in which this node was entered then it becomes a dead node. This node is to be treated as a wall in future. 4. Wall: It is a node (block) which cannot be entered. 4

  5. 5. Empty Node: This is a node which is available for traversal. 6. Start Node: It is the node from which we start traversing the maze. This node can never be a wall. 7. Finish Node: It is a node where we intend to reach. This node can never be a wall. 5

  6. Element groups in this LO 6

  7. Element groups in this LO – Sample template of LO Maze On screen text/Interactivity block Legend 7

  8. Write the name of the element group 1 - Maze The title of each column explains contains guidelines on the details required.) # Refer Keywords slide No. 4 8

  9. Functionality of Maze It is a square area of n x n blocks with walls on the four sides of the boundary and walls at some places within the n x n area. In the square area excluding the walls, the (1,1) block represents the start node and (n,n) block represents the finish node. These blocks are always empty. The figure in slide no. 13 shows a maze with all empty blocks surrounded by walls. The fig in slide no. 17 shows a maze with walls within. 9

  10. Write the name of the element group 3 - Interactivity The title of each column explains contains guidelines on the details required.) 10

  11. Functionality of Wall styles • Default: • When user selects this style, the animator can choose any maze of n x n size which should be legibly displayable on the screen with the only constraint that there should not be any walls in the interior of the wall. • Predefined Path: • When user selects this style, the animator can choose any maze of n x n size which should be legibly displayable on the screen with the only constraint that there should exist a path from start to finish. For instance, see the maze shown in slide no. 17. • 3. No Path: • When user selects this style, the animator can choose any maze of n x n size which should be legibly displayable on the screen with the only constraint that there should NOT exist any path from start to finish. For instance, in any maze surround the Finish Node with walls. 11

  12. Write the name of the element group 4 - Legend The title of each column explains contains guidelines on the details required.) Legend: Expansion Node (E-node) Dead Node Wall Empty Node Start Node Live Node Finish Node Interactivity (for both Demo and Interactivity part): When the user places the mouse pointer on top of any of the legend objects, popup a message which defines that particular object. Use the definition as given in the Keywords (Refer Slide no. 4). For instance, if the user places his mouse pointer on “Wall” object, then popup “It is a node (block) which cannot be entered”. 12

  13. Supportive image for step 1 13

  14. Step 1 14

  15. Maze Routing Algorithm • Begin from the start node. • Start node becomes live node. • Now this live node will become the E-node. • For start node apply the Precedence Rule no. 1. • A. If empty node does not exist then Print ”No path found” and jump to step 10. • B. Else make the new empty node as live node. • A. If this node is the finish node then we have successfully routed the maze. Jump to step 10. • B. Else this node becomes our E-node. • Apply precedence rule to this E-node. • A. If precedence no. 4 is selected then E-node becomes dead node. (This node was already made live node previously). • i. If the E-node is start node. then print “No path found”. Jump to step 10. • B. Else make the new empty node live node. • Jump to step 6. • End. • Note: 1. A live node will remain alive unless it becomes dead. • 2. There is only one E-node at any instant. • 3. For Precedence Rule refer next slide. 15

  16. Precedence rule Case no. 1 : If the incoming direction is from the left, then precedence for selecting the new empty node is shown in the fig. (a). Case no. 3 : If the incoming direction is from the right, then precedence for selecting the new empty node is shown in the fig. (c). Figure (a) Case no. 2 : If the incoming direction is from the top, then precedence for selecting the new empty node is shown in the fig. (b). Case no. 4 : If the incoming direction is from the bottom, then precedence for selecting the new empty node is shown in the fig. (d). Figure (b) Figure (c) Figure (d) 16

  17. Supportive image for step 2 (fig. 0) 17

  18. Step 2 - Demo Note: The nos. in the Fig. no. column represents the fig. no. mentioned in supportive images for step 2 18

  19. Supportive image for step 2 (fig. 1) 19

  20. Supportive image for step 2 (fig. 2) 20

  21. Supportive image for step 2 (fig. 3) 21

  22. Supportive image for step 2 (fig. 4) 22

  23. Supportive image for step 2 (fig. 5) 23

  24. Supportive image for step 2 (fig. 6) 24

  25. Step 2 – Demo (contd.) * Note: This is continued in the next slide as well so please create appropriate intermediate figures for remaining steps. 25

  26. Supportive image for step 2 (fig. 7) 26

  27. Supportive image for step 2 (fig. 8) 27

  28. Supportive image for step 2 (fig. 9) 28

  29. Supportive image for step 2 (fig. 10) 29

  30. Supportive image for step 2 (fig. 11) 30

  31. Supportive image for step 2 (fig. 12) 31

  32. Supportive image for step 2 (fig. 13) 32

  33. Supportive image for step 2 (fig. 14) 33

  34. Supportive image for step 2 (fig. 15) 34

  35. Supportive image for step 2 (fig. 16) 35

  36. Supportive image for step 2 (fig. 17) 36

  37. Supportive image for step 2 (fig. 18) 37

  38. Supportive image for step 2 (fig. 19) 38

  39. Supportive image for step 2 (fig. 20) 39

  40. Supportive image for step 2 (fig. 21) 40

  41. Supportive image for step 2 (fig. 22) 41

  42. Supportive image for step 2 (fig. 23) 42

  43. Question 1: Can a finish node become a Dead Node? • Answers: • 1. Yes 2. No 3. Sometimes • Correct answer: 2 • Feedback/Justification to be displayed: • If user clicks correct answer then display: “Correct! As soon as the Finish Node becomes Live Node, the algorithm terminates.” • If user clicks incorrect answer then display “Have a look at the animation and Try again!” 43

  44. Question 2:When Start Node becomes a Dead Node then • Answers: • Path is found • No path is found • Start Node cannot become a Dead Node • Correct answer: 2 • Feedback/Justification to be displayed: • If user clicks correct answer then display “Correct! As soon as the Start Node becomes Dead Node, the algorithm terminates.” • If user clicks incorrect answer then display “Have a look at the animation and Try again!” 44

  45. Question 3: Consider the situation as shown in the figure, The next E-node is.. Answers: 1 2 3 4 Correct answer: a • Feedback/Justification to be displayed: • If user clicks correct answer then display “Correct! Make sure you can explain the reasoning!” • If user clicks incorrect answer then display “Scan Clockwise starting from the incoming direction. The direction is from 2 as it the only Live Node other than the E-node.” 45

  46. Question 4: If no path is found, then select the option which will always stand true.. Answers: All blocks are either Dead Nodes or walls. All blocks which were Live Nodes are Dead. There are no Dead Nodes. None of the above Correct answer: b • Feedback/Justification to be displayed: • If user clicks correct answer then display “Correct! A node can become a Dead Node only if it leaves E-node from the direction from which it entered.” • If user clicks incorrect answer then display “Have a look at the animation and Try again!” 46

  47. References Website links: http://www.cise.ufl.edu/~sahni/dsaaj/JavaVersions/applications/ratmaze/maze.htm Books: “Data Structures, Algotithms amd Analysis” by Sahni and Sartaj. 47

More Related