Talk:Knight's tour: Difference between revisions

→‎Incomplete Tours and Warnsdorff: Suggestions for improvement
No edit summary
(→‎Incomplete Tours and Warnsdorff: Suggestions for improvement)
Line 48:
:Try a 7x7 board. --[[User:Paddy3118|Paddy3118]] 03:24, 31 May 2011 (UTC)
:: I will. At this point there is something wrong with this solution. I will have to come back to it later (possibly this weekend). This was implemented from the WP description which talks about sets. I think the heart of the problem lies in the used of unordered sets everywhere and I will have to walk through some comparative examples side by side. This wouldn't be the first time I've been burned by a vague WP algorithm description. I'll have to borrow one of the other solutions and add code to show me the order squares get presented. --[[User:Dgamey|Dgamey]] 09:48, 31 May 2011 (UTC)
:: Confirmed that I sometimes get incomplete tours on 7x7 with Warnsdorff using the move list order in the Perl code. Leaving the any-size-board generalization out of code on page until I handle that case. --[[User:Markjreed|Markjreed]] 12:47, 31 May 2011 (UTC)
 
::: I believe that you've got to filter the output of the Warnsdorff algorithm in case it fails to do a tour. (That is, apply the “if at first you don't succeed” principle.) I don't know what the probability of failure is though. You might want to add the checks for impossibility (see the WP page) to your code though. –[[User:Dkf|Donal Fellows]] 13:50, 31 May 2011 (UTC)
 
== C++ formatting ==
 
Anonymous user