In response to the locking of my last question here due to lack of information I will now try explain further to eliminate confusion.
Ok first left get some background info on what I'm doing.
I started on a personal project of making a sudoku game to learn about object oriented programming, ArrayLists, algorithms, model/control/design layer and generally expanding my knowledge programming.
I have come a very far way in making this game and it is nearing completion but I have hit a smaller problem that I need help to solve.
I hit the problem when I generated 3 sudokus, one easy, one medium and one hard.
Easy and medium difficulty sudokus was solvable but the hard sudoku was unsolvable.
How it works:
First I have an algorithm using random number generation and validation to generate a valid sudoku board, then I pass it through another algorithm that goes through all numbers on the 9x9 board and removes them on a percent chance, this percent chance is specified when calling the method, for example 50% chance of removing a number for easy and 65% chance for hard.
My issue:
Ok so my issue is that I generated a sudoku at "hard" difficulty and found that it was unsolvable. Right now I have no validation method to check if the puzzle is solvable in any way, so long story short its by chance if its solvable.
What I need:
I need an algorithm or a method to validate if the puzzle is solvable cause as it is right now I only have a random chance of it being solvable due to the random number removal chance. This should not be done using brute force(Backtracking) but instead it should look at the puzzle and take decisions on what numbers go where, basically just as you and I would solve it. This way I can verify not only if it has a single solve but also if you and I can solve it.
A small graphical view of variables and how the classes is connected:
A visual representation of how the sudoku is structured using the above example:
The 1 to9 numbers in the sudoku is the cells 1 to 9.
If you need any more detailed information on the program please tell me and I will add it to this form, I just tried to keep it as short and simple as possible while still trying to cover everything relevant for this issue.