DEV Community

Cover image for Building a playable Graeco-Latin Sudoku square: the math behind Suirodoku
Jordan Maire
Jordan Maire

Posted on

Building a playable Graeco-Latin Sudoku square: the math behind Suirodoku

In 1782, Euler imagined arranging 36 officers in a square so that no regiment and no rank repeated in any row or column. He couldn't solve it. The structure he imagined, Graeco-Latin squares, became a cornerstone of combinatorics.

I turned it into a puzzle you can play.

What is Suirodoku?

A 9×9 grid where each cell contains a digit (1-9) AND a color (9 colors). The rules:

  • Each row contains all 9 digits and all 9 colors
  • Each column contains all 9 digits and all 9 colors
  • Each 3×3 block contains all 9 digits and all 9 colors
  • Each of the 81 digit-color pairs appears exactly once

That last rule is what makes it fundamentally different from Sudoku. Every cell has a unique identity.

The interesting math

I formalized Suirodoku as a Constraint Satisfaction Problem. Classical Sudoku has 27 constraints. Suirodoku has 55.

The global pair uniqueness constraint creates a bijection between cells and pairs. This means solving techniques exist that have no Sudoku equivalent:

  • Rainbow Technique: track one digit across all 9 colors
  • Chromatic Circle: track one color across all 9 digits

An open problem

The God Digit Problem: must every uniquely solvable Suirodoku puzzle contain all 9 digits among its clues? In Sudoku you can always relabel digits, but Suirodoku's global constraint breaks that symmetry.

I proved a Dichotomy Theorem: either no digit is critical, or all are. Which one holds remains unsolved.

Try it suirodoku.com

Research paper: Zenodo

Top comments (0)