View previous topic :: View next topic |
Author |
Message |
| emdiesse
| Joined: 16 May 2007 | Posts: 2 | : | | Items |
|
Posted: Thu May 17, 2007 9:10 pm Post subject: Invalid Puzzle Recognition |
|
|
Hello.
Am I right in saying that a sudoku puzzle is only going to be invalid if a number 1 to 9 is repeated in a row, column or a square?
Thank you |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Thu May 17, 2007 10:36 pm Post subject: Re: Invalid Puzzle Recognition |
|
|
emdiesse wrote: | Hello.
Am I right in saying that a sudoku puzzle is only going to be invalid if a number 1 to 9 is repeated in a row, column or a square?
|
Well, I think that's a convoluted way of stating the rules:
1) Each row/column/box of the solution contains each of the digits 1 to 9.
2) To be valid, a puzzle has exactly one solution.
HTH.
Regards,
Mike Metcalf |
|
Back to top |
|
|
| emdiesse
| Joined: 16 May 2007 | Posts: 2 | : | | Items |
|
Posted: Fri May 18, 2007 12:36 am Post subject: Re: Invalid Puzzle Recognition |
|
|
Ok. However the problem is for my solver it will actually go into an infinate loop if it can't find a solution. I was origionally using it as a solution generator but I wish to add to it. When it generates a solution there are occasions where it cannot place a 'legal' value (IE it can't place a number else it would have a repeating number), so it will restart the generation.
So if someone was to type in their solution and it were to be invalid it would loop forever.
is there a way to determine this before hand. |
|
Back to top |
|
|
| m_b_metcalf
| Joined: 13 Mar 2006 | Posts: 210 | : | Location: Berlin | Items |
|
Posted: Fri May 18, 2007 1:07 pm Post subject: Re: Invalid Puzzle Recognition |
|
|
emdiesse wrote: | Ok. However the problem is for my solver it will actually go into an infinate loop if it can't find a solution. I was origionally using it as a solution generator but I wish to add to it. When it generates a solution there are occasions where it cannot place a 'legal' value (IE it can't place a number else it would have a repeating number), so it will restart the generation.
So if someone was to type in their solution and it were to be invalid it would loop forever.
is there a way to determine this before hand. |
Look in each row/column/box at the clues and the candidates. Each of the values 1 to 9 must occur at least once either as a clue or as a candidate. If this condition is not fulfilled there are zero solutions.
Regards,
Mike Metcalf |
|
Back to top |
|
|
|