Use HeapSet, a combination set and priority queue #13
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solves #4
HeapSet allows a basic heap interface while maintaining only one copy of the state in the heap.
If a state is inserted more than once, the better is kept.
Memory use went down for larger search spaces after introducing this set.
Memory use went up for smaller search spaces, which should be
investigated.
Small 2x2
Before: total heap usage: 118 allocs, 118 frees, 48,803 bytes allocated
After: total heap usage: 130 allocs, 130 frees, 49,379 bytes allocated
Medium 3x3
Before: total heap usage: 26,761 allocs, 26,761 frees, 2,335,947 bytes allocated
After: total heap usage: 23,740 allocs, 23,740 frees, 2,009,883 bytes
allocated