chiark / gitweb /
Unify the two solvers in Solo. nsolve has now had recursion
authorSimon Tatham <anakin@pobox.com>
Wed, 6 Jul 2005 18:36:20 +0000 (18:36 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 6 Jul 2005 18:36:20 +0000 (18:36 +0000)
commit6ea61aa98e9b4a39504f0cd2eb768ecb4d508f7a
treeb1e9efb215a7288d3e3b7cdbfe25953cc605c684
parent753339737ea98fd9caf26a5913f8f210897ef04a
Unify the two solvers in Solo. nsolve has now had recursion
capability added to it, to be used only when all else fails, and is
simply called `solver'. This means that:

 - solving of 5x5 Trivial grids using the `Solve' function, which
   previously hung for ages because rsolve happened to take a wrong
   turning at the start, is now zippy
 - solosolver doesn't require the confusing -r and -n options
 - solosolver can show its working even for Unreasonable grids.

Unfortunately, the new unified solver still isn't suitable for grid
generation. After it proved to be so much faster at solving 5x5s, I
hoped to be able to substitute it for rsolve during generation and
gain additional speed in 5x5 generation too; but no luck, because
it's slower _per recursion level_, and although during solving it
makes up for this by needing very few levels, there is a lot of
_unavoidable_ recursion during generation, especially at 5x5. A
hybrid strategy which starts off with rsolve and switches to the
unified solver at a critical point proved unsatisfactory as well,
because the critical point changes depending on the vagaries of the
recursion and can't be pinpointed easily. So rsolve is still in
there, only renamed `gridgen' because that's now all it's good for.

[originally from svn r6077]
solo.c