Ejemplo n.º 1
0
def most_constrained_cell(node):
    """
    Compte le nombre de possibilités pour la case qui a subit l'action.
    """
    if node.parent is None:
        return 0
    i, j, k = node.action
    return count_possibilities(node.parent.state, i, j)
Ejemplo n.º 2
0
 def actions(self, state):
     return sorted(Sudoku.actions(self, state), key=lambda x: count_possibilities(state, x[0], x[1]))