Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lacey Johnson Summer 2013 Student Research Project – James Madison University Sudoku can be described as a system of polynomials which can then be solved.

Similar presentations


Presentation on theme: "Lacey Johnson Summer 2013 Student Research Project – James Madison University Sudoku can be described as a system of polynomials which can then be solved."— Presentation transcript:

1 Lacey Johnson Summer 2013 Student Research Project – James Madison University Sudoku can be described as a system of polynomials which can then be solved using Gröbner basis techniques. A Boolean idempotent approach (x^2 = x) restricts degree growth of intermediate polynomials, but increases the number of variables. We use a k-potent approach (x^k =x) allowing each variable to take on k values. The approach restricts degree growth, but minimizes the number of variables. Preliminary results show the k-potent approach produces the fastest results. Department of Mathematics and Statistics K-potent Gröbner Bases and Sudoku Abstract What is a Gröbner basis? Buchberger’s Algorithm A Gröbner basis for a system of polynomials is a new system of polynomials, with the same solutions as the original set, but which is easier to solve. Buchberger’s algorithm is the algorithm that computes Gröbner bases in many variables in any degree. While utilizing Buchberger’s algorithm, many intermediate polynomials are computed and discarded before the final Gröbner basis is reached. The coefficients and degrees of these intermediate polynomials can grow to an enormous size. These problems are known as coefficient explosion and degree growth. Both of these issues can very quickly overload the computer’s memory, slow down and even stop the computation altogether. Sudoku and Shidoku Shidoku, a simpler version of Sudoku, is played on a 4x4 Latin square whose regions (rows, columns, and designated 2x2 blocks) each contain integers 1-4 exactly once. Shidoku board and complete board These constraints in a Shidoku board can be represented as a system of polynomials. Think of the 16 cells on a Shidoku board as 16 variables that can each take on only the values 1, 2, 3, or 4. For each of these variables w, we can encode this fact with a polynomial equation of the form (w-1)(w-2)(w-3)(w-4) = 0 Spider Polynomials Shidoku Ideal Sum-Product Shidoku System Boolean Shidoku SystemK-Potent Region Polynomials Conclusion Future Research Here are the computation times of the different variable and polynomial types. This was computed using Maple 16 on a 2.53 GHz Windows laptop with 4 GB RAM. The system of polynomials with regular variables and spider polynomials has too many polynomials of high degree The sum-product Shidoku system with regular variables and region polynomials could compute a Gröbner basis for Shidoku, but not for Sudoku. The Boolean Shidoku system with idempotent variables and region polynomials restrict degree growth, but has too many variables. The k-potent Shidoku system with k-potent variables and region polynomials restricts growth and uses one variable per cell. Develop k-potent system of regional polynomials for Sudoku. Write code to modify Buchberger’s algorithm so it automatically reduces degree. The spider diagram above allows us to better visualize which pairs of variables can’t be equal to each other because they lie in the same region, i.e. the same row, column, or block. Each leg of the spider needs a polynomial which we will call a spider polynomial. Consider any two variables, a and b, that lie in the same region, i.e. (a-1)(a-2)(a-3)(a-4)=0 and (b-1)(b-2)(b-3)(b-4)=0. Expanding, setting equal and factoring out (a-b) gives us, (a-b)(a 3 +a 2 b+ab 2 +b 3 -10a 2 +10ab-10b 2 +35a+35b-50) = 0 We want to force a and b to take on different values. If a- b≠0, we must have that a 3 +a 2 b+ab 2 +b 3 -10a 2 +10ab-10b 2 +35a+35b-50 = 0 This is our spider polynomial for a and b that we put into our ideal. With 56 spider polynomials of this form and 16 regular variable polynomials, we have a total of 72 polynomials to represent the constraints on a Shidoku board. We let the Shidoku polynomials be the generators for an ideal, I. Then we use Buchberger’s algorithm to compute a Gröbner basis for I to get a new system of polynomials which gives us more information about the ideal. If we add to the ideal polynomials which represent initial clues such as d-4, e-4, g-2, j-3, l-1, and m-1, the Gröbner basis is this system of 16 linear polynomials that are the solutions to the Shidoku puzzle, i.e. a-3, b-2, c-1, d-4, e-4, f- 1, g-2, h-3, i-2, j-3, k-4, l-1, m-1, n-4, 0-3, p-2. Figure: Shidoku variables, puzzle, and board The sum-product system uses the regular variables, i.e. (a-1)(a-2)(a-3)(a-4)=0. Consider four cells that make up a region (i.e. row, column, or 2x2 block). Each cell in the region must have a different value: 1, 2, 3, or 4. The only way to choose four distinct numbers from the set {1,2,3,4} whose sum is 10 and product is 24 is to choose each value exactly once. Let w,x,y, and z represent four cells in a Shidoku region. Then these two polynomials represent the constraints on a Shidoku region. w+x+y+z-10=0 and wxyz-24=0 In total, 40 polynomials encompass the rules of Shidoku. One approach to limit degree growth is the Boolean Shidoku system. It assigns four variables to each cell on the Shidoku board, i.e. a 1, a 2, a 3, a 4 for cell a, giving us a total of 64 variables. So if cell a has the value 2, the variable a 2 =1 and all other variables a 1 =a 3 =a 4 =0. Therefore, for k=1,2,3,4, a k (a k -1) = 0 Simplifying we get Using this idempotent variable restricts the degree growth. However, the Boolean Shidoku system is slower than the sum-product Shidoku system because the complexity of Buchberger’s algorithm is double exponential in the number of variables. K-Potent Shidoku System Acknowledgements E. Arnold, S. Lucas, and L. Taalman, Gröbner Basis Representation of Sudoku, College Mathematics Journal 41, 2010, 101-111. Thank you to my research advisor Dr. Elizabeth Arnold and Dr. Laura Taalman for the Spider Diagram graphic. The k-potent variable system was developed by Arnold and Lucas to restrict degree growth and at the same time use only one variable for each cell. a k = 0 a k – a = 0 For our purposes, the k-potent variable polynomials for a Shidoku system would be of the form a 4 – a = 0 a = 0 or a 3 – 1 = 0 Notice, a can take on four values, a=0, W 1, W 2, W 3, were W 1 is a primitive third root of unity. When all possible values for a are added together we get 0. 0 + W 1 + W 2 + W 3 = 0 This can’t be the only condition because it would allow all four variables in the region to take on the value 0, 0 + 0 + 0 + 0 = 0 So if the regional polynomial is w + x + y + z = 0 we must have another condition to ensure that w,x,y, and z are distinct values. Notice, a spider polynomial would ensure that two variables in a region are not equal. In fact, for every pair that needs to have different values we will use spider polynomials. So, now we use k-potent variables to compute k-potent spider polynomials. The conditions on the variable gives us a 4 – a = 0 and b 4 – b = 0 Expanding and factoring out (a-b) gives us, (a-b)(a 3 +a 2 b+ab 2 +b 3 -1) = 0 If a-b≠0, we need a 3 +a 2 b+ab 2 +b 3 -1 = 0 This is the k-potent spider polynomial for a and b. Notice, it has fewer terms and no coefficients compared to the regular spider polynomials. To build our k-potent region Shidoku system we begin with our 16 k-potent variable equations, a 4 – a = 0 Then we set our first variable condition for each region giving us 12 polynomial equations of this form a + b + c + d = 0 Finally, for each region we need a spider polynomial to guarantee each variable is distinct. Again, we do this for each region so we have 12 polynomial equations of this form a 3 +a 2 b+ab 2 +b 3 -1 = 0 However, we can economize and just use 8 k-potent spider polynomials to represent the regions of the Shidoku board because a pair of variables can count for a row and a block. This leaves us with 8 k-potent spider polynomials. Altogether, this k-potent region Shidoku system contains 36 polynomials.

2


Download ppt "Lacey Johnson Summer 2013 Student Research Project – James Madison University Sudoku can be described as a system of polynomials which can then be solved."

Similar presentations


Ads by Google