26
Mitiko
6y

I tried to do a sudoku solver, but it didn't work...

I wanted it to succeed without backtracking or bruteforce, so I tried solving it in a human way.

I ended up with some if-else AI that couldn't do anything at all

Comments
  • 3
    Afaik theres no smooth algorythm to that
  • 1
    Backtracking is the way to go. Not perfect, but the most efficient way to do it.
  • 1
    Yeah, as I remember it, arbitrarily sized sudoku grids are NP-hard, so I wouldn't feel too bad about that one.
  • 1
    In my first year of university we were taught Ada (yes, I know, I wanted to kill myself), and we had to imolement a sudoku solver in that. Worst experience in my life.
  • 1
    Use constraint propagation. And any search algorithm (I prefer DFS) in case it is stuck.
Add Comment