Download presentation
Presentation is loading. Please wait.
Published byΠήγασος Βιτάλη Modified over 5 years ago
1
A Series of Slides in 5 Parts Movement 4. Best-First
Maze Running in C Minor A Series of Slides in 5 Parts Movement 4. Best-First
2
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
3
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
4
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
5
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
6
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
7
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
8
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
9
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
10
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 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
11
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
12
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
13
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
14
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
15
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
16
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
17
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
18
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
19
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.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.