Sudoku Meets Linear Optimization

Sudoku is a logic-based number puzzle played on a $9 \times 9$ grid, divided into nine smaller $3 \times 3$ blocks. The goal is to fill the grid with digits from $1$ to $9$ in such a way that each number appears exactly once in every row, column, and block.

The modern version of Sudoku was popularized in the late 1980s by the Japanese puzzle company Nikoli, although its roots go back earlier to a puzzle called “Number Place” published in the United States in 1979. Interestingly, the name “Sudoku” is an abbreviation of the Japanese phrase “Sūji wa dokushin ni kagiru”, which means “the digits must be single” or “the digits must occur only once”. Sudoku puzzles have since become a global phenomenon, appearing in newspapers, books, and apps, and they are enjoyed by millions for their combination of logic, pattern recognition, and problem-solving.

A valid Sudoku puzzle starts with some cells already filled, and the player must deduce the remaining numbers using logical reasoning, rather than guessing. For instance, consider the following Sudoku:

This Sudoku can be solved as follows:

The Sudoku can be formulated as a binary optimization model. Do you dare to try it?




If you found this useful, please cite this as:

Martín-Campo, F. Javier (Dec 2025). Sudoku Meets Linear Optimization. https://www.fjmartincampo.com/blog/2025/sudoku/.

or as a BibTeX entry:

@misc{martín-campo2025sudoku-meets-linear-optimization,
  title   = {Sudoku Meets Linear Optimization},
  author  = {Martín-Campo, F. Javier},
  year    = {2025},
  month   = {Dec},
  url     = {https://www.fjmartincampo.com/blog/2025/sudoku/}
}



Enjoy Reading This Article?

Here are some more articles you might like to read next:

  • Discovering the mirror of linear optimization, the fascinating world of duality
  • Convergence, Degeneracy, and the "Dark Side" of the Simplex
  • How to recognize the different types of solutions in linear optimization using the Simplex algorithm
  • Starting the Simplex Method, how to begin when no obvious basic solution exists
  • The Simplex Algorithm, the engine of mathematical optimization