The solving algoritm divides the sudoku into 81 Elements, each representing a cell in the sudoku. Each element has a handful of properties to help certain solving subroutines, but the most important one is its possibility vector. This vector contains the information concerning the possibilities still open for the element. For example:
This possibility vector tells us the Element is either a 2,5,8 or 9. The current solving process works in 3 steps, which are looped over. One loop equals one run. If no new elements have been found and no possibility vectors have been modified the looping quits and the sudoku is checked by a validator. Step 1: Updating possibility vectors This comes down to scrapping the possibility on one or more found values in the possibility vectors of every other Element in the same row, column or block. These 'found values' can be values the user provided (in the very first run, that is), or new values the solving process generated and validated in step three. Scrapping comes down to changing a 1 into a 0 in the possibility vector. For example we have found the value 5 in a certain row, column or block. On every other element in these groups scrapping will be performed:
to
Step 2: Applying solving techniques In this step the various solving methods are applicated on the sudoku. This is executed one by one, and the techniques are ordered from low to high complexity (to prevent tedious calculations on something an easier technique could solve faster). The applying of a technique also boils down to modifying possibility vectors, backed up with more complex reasons.
** Under construction ** |