Sudoku solver #200
tcolgate
started this conversation in
Show and tell
Replies: 1 comment 2 replies
-
I had a go at implementing the Position Vector approach shown here. I've editte this to include the optimisation to pass the contention map from the top level. It seems to work, but only really for simpler puzzles. It has the "downside" of calculating all possible solutions, which is pretty catastrophic for the starburst and easterMonster puzzles above.
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This started as a port of the APL WIki sudoku solver (using DFS), but ended up deviating a fair bit. It does use the same technique outlined there, more or less. The answers for starburst and easterMonster examples are not the same as those on the APL Wiki, but seem valid. It assumes square puzzles, and I likely only works with (N^2)x(N^2) grids.
I don't think it's optimal in any way. I seem to spend a lot of time folding and unfolding the matricies. I've just realised that
f@@
for ranks is a thing, that helps in a couple of places. Also updated to used the recentwhere
and indexed assignment improvementsBeta Was this translation helpful? Give feedback.
All reactions