It is possible to solve Sudoku problems by linear programming and the simplex algorithm.
The real problem is how to solve the uniqueness constraints of only having one example in each block, column or row of the digits.
For each cell, you need 9 integer variables taking the value 0 or 1.
One constraint is to have the sum of these come to 1, enforcing 1 digit per cell.
Similarly, you can do the same to make sure that only one 1 appears in each column, row or block.
The last part, making sure the totals come to 45 is again easy. just multiply the appropriate 0/1 number by the value of the digit, total and equate to 45.
Lastly there is the question of the known values. Here you can specify the appropriate values are 0 or 1 to force there use.
here are some examples of the constraints.
r111 is a variable, 0 or 1.
If its 1 then the cell (1,1) = 1, if its 0, then its another digit.
T11: r111 + r112 + r113 + r114 + r115 + r116 + r117 + r118 + r119 = 1;
This enforces the 1 digit per cell.
R1: 1 r111 + 2 r112 + 3 r113 + 4 r114 + 5 r115 + 6 r116 + 7 r117 + 8 r118 + 9 r119
+ 1 r121 + 2 r122 + 3 r123 + 4 r124 + 5 r125 + 6 r126 + 7 r127 + 8 r128 + 9 r129
+ 1 r131 + 2 r132 + 3 r133 + 4 r134 + 5 r135 + 6 r136 + 7 r137 + 8 r138 + 9 r139
+ 1 r141 + 2 r142 + 3 r143 + 4 r144 + 5 r145 + 6 r146 + 7 r147 + 8 r148 + 9 r149
+ 1 r151 + 2 r152 + 3 r153 + 4 r154 + 5 r155 + 6 r156 + 7 r157 + 8 r158 + 9 r159
+ 1 r161 + 2 r162 + 3 r163 + 4 r164 + 5 r165 + 6 r166 + 7 r167 + 8 r168 + 9 r169
+ 1 r171 + 2 r172 + 3 r173 + 4 r174 + 5 r175 + 6 r176 + 7 r177 + 8 r178 + 9 r179
+ 1 r181 + 2 r182 + 3 r183 + 4 r184 + 5 r185 + 6 r186 + 7 r187 + 8 r188 + 9 r189
+ 1 r191 + 2 r192 + 3 r193 + 4 r194 + 5 r195 + 6 r196 + 7 r197 + 8 r198 + 9 r199 = 45;
This is an example of a row constraint. Its the same format for columns and blocks.
CU11: r111 + r211 + r311 + r411 + r511 + r611 + r711 + r811 + r911 = 1;
This is an example enforcing that in column 1, there is only one 1
Lastly
K111: r111 = 0;
K112: r112 = 0;
K113: r113 = 0;
K114: r114 = 0;
K115: r115 = 0;
K116: r116 = 0;
K117: r117 = 1;
K118: r118 = 0;
K119: r119 = 0;
This enforces that in cell (1,1) the given digit is 7
I used a package called lpsolve to solve the solution. It takes about 7 seconds.
To generate the constraints, I used Python to read a small file containing the problem, and that generates the constraints file to solve.
To analyse and pretty print the solution, I used Excel.
Nick