diff options
| author | Sebastiano Tronto <sebastiano@tronto.net> | 2026-01-09 20:33:39 +0100 |
|---|---|---|
| committer | Sebastiano Tronto <sebastiano@tronto.net> | 2026-01-09 20:34:04 +0100 |
| commit | ce5fe8d47923f32d9f42c270e53fb1f2692e952a (patch) | |
| tree | cde86f780e207ac4501b49c28f4a21024a7b5891 /src/solvers | |
| parent | 37eaf8ac70dc5e12749657dea6dfb6488c20e703 (diff) | |
| download | nissy-core-ce5fe8d47923f32d9f42c270e53fb1f2692e952a.tar.gz nissy-core-ce5fe8d47923f32d9f42c270e53fb1f2692e952a.zip | |
Improve visited nodes count
Diffstat (limited to 'src/solvers')
| -rw-r--r-- | src/solvers/h48/solve.h | 8 |
1 files 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]) | |||
| 291 | cube_t cube, backup_cube, backup_inverse; | 291 | cube_t cube, backup_cube, backup_inverse; |
| 292 | h48_prune_t prune[NMOVES]; | 292 | h48_prune_t prune[NMOVES]; |
| 293 | 293 | ||
| 294 | nn = arg->solution_moves->nmoves; | ||
| 295 | ni = arg->solution_moves->npremoves; | ||
| 296 | nm = nn + ni; | ||
| 297 | |||
| 298 | if (equal(arg->cube, SOLVED_CUBE) || /* Solved before target depth */ | 294 | if (equal(arg->cube, SOLVED_CUBE) || /* Solved before target depth */ |
| 299 | arg->solution_list->nsols >= arg->solution_settings->maxsolutions) | 295 | arg->solution_list->nsols >= arg->solution_settings->maxsolutions) |
| 300 | return 0; | 296 | return 0; |
| 301 | 297 | ||
| 298 | nn = arg->solution_moves->nmoves; | ||
| 299 | ni = arg->solution_moves->npremoves; | ||
| 300 | nm = nn + ni; | ||
| 302 | target = arg->target_depth - (nm + 1); | 301 | target = arg->target_depth - (nm + 1); |
| 303 | mm_normal = arg->movemask_normal; | 302 | mm_normal = arg->movemask_normal; |
| 304 | mm_inverse = arg->movemask_inverse; | 303 | mm_inverse = arg->movemask_inverse; |
| @@ -309,6 +308,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1]) | |||
| 309 | continue; | 308 | continue; |
| 310 | cube = move(arg->cube, m); | 309 | cube = move(arg->cube, m); |
| 311 | arg->solution_moves->moves[nn] = m; | 310 | arg->solution_moves->moves[nn] = m; |
| 311 | arg->nodes_visited++; | ||
| 312 | if (!equal(cube, SOLVED_CUBE)) | 312 | if (!equal(cube, SOLVED_CUBE)) |
| 313 | continue; | 313 | continue; |
| 314 | wrapthread_mutex_lock(arg->solutions_mutex); | 314 | wrapthread_mutex_lock(arg->solutions_mutex); |
