RSS Amplifier

sysid blog · Apr 26, 2020

Sudoku

0
Sign in to vote or save

This page cannot be shown here. You can still read it on the original site — the toolbar below keeps your place in the directory.

Wikipedia a logic-based, combinatorial number-placement puzzle. Fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid contain all of the digits from 1 to 9. The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution. Challenges Understand the problem (easy) Design the index sets (medium)…

Wikipedia

a logic-based, combinatorial number-placement puzzle.

Fill a 9×9 grid with digits so that each column, each row, and each of the nine 3×3 subgrids that compose the grid contain all of the digits from 1 to 9.

The puzzle setter provides a partially completed grid, which for a well-posed puzzle has a single solution.

Challenges

  1. Understand the problem (easy)
  2. Design the index sets (medium)
  3. Translate the model into Pyomo (easy)

Tooling

  • Pyomo as LP modelling language
  • Optimizer: CBC
  • Python

Model

Indexing Schema

Variables

$$ y^m_{i,j;k} = \begin{cases} 1, \ \text{ when cell \((i,j;k)\) contains number \(m\) }\\ 0, \ \text{ else }\\ \end{cases} $$

Read on /sudoku/

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.