Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Terry Reedy
On 3/10/2010 4:49 PM, Lawrence D'Oliveiro wrote: In message, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. Heuristic algorithms correctly compute some function, just not the one you want ;-). -- http://mail.python.org/mailma

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Grant Edwards
On 2010-03-10, Lawrence D'Oliveiro wrote: > In message , Gabriel > Genellina wrote: > >> Warnsdorff's algorithm is heuristic ... > > Then it shouldn???t be called an ???algorithm???. Why? An algorithm is just a well-defined series of steps. Just because it uses heuristics doesn't mean it's not

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Robert Kern
On 2010-03-10 15:49 PM, Lawrence D'Oliveiro wrote: In message, Gabriel Genellina wrote: Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. There are lots of algorithms that use heuristics or are heuristics. The two are orthogonal concepts. -- Robert Kern

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Lawrence D'Oliveiro
In message , Gabriel Genellina wrote: > Warnsdorff's algorithm is heuristic ... Then it shouldn’t be called an “algorithm”. -- http://mail.python.org/mailman/listinfo/python-list

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Terry Reedy
On 3/10/2010 12:37 AM, Gabriel Genellina wrote: if (next != 0): (self.y, self.x) = (next.y, next.x) In Python3, next is a builtin function. Choose a different name, at least in public code ;=). -- http://mail.python.org/mailman/listinfo/python-list

Re: Knight's tour Warndorff's algorithm problem

2010-03-10 Thread Robin Rytich
On Wed, 2010-03-10 at 02:37 -0300, Gabriel Genellina wrote: > Warnsdorff's algorithm is heuristic; it works most of the time, but in > some cases leads to a dead end and you have to backtrack and try another > alternative. > The starting square is important; if you start at 1,1 (instead of 0,0