Asp Forum
Home
|
Login
|
Register
|
Search
Forums
>
comp.lang.python
Knight's tour Warndorff's algorithm problem
Robin Rytich
3/10/2010 1:58:00 AM
Hi all
I'm having some troubles with writing Knight's tour
(
http://en.wikipedia.org/wiki/Knigh...
) solution in Python 3. I'm
using Warnsdorff's algorithm (
http://en.wikipedia.org/wi...
27s_tour#Algorithm) and I'm wondering why it doesn't work with boards of
certain sizes. I've written a solution and I like it but it does not
work correctly for 15x15, 26x26, 27x27 and 32x32 boards (don't know why;
checked from 5x5 to 40x40). So I'd be really glad if you tell me whether
I am too stupid for Python or for Discrete Math? In other words, did I
implemented Warnsdorff's algorithm in Python 3 correctly or maybe all my
troubles are because I haven't read tutorial with enough patience?
P.S. Warnsdorff's algorithm says that it's not really important which
square to choose between those which have equal amount of ways out. In
spite of that I tried to changed my program and added '=' to condition
at line 78. Results were quite surprising: now it works for 5x5,
6x6, ... 34x34 but not for 35x35!
Servizio di avviso nuovi messaggi
Ricevi direttamente nella tua mail i nuovi messaggi per
Knight's tour Warndorff's algorithm problem
Inserendo la tua e-mail nella casella sotto, riceverai un avviso tramite posta elettronica ogni volta che il motore di ricerca troverà un nuovo messaggio per te
Il servizio è completamente GRATUITO!
x
Login to ForumsZone
Login with Google
Login with E-Mail & Password