POV-Ray : Newsgroups : povray.off-topic : Sudoku Server Time
6 Sep 2024 11:20:08 EDT (-0400)
  Sudoku (Message 1 to 10 of 51)  
Goto Latest 10 Messages Next 10 Messages >>>
From: Invisible
Subject: Sudoku
Date: 23 Jan 2009 10:11:42
Message: <4979de2e$1@news.povray.org>
Sudoku. Nobody knows exactly how to pronounce it, but almost everybody 
knows what the rules are. And each person has their own Special Method 
for playing it.

Apparently it's actually a graph colouring problem. Or, equivilently, an 
exact cover problem. And it's provably NP-complete. (So, uh, how come 
it's solvable then? I thought "NP-complete" is supposed to mean 
"impossible to solve in less time than the age of the universe"?)

It appears you can theoretically solve it using the dancing links algorithm.


Post a reply to this message

From: Warp
Subject: Re: Sudoku
Date: 23 Jan 2009 10:35:18
Message: <4979e3b6@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Sudoku. Nobody knows exactly how to pronounce it

  I'm not surprised *you* don't know how to pronounce it. ;)

> Apparently it's actually a graph colouring problem. Or, equivilently, an 
> exact cover problem. And it's provably NP-complete.

  Solving a sudoku is O(1) because the size is fixed to a 9x9 grid.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Sudoku
Date: 23 Jan 2009 10:41:00
Message: <4979e50c$1@news.povray.org>
Warp wrote:

>> Apparently it's actually a graph colouring problem. Or, equivilently, an 
>> exact cover problem. And it's provably NP-complete.
> 
>   Solving a sudoku is O(1) because the size is fixed to a 9x9 grid.

I presume they were talking about the generalised problem of an n^2 x 
n^2 grid...

Even if we assume 9x9, it's interesting to note that in paper the 
process is O(1), and yet the amount of time it actually takes me to 
solve one appears to be unbounded. I guess this indicates I'm using a 
really, *really* inefficient solving algorithm? :-}

(Alternatively, I guess you could take N to mean not the size of the 
grid but the number of unknowns...)


Post a reply to this message

From: Invisible
Subject: Re: Sudoku
Date: 23 Jan 2009 10:41:33
Message: <4979e52d$1@news.povray.org>

chromatic number.


Post a reply to this message

From: Warp
Subject: Re: Sudoku
Date: 23 Jan 2009 10:51:59
Message: <4979e79f@news.povray.org>
Invisible <voi### [at] devnull> wrote:
> Warp wrote:

> >> Apparently it's actually a graph colouring problem. Or, equivilently, an 
> >> exact cover problem. And it's provably NP-complete.
> > 
> >   Solving a sudoku is O(1) because the size is fixed to a 9x9 grid.

> I presume they were talking about the generalised problem of an n^2 x 
> n^2 grid...

  Has it been proven that it's possible to create unambiguous sudoku
problems for all possible values of n?

  (A sudoku problem only makes sense if it's unambiguous, iow. it can be
solved unambiguously without trial-and-error, only by pure deduction.)

> Even if we assume 9x9, it's interesting to note that in paper the 
> process is O(1), and yet the amount of time it actually takes me to 
> solve one appears to be unbounded.

  It cannot be unbounded because the number of possible permutations is
fixed.

  Inside a 3x3 square, where all the numbers between 1 and 9 are put, the
number of possible permutations of those numbers is 9! = 362880. Since
there are 9 such squares, the total number of combined permutations is
9^362880. Sure, this is a huge number, but it's a fixed upper bound and
makes the solver O(1).

-- 
                                                          - Warp


Post a reply to this message

From: scott
Subject: Re: Sudoku
Date: 23 Jan 2009 10:55:43
Message: <4979e87f$1@news.povray.org>
>  (A sudoku problem only makes sense if it's unambiguous, iow. it can be
> solved unambiguously without trial-and-error, only by pure deduction.)

Isn't trial-and-error a form of deduction?  ie "If I put a 4 in here, that 
square will need to be 3, and then that doesn't work so it must be a 6 in 
the original square".  Of course there are more complicated chains of logic, 
but essentially you try one number and see if it gives a valid result.


Post a reply to this message

From: Warp
Subject: Re: Sudoku
Date: 23 Jan 2009 11:00:25
Message: <4979e998@news.povray.org>
scott <sco### [at] scottcom> wrote:
> >  (A sudoku problem only makes sense if it's unambiguous, iow. it can be
> > solved unambiguously without trial-and-error, only by pure deduction.)

> Isn't trial-and-error a form of deduction?  ie "If I put a 4 in here, that 
> square will need to be 3, and then that doesn't work so it must be a 6 in 
> the original square".  Of course there are more complicated chains of logic, 
> but essentially you try one number and see if it gives a valid result.

  If trial-and-error was acceptable in a sudoku, then you could just as
well give an empty sudoku grid for someone to solve.

  The principle in sudoku puzzles is that they can be solved without having
to guess anything. The chain of required deductions may go very deep in
the hardest sudokus, but it's always possible to solve it without having
to guess.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Sudoku
Date: 23 Jan 2009 11:01:08
Message: <4979e9c4@news.povray.org>
>> I presume they were talking about the generalised problem of an n^2 x 
>> n^2 grid...
> 
>   Has it been proven that it's possible to create unambiguous sudoku
> problems for all possible values of n?

If the number of unknowns is small enough, it should be possible to make 
it unambiguous. (E.g., if you have a 100 x 100 grid with 1 cell blank, 
how hard can it be to figure out what the final value is?)

>> Even if we assume 9x9, it's interesting to note that in paper the 
>> process is O(1), and yet the amount of time it actually takes me to 
>> solve one appears to be unbounded.
> 
>   It cannot be unbounded because the number of possible permutations is
> fixed.

So there we have it then: An absurdly inefficient algorithm! :-}


Post a reply to this message

From: Warp
Subject: Re: Sudoku
Date: 23 Jan 2009 11:01:31
Message: <4979e9db@news.povray.org>
Warp <war### [at] tagpovrayorg> wrote:
> scott <sco### [at] scottcom> wrote:
> > >  (A sudoku problem only makes sense if it's unambiguous, iow. it can be
> > > solved unambiguously without trial-and-error, only by pure deduction.)

> > Isn't trial-and-error a form of deduction?  ie "If I put a 4 in here, that 
> > square will need to be 3, and then that doesn't work so it must be a 6 in 
> > the original square".  Of course there are more complicated chains of logic, 
> > but essentially you try one number and see if it gives a valid result.

>   If trial-and-error was acceptable in a sudoku, then you could just as
> well give an empty sudoku grid for someone to solve.

>   The principle in sudoku puzzles is that they can be solved without having
> to guess anything. The chain of required deductions may go very deep in
> the hardest sudokus, but it's always possible to solve it without having
> to guess.

  By the way, another requirement for the sudoku to be unambiguous is that
only one solution must exist.

-- 
                                                          - Warp


Post a reply to this message

From: Invisible
Subject: Re: Sudoku
Date: 23 Jan 2009 11:05:16
Message: <4979eabc@news.povray.org>
One might argue that if, for a specific combination of givens, there is 
only one possible valid solution, then there must theoretically exist 
some chain of "logic" which can reveal it without backtracking.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.