• Post Reply Bookmark Topic Watch Topic
  • New Topic

Solving a sudoku puzzle using most constrained first heuristic  RSS feed

 
lewis manuel
Ranch Hand
Posts: 64
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The idea behind this heuristic is at every step we should choose the cell in the table which offers the smallest number of candidates so that we have a low probability of getting a collision. The problem is that I'm getting a stackoverflow which means that the recursion part of my algorithm is calling itself way too many times.

In case you don't quite understand what I'm saying, here is an example. row 1, column 2 is an excellent candidate because it only has one possibility(3). This means we only have to do one iteration and insertion. This example should help you understand what I'm trying to do.



 
lewis manuel
Ranch Hand
Posts: 64
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Good news guys I solved my problem.
 
Tim Cooke
Marshal
Posts: 3873
233
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It would benefit the community and close this topic off just nicely if you shared your solution.
 
lewis manuel
Ranch Hand
Posts: 64
2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right
 
Tim Cooke
Marshal
Posts: 3873
233
Clojure IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Great! So what was your solution?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!