Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I've tried 4x4 magic square but it always returns None with MinConflictsSolver.
However, the following code works
from constraint import * problem = Problem() problem.addVariables(range(0, 9), range(1, 9 + 1)) problem.addConstraint(AllDifferentConstraint(), range(0, 9)) problem.addConstraint(ExactSumConstraint(15), [0, 4, 8]) problem.addConstraint(ExactSumConstraint(15), [2, 4, 6]) for row in range(3): problem.addConstraint(ExactSumConstraint(15), [row * 3 + i for i in range(3)]) for col in range(3): problem.addConstraint(ExactSumConstraint(15), [col + 3 * i for i in range(3)]) solutions = problem.getSolution() print(solutions)
The text was updated successfully, but these errors were encountered:
Also may I have some more documentation about constraint propagation via doArc8? I don't understand that I am afraid.
Sorry, something went wrong.
No branches or pull requests
I've tried 4x4 magic square but it always returns None with MinConflictsSolver.
However, the following code works
The text was updated successfully, but these errors were encountered: