Sudoku Programmers Forum Index

 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log inLog in          Games  Calendar

Log in to check your private messagesLog in to check your private messages   

Invalid Puzzle Recognition

 
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> The mathematics of sudoku
View previous topic :: View next topic  
Author Message
emdiesse

Joined: 16 May 2007
Posts: 2
:

Items
PostPosted: Thu May 17, 2007 9:10 pm    Post subject: Invalid Puzzle Recognition Reply with quote

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
View user's profile Send private message
m_b_metcalf

Joined: 13 Mar 2006
Posts: 210
:
Location: Berlin

Items
PostPosted: Thu May 17, 2007 10:36 pm    Post subject: Re: Invalid Puzzle Recognition Reply with quote

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
View user's profile Send private message
emdiesse

Joined: 16 May 2007
Posts: 2
:

Items
PostPosted: Fri May 18, 2007 12:36 am    Post subject: Re: Invalid Puzzle Recognition Reply with quote

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
View user's profile Send private message
m_b_metcalf

Joined: 13 Mar 2006
Posts: 210
:
Location: Berlin

Items
PostPosted: Fri May 18, 2007 1:07 pm    Post subject: Re: Invalid Puzzle Recognition Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Sudoku Programmers Forum Index -> The mathematics of sudoku All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Sudoku Programmers topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group

Igloo Theme Version 1.0 :: Created By: Andrew Charron