Question
Write a program in java which will generate a Sudoku puzzle. Input : Input will consist of a single integer r which specifies how many
Write a program in java which will generate a Sudoku puzzle.
Input : Input will consist of a single integer r which specifies how many digits should be in the puzzle when it is finished. The maximum value for r is obviously 81 (i.e., a fully filled grid), and we'll use 25 as the lowest allowed value { any lower value entered should be set to 25.
Algorithm : You should use a branch-and-bound algorithm to solve this problem, in two difierent capacities. First, you should write a branch-and-bound method which when given a sudoku grid returns a boolean value indicating whether or not there is a unique solution. Once you have the checker working, you then must write another branch-and-bound method which, along with a random number generator, completely fills in a grid. Once you have a grid, you can start removing values from it and then check to see if you still have a puzzle with a unique solution. If you remove a value and nd that there are more than two solutions,then you must put it back and try removing another one.
Output : Your program should output two items. The puzzle and the solution to your puzzle to the file XXX.ans
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started