Professional Documents
Culture Documents
Lacey Johnson
Summer 2013 Student Research Project James Madison University
Abstract
Sudoku can be described as a system of polynomials which can then be solved using Grbner 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.
Spider Polynomials
The spider diagram above allows us to better visualize which pairs of variables cant 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)(a3+a2b+ab2+b3-10a2+10ab-10b2+35a+35b-50) = 0 We want to force a and b to take on different values. If ab0, we must have that a3+a2b+ab2+b3-10a2+10ab-10b2+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.
a ak
2 k
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 Buchbergers algorithm is double exponential in the number of variables.
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 a3+a2b+ab2+b3-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.
Buchbergers Algorithm
Buchbergers algorithm is the algorithm that computes Grbner bases in many variables in any degree. While utilizing Buchbergers algorithm, many intermediate polynomials are computed and discarded before the final Grbner 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 computers memory, slow down and even stop the computation altogether.
Conclusion
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.
Shidoku Ideal
We let the Shidoku polynomials be the generators for an ideal, I. Then we use Buchbergers algorithm to compute a Grbner 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 Grbner 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, f1, g-2, h-3, i-2, j-3, k-4, l-1, m-1, n-4, 0-3, p-2.
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 Grbner 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.
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 a4 a = 0 and b4 b = 0 Expanding and factoring out (a-b) gives us, (a-b)(a3+a2b+ab2+b3-1) = 0 If a-b0, we need a3+a2b+ab2+b3-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.
Future Research
Develop k-potent system of regional polynomials for Sudoku. Write code to modify Buchbergers algorithm so it automatically reduces degree.
Acknowledgements
E. Arnold, S. Lucas, and L. Taalman, Grbner 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.