# When sudoku and mathematics intersect

## A pair of mathematicians apply graph theory to the popular sudoku-type puzzles …

Sudoku has exploded in popularity over the past few years. It now runs in many newspapers on a daily basis, and sudoku puzzle collections can be found in bookstores everywhere. In the June/July issue of the Notices of the American Mathematical Society (AMS) a pair of mathematicians take a look at sudoku with a mathematical eye. As stated in the opening paragraphs of the paper (PDF), the authors suggest that when one sits down to solve a sudoku puzzle, the following questions must be asked: "For a given puzzle, does a solution exist? If the solution exists, is it unique? If the solution is not unique, how many solutions are there? Moreover, is there a systematic way of determining all the solutions? How many puzzles are there with a unique solution? What is the minimum number of entries that can be specified in a single puzzle in order to ensure a unique solution?" While I can't say all of those are thoughts I have each time I sit down to do a sudoku puzzle, at times I have thought about a few of them. Whether or not you really need to consider any of them when doing a puzzle is another debate on its own, but they pose interesting mathematical questions about a seemingly simple game.

The authors of the article apply a branch of mathematics known as graph theory to systematically analyze the puzzles. Programmers and mathematicians who read this should be familiar with graph theory; it is the formal study of mathematical "graphs." Graphs are structures that represent the connections between a given set of nodes—they are sometimes referred to as networks. In sudoku, the puzzle can be represented as 81 nodes of a graph, and each number—one through nine—represent different colors. In the sudoku graph view, two nodes are connected by a line segment if they exist in the same row, column, or three by three subgrid. The rules of sudoku place restrictions on how numbers can be connected; no two numbers with the same value can share a row, column, or thee by three subgrid. In the sudoku graph, this would mean a properly solved puzzle would have no two nodes connected which are the same color—since connections only run along row, columns, and throughout subgrids. In graph theory a graph with colored nodes, where no two colors are directly connected is called a graph with "proper" coloring. This is what sudoku solvers try to accomplish when the solve their puzzles: turn a partially colored graph into one with proper coloring.

With the link between the game and a formal branch of mathematics, the authors of the paper could now use the tools, theorems, and proofs that have been developed over the past 271 years for graph theory to study sudoku puzzles. What they found was interesting, and they answered some of the questions listed above. They found that the number of ways to go from a partial coloring to a proper coloring (e.g., solve a puzzle) is given by a polynomial. If the polynomial is zero, then no solution exists for that sudoku puzzle; if it is one, then a single solution exists for that puzzle, and so on. The duo also prove that for a given puzzle to have only one distinct solution, then at least 8 of the 9 numbers must be given, if only 7 are given then at least two solutions are possible. This leads to an interesting—and unsolved—problem in mathematics and now, by extension, sudoku: "Under what conditions can a partial coloring be extended to a unique [proper] coloring?" More generally how much information is really needed to specify a unique solution to a sudoku puzzle or a partially colored graph?

With this question open, the authors also ask, what is the minimum number of entries needed to ensure a unique solution? They give examples of a puzzle with 17 entires that has a unique solution, but also of a puzzle with 29 initial entries that has two possible solutions, illustrating that the problem is not as straightforward as it ay seem. They theorize that a minimum of 16 entries is need for a unique solution to exist. It seems sudoku has fallen into the pile of simple games which can be used to describe a complex mathematical theory, joining the Rubik's cube and Minesweeper. And if one worries that they will end up solving all the sudokus there are—since there is only a finite amount, at least in the original nine-by-nine variety—the authors of the paper show that there are over 5.5 billion unique nine-by-nine sudoku puzzles to keep people busy for a long time.
{"found_math": false, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "url": "https://arstechnica.com/science/2007/06/when-sudoku-and-mathematics-intersect/?comments=1", "fetch_time": 1628080396000000000, "content_mime_type": "text/html", "warc_filename": "crawl-data/CC-MAIN-2021-31/segments/1627046154805.72/warc/CC-MAIN-20210804111738-20210804141738-00386.warc.gz", "warc_record_offset": 112490717, "warc_record_length": 13344, "token_count": 940, "char_count": 4568, "score": 3.671875, "int_score": 4, "crawl": "CC-MAIN-2021-31", "snapshot_type": "latest", "language": "en", "language_score": 0.9532303810119629, "file_path": "/sailhome/yjruan/project/latent-lm/data/processed/finemath-4plus/finemath-4plus/train-00059-of-00064.parquet"}