Implement backtracking for multi_phase_search, set max depth for 4x4x4 phase3 solver - #165
Implement backtracking for multi_phase_search, set max depth for 4x4x4 phase3 solver#165Nogesma wants to merge 2 commits into
Conversation
Switch the SearchPhase trait solutions to not take a mutable reference, and instead use a RefCell to get interior mutability for increasing the size of the prune table.
|
Backtracking for multi-phase is definitely something I've wanted for a while! Before I take a look, I need to ask: was an LLM or similar tool used in preparing this PR in any way? |
|
The code is entirely mine, but I did use an LLM to get better understanding of the repo before I implemented this ie. asking question about the code, but never asking it to write code. |
|
After testing a bit more, I noticed some scrambles can take a lot more time (~400s). This is due to the solver not finding a solution at depth 14 for phase3, for multiple phase2 solutions. I was thinking of adding a field to |
Switch the
SearchPhasetrait solutions to not take a mutable reference, and instead use aRefCellto get interior mutability for increasing the size of the prune table.Also sets the
max_depth_exclusiveto 15 for the 4x4x4 phase3.From what I benchmarked, setting it to 14, as it was in the comment makes it take several times longer to solve. Increasing it to 15 fixes it.
This is basically a ~1% regression for scrambles that were finding a solution without backtracking, due to the introduction of the RefCell, but a improvement of 10-35% for the rest. The benchmark code I used is in
src/lib/bin/bench4x4x4.rs