Skip to content

Nested chains - DO NOT MERGE#70

Draft
dobrichev wants to merge 10 commits intomasterfrom
nestedChains
Draft

Nested chains - DO NOT MERGE#70
dobrichev wants to merge 10 commits intomasterfrom
nestedChains

Conversation

@dobrichev
Copy link
Copy Markdown
Collaborator

@dobrichev dobrichev commented Nov 2, 2019

This is a draft pull request for use ONLY as placeholder for comments.
The code is NOT ready for merging.

The improvements done in nestedChains branch compared to master

  • A new class DigitCells that holds alive pencilmarks ordered by value then by cell.
  • A new class HintsCache that collects hints found by particular algorithm for particular grid state for reusing.
  • Two new and currently unused fields in Grid
    • private Grid initialGrid - a reference to a grid state after last applied eliminations,
    • private DigitCells dCells - a reference to current grid state in DigitCells form.
  • Cancellation of experimental nesting techniques beyond those used for hardest vanilla puzzles.
  • Cancellation of code enclosed in if (Settings.getInstance().Fixed14Chaining() == 1).
  • Modifications in Solver.getBatchDifficulty required for handling the global HintsCache.
  • Modifications in Chaining including
    • use of locally built instance of DigitCells for search acceleration,
    • use of HintsCache resulting in almost doubling the speed,
    • removal of fields saveGrid, lastGrid, lastHints after replacing functionalities related to them by better ones,
    • introduction of new field signature required by HintsCache,
    • optimization of some critical loops.

The changes that are not done but are required before merging

  • All instances of solving loop must care about global HintsCache reset between puzzles and purge between applying hint eliminations. Reason for not implementing this is the variety of loops that recently appeared and are difficult to track.
  • All manual interventions to grid state from GUI must handle (or simply reset) the global HintsCache.

Possible further improvements based on the changes

  • Using Grid.initialGrid within hints collection algorithm for comparison between initial grid state and eventually locally modified one. Removal of local clones of the grid where possible, or at least reduce cloning to making a local copy instead of making and then restoring a backup.
  • Using Grid.dCells, after single earlier initialization, in all solving techniques that benefit of it.
  • Using HintsCache by more techniques after implementing a signature for the respective technique.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant