DlxSolver does select the most constrained column by design, yes
Hi, sorry for asking, but how much complicated is it to solve the problem without backtracking ?
I could solve the first test in 8 steps with a simple algorithm (6 steps now), but even with some more advanced tricks Iām not confident anymore I can do other tests without brute force.
Are such sudoku problems doable without *any* backtracking ?
Thanks ![]()
Same here. I can solve the first test case without backtracking. After that, it gets a lot harder. I found some techniques online that I havenāt had a chance to implement yet, so maybe ⦠someday.
I solve all the grids using the following algorithm (loop):
- There is only one possible letter left for a cell.
- In a group of cells (row, column, block), a letter is present only once.
- In a group, n cells have only n possible letters (so we eliminate these letters from the other cells).
- Make a hypothesis in the cell with the fewest possible letters.
With this algorithm, I solve all the grids with a maximum hypothesis depth of 25.
I coded it in JavaScript; there are no timeouts.
I finally made it in python using Timinatorās DLX algorithm, however I find it odd how the execution time spans⦠When running the 5th test case, I get times in a [900,5800+] ms range