Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to make a sudoku as difficult as possible using python

I’m new with sudokus, so I hope my question makes sense. I have developed a python code that generates a valid sudoku for me. By valid, I mean the generated sudoku does have a solution, and only one solution.

Now, here is my problem: I want to make this sudoku as difficult as possible, but still humanly solvable. By as difficult as possible I mean a situation in which the number of originally filled cells is the minimum: if one other digit is removed, then the puzzle will not have a unique solution, and/or will not be solvable by a human. And by humanly solvable, I mean a puzzle that is solvable solely based on the logic, and not based on guessing or trial and error.

Is what I’m looking for technically possible? Am I even asking a valid question here?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

the minimum is 17 according to this paper
so you could write code that generates a sudoku with 17 clues randomly (but a valid sudoku). then implement a solver , if it fails, reject it. repeat.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading