Re: Speed Up Sudoku Solver
- From: A..L. <alewando@xxxxxxxxxxxx>
- Date: Sun, 23 Apr 2006 20:57:00 -0500
On 17 Apr 2006 13:47:20 -0700, "Geoffrey Summerhayes"
<sumrnot@xxxxxxxxxxx> wrote:
Andrew wrote:
I have cobbled together a Sudoku solver in Prolog (see below).
However, it is extremely slow (almost a minute with only 8 squares missing!)
as it only uses a backtracking method to solve it.
Get B-Prolog and go to clp(FD) examples. Constraint-based algorithm
presented there is really fast. Translated to SICStus, solves the
following problem in about 10 sec.
[1,_,_,_,_,_,_,_,_],
[_,_,2,7,4,_,_,_,_],
[_,_,_,5,_,_,_,_,4],
[_,3,_,_,_,_,_,_,_],
[7,5,_,_,_,_,_,_,_],
[_,_,_,_,_,9,6,_,_],
[_,4,_,_,_,6,_,_,_],
[_,_,_,_,_,_,_,7,1],
[_,_,_,_,_,1,_,3,_]
A.L.
.
- Follow-Ups:
- Re: Speed Up Sudoku Solver
- From: arv832
- Re: Speed Up Sudoku Solver
- References:
- Speed Up Sudoku Solver
- From: Andrew
- Re: Speed Up Sudoku Solver
- From: Geoffrey Summerhayes
- Speed Up Sudoku Solver
- Prev by Date: Re: Speed Up Sudoku Solver
- Next by Date: Re: Speed Up Sudoku Solver
- Previous by thread: Re: Speed Up Sudoku Solver
- Next by thread: Re: Speed Up Sudoku Solver
- Index(es):
Relevant Pages
|
|