You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Optimizing the A* Algorithm - presents a couple high-level improvements: replace closed list with a boolean flag, conditional use of a priority queue, and early expansion of nodes
Partially address LearnProgramming#8
HeapSet now remembers all states whether they are on the heap or not and has accordingly been renamed to CachingHeapSet.
States will only be put on the heap, updated, or reinserted if they a) were not there before or b) are not closed and of higher priority than what's already on the heap.
States are optionally closed when they are popped off the heap.
Memory use and allocations went down from eliminating the extra set.
3x3 case
---
Before: total heap usage: 27,547 allocs, 27,547 frees, 2,123,227 bytes
allocated
After: total heap usage: 26,681 allocs, 26,681 frees, 2,087,203 bytes
allocated
There has been some research on improving the general A* algorithm. We should see if any of these optimizations may be (optionally) applied.
See also: http://theory.stanford.edu/~amitp/GameProgramming/
The text was updated successfully, but these errors were encountered: