Math and Sudoku

Math and Sudoku

Math and Sudoku Exploring Sudoku boards through graph theory, group theory, and combinatorics Kyle Oddson Under the direction of Dr. John Caughman Math 401 Portland State University Winter 2016 Abstract Encoding Sudoku puzzles as partially colored graphs, we state and prove Akman’s theorem [1] regarding the associated partial chromatic polynomial [2]; we count the 4x4 sudoku boards, in total and fundamentally distinct; we count the diagonally distinct 4x4 sudoku boards; and we classify and enumerate the different structure types of 4x4 boards. Introduction Sudoku is a logic-based puzzle game relating to Latin squares [3]. In the most common size, 9x9, each row, column, and marked 3x3 block must contain the numbers 1 through 9. A sudoku board can be formed for any n ∈ ℕ, with the resulting board having n n x n blocks and total size �!x �!. In this investigation, we will use n = 2 for our boards, for 4x4 sudoku. We selected this size, as opposed to the standard 9x9, for ease of calculation: there exist somewhere on the order 10!" 9x9 boards [4]. As will be shown, there exist a great deal fewer 4x4 boards. I. Sudoku Puzzles and Boards as Graphs, and Partial Chromatic Polynomials Considering a sudoku board as a mathematical object, it is useful to encode a completed board as a graph: each vertex corresponds to a cell in the board, and two distinct vertices are adjacent iff the two cells share a row, column, or n x n block. Let a sudoku board be a completed sudoku puzzle, so that each of the �! cells contains a digit. Let a sudoku puzzle be a partially completed sudoku board: that is, at most �! − 1 cells contain digits. Any cell containing a digit can thus be encoded as a colored vertex. If a board is properly solved—i.e., the rules of sudoku are respected and every cell contains a digit—then the graph has a proper coloring. Any puzzle, then, corresponds to a partial coloring of at least one board. A well-formed puzzle corresponds to exactly one board: a well-formed puzzle has a unique solution. This is not the case for every puzzle; indeed, a puzzle that is not well- formed may not have a solution, and will not correspond to any board. Note: individual cells shall be referred to by their (���, ������) coordinates. An equivalence class of a cell shall comprise all cells currently marked with, or to include, the same entry as the cell. Take, for example, the puzzle: 2 4 3 2 2 3 4 1 4 1 2 3 Figure 1: A 4x4 sudoku puzzle. As a partially colored graph, we have equivalence classes: "1" = 1, 1 = 1, 1 , 3, 4 ; "2" = 1, 2 = 1, 2 , 2, 4 , 3, 1 , 4, 3 ; "3" = 2, 1 = 2, 1 , 3, 2 , 4, 4 ; "4" = 1, 4 = { 1, 4 , 3, 3 , 4, 1 }. Any board correspond to this puzzle will be a completion of this puzzle. Any properly colored board corresponding to the coloring of this puzzle will be consistent with the partial coloring of the puzzle. According to the standard rules of sudoku, only �! colors, or the numbers {1, … , �} may be used to complete the coloring/board. However, the only requirement for a proper coloring to be consistent with the partial coloring is that the already-colored vertices retain their colors (this also implies that the existing equivalence classes and independent sets retain their current members). Then the minimum number of colors required for a proper, consistent, completion of any partial coloring is equal to the number of colors present in the partial coloring, which is the same as the number of distinct digits appearing in the puzzle. The maximum number of colors which may appear in a proper, consistent, completion of a partial coloring is equal to the number of blank cells plus the number of colors appearing in the puzzle: to be consistent, a proper completion must not change any of the colors used, and so will require at least that many colors. Going beyond standard sudoku play, each blank cell may receive an unused distinct digit. Then the greatest number of colors for any proper, consistent completion is the sum of the number of distinct clues and the number of empty cells. Any two vertices with the same color share an equivalence class; further they are in the same independent set. Note that there is a one-to-one correspondence between independent sets and color classes. Any un-colored vertex (empty cell) may be placed into an existing independent set, provided that the coloring remains proper (the rules of sudoku are respected), or it may be placed into a new independent set. Call a proper completion of the partial coloring generic if it is merely a partitioning of the vertices into independent sets: that is, no colors assigned to the empty cells while they are placed into color classes. Using the technique of deletion-contraction, the chromatic polynomial of a graph can be found: �(�, �), where �(�, �) equals the number of proper vertex colorings of the graph G using at most k colors. This technique can also be used on a partially colored graph, to generate the partial chromatic polynomial. If we observe the same puzzle as Fig. 1, we see that cell (1, 3) must avoid two colors, those of color classes “2” and “4”. More specifically, the cell (1, 3) cannot share a color class with equivalence classes 1, 2 & [ 1, 4 ]. 2 4 3 2 2 3 4 1 4 1 2 3 We shall encode the empty cells as a graph (with the vertices labeled with their grid coordinates): We shall now encode it as a partially colored graph, replacing the vertex labels with the color classes each vertex must avoid for a proper coloring: When applying deletion-contraction, any vertex formed by contracting an edge shares the adjacencies, and thus the coloring restrictions, of the previously distinct vertices. Then the restricted color classes of a contracted-edge vertex correspond to the union of the restrictions of the distinct vertices. We now apply deletion- contraction to our sample partial coloring, using the recursion formula for the chromatic polynomial, � �, � = � � − �, � − �(� ∙ �, �). Note: we shorten � �, � to � � . = – = – – + = – – + – + + For , we see that vertex C must avoid four colors; then for a k-coloring, it can receive any of � − 4 colors. Vertex B must avoid colors “2” and “4”, as well as whichever color is placed on vertex C; then B can receive any of � − 3 colors. Vertex A must avoid colors “2”, “3”, and “4”, and so can receive any of � − 3 colors. Then the term for this portion of the chromatic polynomial is � − 4 � − 3 !. Applying this reasoning to every term, we find that chromatic polynomial with restrictions of our puzzle is: � �, � = � − 3 ! − � − 3 ! � − 4 − � − 4 � − 3 ! + � − 4 ! − � − 4 � − 3 ! + � − 4 � − 3 + � − 4 ! � �, � = �! − 15�! + 87�! − 230� + 233 In order for any coloring to be consistent with the puzzle, k must be at least as large as the number of distinct colors already used: here, � ≥ 4. We see that � 4 = 1; indeed, this puzzle has one possible completion in line with standard sudoku rules: 2 4 1 2 3 4 3 2 → 3 4 1 2 2 3 4 1 2 3 4 1 4 1 2 3 4 1 2 3 We also see that � 5 = 8. This indicates that if 5 colors, or the digits {1, … , 5} were to be allowed, then there are 8 possible consistent boards: 5 2 3 4 5 2 1 4 5 2 3 4 3 4 1 2 3 4 5 2 3 4 5 2 2 3 4 1 2 3 4 1 2 3 4 1 4 1 2 3 4 1 2 3 4 1 2 3 1 2 3 4 1 2 5 4 1 2 3 4 3 5 1 2 3 5 1 2 3 4 5 2 2 3 4 1 2 3 4 1 2 3 4 1 4 1 2 3 4 1 2 3 4 1 2 3 1 2 5 4 1 2 3 4 3 4 1 2 3 4 1 2 2 3 4 1 2 3 4 1 4 1 2 3 4 1 2 3 Note that a proper k-coloring is a proper coloring using at most k colors: allowing 5 colors does not prevent a 4-coloring. Then �(5), the number of completions using at most 5 digits, is equal to �(4), the number of completions using at most 4 digits (here, there is one), plus the number of completions using exactly 5 digits (here, there are seven). Let n now be the number of vertices in the graph encoding of the sudoku grid (for 9x9, � = 81; for 4x4, � = 16); let t be the number vertices already colored (or the number of clues appearing in the puzzle); let �! be the number of distinct colors in the partial coloring (or the number of distinct digits among the clues). In our example, , � = 16; � = 12; �! = 4. 2 4 3 2 2 3 4 1 4 1 2 3 We now state Akman’s theorem [1]: “Let G be a graph with n vertices, and C be a partial proper coloring of t vertices of G using exactly �! colors. Define �!,!(�) to be the number of ways C can be completed to a proper �-coloring of G. Then for � ≥ �!, the expression �!,!(�) is a monic polynomial of degree � − �.” Proof: Following our earlier discussion, the partial proper coloring, C, of t vertices, is the puzzle with t clues, �! of which are distinct digits.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    24 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us