-
Notifications
You must be signed in to change notification settings - Fork 0
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
Solver find solutions method #79
base: main
Are you sure you want to change the base?
Conversation
…also be satisfactory.
…r.FindSolutions. No tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall this is looking good. A few minor changes requested.
Also (and not sure if this is applicable) didnt we already implement a solver method? Is there any reason you cant extend the capabilities of the current method instead of adding a new method?
// If a limit is specified and the result count exceeds it, return only the correct number of solutions. | ||
if (limit != 0 && result.Count > limit) | ||
{ | ||
return result.Take(limit).ToList(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to take a limit here? Shouldn't SolveRecAll already give you the limit?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is to avoid edge cases where the list contains one too many solutions. I'm not sure if these cases exist, but I'm not sure how to properly test for it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then i think you should try to gain an understanding of that. A test like this is really error prone and probably not even needed.
Would be nice if you could mention the known improvements here for further documentation. Also when opening pull requests without an issue attached listing the reasons for the changes could help when reviewing. |
The purpose of the FindSolutions method, is to allow other wanted features late. IsProper() can be infered by asking if FingSolutions() returns more than one solution. These found solutions can also be used to create boards. I am working on a separate branch to test improvements such as:
|
Added Solver.FindSolutions(), which returns all, or a certain number of solutions to a given board. Can also randomize.
Also added Board.Validate with tests
There are several known improvements that can be made, but these will be part of a larger performance test of the solver.