5
$\begingroup$

Here is another interesting Colombian Sudoku. The rules are as follows: complete the Sudoku on the left with numbers from 1 to 8 using the grid on the right. Keep in mind that the number of dots in each column indicates how many numbers will match in the solved Sudoku. The same applies to the rows. The colors are just for decoration. enter image description here

$\endgroup$

2 Answers 2

2
+200
$\begingroup$

You can solve the problem via integer linear programming as follows, with binary decision variables $x_{ijk}$ to indicate whether cell $(i,j)$ contains digit $k$:

For each region (row, column, or $2\times4$ box) $r$, let $C_r$ be the set of $8$ cells in that region. Let $a_{ij}$ be the $12$ given clues in the left matrix. Let $b_{ij}$ be the given values in the right matrix. Let $r_i$ be the number of matches in row $i$, and let $c_j$ be the number of matches in column $j$. The constraints are as follows: \begin{align} \sum_{k=1}^8 x_{ijk} &= 1 &&\text{for all cells $(i,j)$} \tag1\label1 \\ \sum_{(i,j)\in C_r} x_{ijk} &= 1 &&\text{for all regions $r$ and digits $k$} \tag2\label2 \\ x_{ija_{ij}} &= 1 &&\text{for all clue cells $(i,j)$} \tag3\label3 \\ \sum_{j=1}^8 x_{ijb_{ij}} &= r_i &&\text{for all rows $i$} \tag4\label4 \\ \sum_{i=1}^8 x_{ijb_{ij}} &= c_j &&\text{for all columns $j$} \tag5\label5 \end{align} Constraint \eqref{1} assigns exactly one digit to each cell. Constraint \eqref{2} assigns each digit to exactly one cell per region. Constraint \eqref{3} enforces the given clues. Constraint \eqref{4} enforces the row match counts. Constraint \eqref{5} enforces the column match counts.

The unique solution turns out to be:

\begin{matrix}7 & 1 & 6 & 5 & 4 & 2 & 3 & 8\\2 & 8 & 3 & 4 & 1 & 5 & 6 & 7\\1 & 5 & 8 & 6 & 3 & 7 & 4 & 2\\3 & 4 & 2 & 7 & 6 & 8 & 1 & 5\\6 & 3 & 5 & 2 & 8 & 4 & 7 & 1\\8 & 7 & 4 & 1 & 5 & 6 & 2 & 3\\5 & 6 & 7 & 3 & 2 & 1 & 8 & 4\\4 & 2 & 1 & 8 & 7 & 3 & 5 & 6\\\end{matrix}

$\endgroup$
3
$\begingroup$

The answer is:

enter image description here ...... I don't know how to show my reasoning process better yet.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.