-
-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optimize solving efficiency. #94
Open
BloodmageThalnos
wants to merge
54
commits into
dclamage:dev
Choose a base branch
from
BloodmageThalnos:dev
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
All tests pass.
Re-enabled fish logic. All tests still pass.
Fixed printing single line.
…ich cannot repeat digits. Known bug: SolveUniqueVariantFPuzzles takes longer. Will track this down.
… memoization system.
Also includes fix for contradictions being enabled even when requested off if not human stepping.
Use of Visual Studio 2022 is highly recommended, especially for those previously using VS2019 - VSCode / commandline API should still work, but make sure your commandline API is updated to .NET 6.0.x C#10 features used: - Using implicit and global usings so that most files now do not list any using. - All namespaces now using the file scope format so that braces aren't required around the entire file. - New Json parser that uses compile-time code generation instead of reflection Enabled link trimming - Significantly reduces the file size of the distribution - Required removing reflection: o The unused "plugin" system has been removed o Reflection is no longer used to locate constraints. They are now explicitly specified in ConstraintManager Replaced Mono.Options with McMaster.Extensions.CommandLineUtils - Command-line options remain the same, but are now parsed by this library. - The hope here was that it's a maintained library and as such wouldn't have trim warning. - It does at the moment still have trim warnings, but the library appears to function properly anyway. - I liked the interface for this better so I'm sticking with it regardless. Publishing ARM64 build for OSX GitHub actions now deleted any PDBs before zipping up the release.
Refactored AIC logic to be in its own file/class.
Re-evaluate weak links during logical stepping.
Also fixed the solver script's shim
Fixed text offset for single value xsums
…e single value is placed (only values within the cell are eliminated). AICs now prefer shorter chains over number of candidates eliminated.
…modify the buttons in the solver panel.
…s are still empty in the row.
Added "digital root" cages which are specified as cosmetic cages in f-puzzles with value "DRN" where N is the digital root desired, like "DR2". This uses the multi-sum killer cage constraint to allow any sum which has the specified digital root, and also enforces non-repeat within the cage.
Currently no step solving but candidate logic is implemented.
Still need to add a few specific cases e.g. a group being ruled out by sudoku rules.
Fixed an issue where the value index of a cell was used to get a group index rather than the group being found from the index of the cell.
I'm a little bit confused because you said you changed it to use |
The previous commit was incidentally pushing the wrong testing version. Re-pushed a fix. Sorry for the confusion. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The logic solving process for some puzzles are significantly slow, especially the AIC process. I found that the data structure used for weaklinks was
SortedSet<int>
, which is costful when copying and accessing. Changing it toList<int>
can save about 40% of time. Here is some experiment detail.F-puzzle strings of two puzzles:
N4IgzglgXgpiBcBOANCA5gJwgEwQbT1ADcBDAGwFc54AmVNCImAOwQBcMr7GWAFFgMYQyAWRIYA1mATMKZMgF9koBk2b9mQ0eKky5i5SFKVqAdm5r2nGBb6DhYydPiz5SlT3X3tTvW8OqdpoOOs6uBh5qGlqOui767uie0SG+8f6RQTGhfhFJUd6xYQkAusiE+VmpceGJgV7BPjUJAcmFOel59SlNxRlG5FQIABy2rPAcXJUN2Wm1rQWNRbl1bUsd85kz1X15xkPwAIxjVlPd7XOl5Vs9y52ri7PN/efrly9rT7sPVb0rC787ptprcNi0bhdnntBtQUNNTjYQZDvmUKvtqAA2E4TaxjUHvaEmBDme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