Skip to content

Commit

Permalink
Improve search about 10% in HTM on 3x3x3 by noting a "surprisingly"
Browse files Browse the repository at this point in the history
large pruning table value and using it to unwind the search space
one more level.
  • Loading branch information
rokicki committed Oct 10, 2023
1 parent 3fda092 commit a86177a
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/cpp/solve.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,8 @@ int solveworker::innerfetch(const puzdef &pd, prunetable &pt, int &togo,
int v = pt.lookuphindexed(h);
int m, mi;
ull mask, skipbase;
if (v > togo + 1) {
v = -1;
} else if (v > togo) {
v = 0;
if (v > togo) {
v = togo - v + 1 ;
} else if (v == 0 && togo == 1 && didprepass &&
pd.comparepos(posns[sp], pd.solved) == 0) {
v = 0;
Expand Down Expand Up @@ -131,10 +129,14 @@ int solveworker::innerfetch(const puzdef &pd, prunetable &pt, int &togo,
solvestates.pop_back();
if (v == 1)
goto upstack;
if (!quarter && v == -1) {
m = randomstart ? randomized[togo][mi] : mi;
if (pd.moves[m].base < 64)
skipbase |= 1LL << pd.moves[m].base;
if (v < 0) {
if (!quarter && v == -1) {
m = randomstart ? randomized[togo][mi] : mi;
if (pd.moves[m].base < 64)
skipbase |= 1LL << pd.moves[m].base;
} else {
skipbase = -1 ; // skip *all* remaining moves!
}
}
downstack:
mi++;
Expand Down

0 comments on commit a86177a

Please sign in to comment.