Sudoku Solver & Generator is a simple web application written for both solving and generating Sudoku puzzles. The application can handle any sort of N*N sudoku grids with user defined regions and is basically able to solve any of these kinds of Sudoku puzzles and find if it has multiple answers. (However, some sudoku puzzles are just too hard to solve fast enough).
Using the solver may seem complicated as there are multiple fields and various options which can be set. However, most of the time you do not need to modify almost any of these, as the default settings used are good for solving most sudoku puzzles.
The first thing you need to enter is the sudoku puzzle itself in the text area named "The Sudoku Puzzle". Simply write the numbers in the puzzle in that box in same order as the appear in the puzzle you have (like write on the first line the numbers on the first line in the puzzle, then next line the numbers on the next line and so on...)
For cells that are not yet solved, simply use 0 for them. Assuming you are trying to solve a normal 9*9 Sudoku puzzle, this is all you need to do. Just hit the "Solve the Sudoku Puzzle" button and the solution will be provided to you (assuming there is one). If the solver claims that there is no solution, check the puzzle for any typing errors. The solution page displays to board you gave, so you can easily check it for any errors.
There are large number of Sudoku variants in many Magazines and websites. This Solver can solve any N*N sudoku puzzles, but the more irregular ones require you to enter the map and charset, so that the solver can understand the Sudoku puzzle.
The map is never needed for any symmetrical Sudoku puzzles. What I call a symmetric sudoku puzzle is one with size S, where S is N*N (e.g. Sudokus of size 1, 4, 9, 16, 25, etc. are symmetrical), and which has regions of size N*N. Every other kind of Sudoku does require a map, or it can't be solved.
The region map indicates how the regions are placed on the Sudoku puzzle. The region is entered similarly to the puzzle itself. However, for each cell you enter the region it belongs to, using numbers from 0 to 8 (if using 9*9 sudoku grid).
The charset tells the solver how to interpret the given puzzle and region map. Every character that is not present in the charset is completely ignored. The first character in the charset represents the unsolved square and the every character after that is the number starting from 1. For example a 4*4 sudoku puzzle could use a charset of 0ABCD. If no charset is given, the board will ignore all characters in the puzzle and region map that are not digits or letters and a default charset of 0-9 followed by A-Z is used.
Note that for user convenience, all the input is case insentive, so characters 'a' and 'A' are considered the same.
The Sudoku solver provides a few different advanced options to use for solving sudoku puzzles. These options are mostly for playing around with the solver, but also because different puzzles are solved more optimally in different ways. Here is explanation of each option:
The sudoku solver implements a few different logics it uses to solve the sudoku puzzles. Basically, they can be separated into two different things which is finding the actual solutions and eliminating possible candidates in cells. when you use the solver to solve a puzzle, at the bottom of the page it will display a "path" to the correct solution. The column "M" in that table gives a letter, which indicates the used method. Below is the description for each method.
Solution methods:
Elimination logics:
Note: Naked Pairs elimination is actually a partial chain elimination. The difference to the chain rule is that chain rule only requires N cells in a unit with only N different candidates. However, only the Naked Pairs search is used due to ease of implementation.
Most human made puzzles or ones that are generated for humans to solve can be solved using these logics without the guessing method. In fact, often only the hardest puzzles even require elimination logic at all. There are however a few more common logics such as the chain rule and N-wing logic which are not implemented in this solver (mainly due to my inexperience). So Some of the most hardest puzzles might not be possible to solve using only logic with this solver.
Even if the puzzle can not be solved using logic only, the guessing algorithm always enables the ability to find all possible solutions for any sudoku puzzle.
Here is a few examples, which you can play around with the solver to help you figure out how it works. For example example, the charset, puzzle and the region map is given which you can insert in the solver page.
This is a simple example of a sudoku board. This demonstrates also a board which can be solved using nothing but the Method A, as you can see from the solution page. Normally a puzzle like this would be ranked something like very easy.
Note that as this map uses default grid and default charset, you don't actually need to enter anything but the puzzle for the solver, and it can figure out the rest.
Like the previous example, this uses default map and charset, so those do not need to be given for the solver. This puzzle example demonstrates a puzzle which also requires a elimination logic to solve, so this kind of sudoku puzzle could be ranked somehat hard.
This is an example of sudoku with custom region map. As you can see especially on the solution page, the regions are not the normal 3x3 blocks, but little pieces. Because this uses a custom region map, the map must be entered, even though you don't need to enter the charset.
Note that puzzles with custom region maps are much more difficult to solve than standard maps. So, depending on the map, the solver may not always be able to solve custom region maps.
Regions do not actually need to be connected in the sudoku puzzle as this example demonstrates. In addition, this example also shows that while some puzzle may have only one solution, the solver may not be able to solve them without guesses (as not every possible logic is implemented).
As this example demonstrates, not every sudoku has to be 9*9. Also, this puzzle uses a custom charset, containing letters instead of numbers (except for the unsolved square). If you want, you could even use non symmetrical sizes (like 5*5 or 7*7).
While the main emphasis of this web application is to solve sudoku puzzles, this can also generate them. The sudoku generator, however, is mostly built because I could, not because I particularly wanted to create a sudoku generator. Thus, the quality of the generated puzzles is rather low, as the generation algorithm is very simple.
When generation a sudoku puzzle, you can choose to create a map in one of the following ways:
When you have selected the type, you can also choose one of the difficulty levels for the puzzle. Note that these are only limits for the puzzle level. There is no guarantee that the actually generated puzzle will be this hard.
Once the puzzle is generated, you can see indication of the level of difficulty in the tittle given as stars. The number of stars indicate the complexity of solving methods required to solve the board, so even a 1 star puzzle might be hard for human to solve, if the right solutions are hard to spot, even if the methods required are very simple.