From ce5fe8d47923f32d9f42c270e53fb1f2692e952a Mon Sep 17 00:00:00 2001 From: Sebastiano Tronto Date: Fri, 9 Jan 2026 20:33:39 +0100 Subject: Improve visited nodes count --- src/solvers/h48/solve.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h index 1522c0b..fcd2762 100644 --- a/src/solvers/h48/solve.h +++ b/src/solvers/h48/solve.h @@ -291,14 +291,13 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1]) cube_t cube, backup_cube, backup_inverse; h48_prune_t prune[NMOVES]; - nn = arg->solution_moves->nmoves; - ni = arg->solution_moves->npremoves; - nm = nn + ni; - if (equal(arg->cube, SOLVED_CUBE) || /* Solved before target depth */ arg->solution_list->nsols >= arg->solution_settings->maxsolutions) return 0; + nn = arg->solution_moves->nmoves; + ni = arg->solution_moves->npremoves; + nm = nn + ni; target = arg->target_depth - (nm + 1); mm_normal = arg->movemask_normal; mm_inverse = arg->movemask_inverse; @@ -309,6 +308,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1]) continue; cube = move(arg->cube, m); arg->solution_moves->moves[nn] = m; + arg->nodes_visited++; if (!equal(cube, SOLVED_CUBE)) continue; wrapthread_mutex_lock(arg->solutions_mutex); -- cgit v1.3