190 likes | 303 Views
Maze Running in C Minor. A Series of Slides in 5 Parts Movement 4. Best-First. AT: AA. HEAP: AB – 5+1. Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited. AT: AB.
E N D
Maze Running in C Minor A Series of Slides in 5 Parts Movement 4. Best-First
AT: AA HEAP: AB – 5+1 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: AB HEAP: CA – 4+2 BB – 4+2 Since we know that keeping track of where we’ve visited makes for a more efficient search, we’ll only insert nodes we’ve not visited into the heap. Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: CA HEAP: BB – 4+2 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: BB HEAP: BA – 5+3 CB – 3+3 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: CB HEAP: BA – 5+3 DB – 2+4 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: DB HEAP: BA – 5+3 DA – 3+5 DC – 1+5 EB – 3+5 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: DC HEAP: BA – 5+3 DA – 3+5 EB – 3+5 CC – 2+6 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: BA HEAP: DA – 3+5 EB – 3+5 CC – 2+6 CA – 4+4 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: DA HEAP: EB – 3+5 CC – 2+6 CA – 4+4 At this point, we have found another path to CA, but it’s priority is 4+5. Since it is larger than the previous, we ignore it. Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: EB HEAP: CC – 2+6 CA – 4+4 EA – 4+6 EC – 2+6 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: EB HEAP: CC – 2+6 CA – 4+4 EA – 4+6 EC – 2+6 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: CC HEAP: CA – 4+4 EA – 4+6 EC – 2+6 BC – 3+7 CD – 1+7 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: CA HEAP: EA – 4+6 EC – 2+6 BC – 3+7 CD – 1+7 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: EC HEAP: EA – 4+6 BC – 3+7 CD – 1+7 ED – 1+8 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: CD HEAP: EA – 4+6 BC – 3+7 ED – 1+8 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: ED HEAP: EA – 4+6 BC – 3+7 DD – 0+9 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
AT: DD HEAP: EA – 4+6 BC – 3+7 Nodes are taken in the order: UP, LEFT, DOWN, RIGHT The heap is emptied in a FIFO order when it comes to duplicates. KEY: GREEN – Start RED – Exit YELLOW – Visited
Interestingly enough, this was a bad maze for A* Search. However, as you will see on the test mazes provided for the programming project, A* will often outperform Best-first search.