-
Notifications
You must be signed in to change notification settings - Fork 9
Description
Can you explain please the solver algorithm?
It's implemented in solve() in solver.py.
You call it "Equivalence Class Optimisation," and you explain the idea in the comment in the beginning of the function.
I assume the difference between equal and the same constraints is the equal refers to restricting to the same set--have the same effect--as opposed to being the same. For example, x <= 5 and x >= 5 is equal to x = 5, but it's not the same.
Two cells are equivalent if they have the same constraints. Need to look in other files (common.py) to see what exactly the constraints are. I assume it's just derived from the hints: the number of blues (contiguous or not) in a column, in a flower, and a neighbor of a black.
For example, two yellow cells on the same column with an outside number, which are also incident to a black numbered cell, and no other constraints are equivalent.
A class consists of equivalent cells.
I think, however, that it's associated only with a single constraints, so these two cells will share two classes in this case.
"Idea: Have one variable for each class with range 0 to the size of the class. This models the number of cells in the class that are blue."
Each class is associated with a variable, which ranges from 0 to the size of the class. So, by class you mean a set, and the size of the class is the size of the set (number of cells in it).
There's a side story about together-ness.
Then there's something about true/false and trying to vary from the initial solution.