I'm exploring the use of SAT solvers to find a permutation of the numbers 1, 2, and 3, subject to specific constraints. Initially, I considered employing nine variables: $x_{1,1}, x_{1,2}, \dots, x_{3,3}$, where $x_{i,j}$ is true if the number $i$ is placed in position $j$ in the permutation.
However, since there are only $3! = 6$ possible permutations, it seems excessive to use nine variables. I'm contemplating using just three boolean variables, $y_1, y_2, y_3$. My idea is to map each permutation to a unique combination of true or false values of these $y_i$'s. But I'm finding it challenging to formulate the constraints under this scheme.
Could there be a more efficient encoding strategy that strikes a balance between the number of variables and their expressive power? I'm seeking a method that simplifies the representation of permutations and constraints in a SAT solver context.
If you can choose with repetition, obviously this won't work - you really will need to encode all three numbers for each variable, because you'll always have three choices at each selection.
– Lee Davis-Thalbourne Jan 11 '24 at 03:36