caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Diego Olivier Fernandez Pons <Diego.FERNANDEZ_PONS@etu.upmc.fr>
To: Michael Wohlwend <micha-1@fantasymail.de>
Cc: OCaml Mailing List <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] algorithm question
Date: Sun, 26 Feb 2006 21:48:08 +0100 (NFT)	[thread overview]
Message-ID: <Pine.A41.4.44.0602262130010.589968-100000@ibm1> (raw)
In-Reply-To: <200602262121.52645.micha-1@fantasymail.de>

    Bonjour,

> I want to implement the dancing link algorithm as described here:
> http://www-cs-faculty.stanford.edu/~knuth/papers/dancing-color.ps.gz

The "dancing link algorithm" explained by Knuth is not an algorithm. It is
a mix between an algorithm (or an algorithmic idea) and a data structure.
The algorithmic idea is the backtracking tree shaped exploration of the
set of solutions of a combinatorial problem. The data structure is the
reversible list of assignments that are still possible for a variable at a
given node of the search tree.

> has someone an idea if there is an equally fast way to implent this more
> functional ? The method in the paper seems pretty good, just adjusting a
> the linksfields of the structure...

The modern approach separates the problem in several orthogonal
components:

- reduction algorithms : how not to explore all the possible solutions of
an NP-problem using some mathematical/combinatorial properties like "the
solution cannot contain both x = 3 and y = 5"

- tree search implementation : can be done by node sharing (that is there
is a copy of every leaf of the tree) or node replaying (There is a virtual
tree and a single physical node. Every time you want to change of node in
the virtual tree you must resynchronize it with some data you kept about
the path that lead you there). The first one will lead to "reversible data
structure"  techniques while the second one to "persistent data structure"
techniques.

- the visiting heuristic : how do I jump from one node to another in the
tree, when do I open or close nodes, etc.

The modern name is "implicit enumeration algorithms" which split
themselves into multiple branches according to the way the branches in the
search tree are pruned : (integer) linear programming, constraint
programming, SAT, etc.

By the way, they have also been combined with ascending algorithms (not
tree like explorations of the search space) like dynamic programming,
resolution, etc.

> you can solve puzzle problems with this algorithm and shorter (execution
> time) is really better here :-)

The method which is the closest to the one described in Knuth's paper is
named Constraint Programming (CP). There are several libraries for that in
many languages including Caml (it's name is FaCiLe).

        Diego Olivier


  reply	other threads:[~2006-02-26 20:48 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-26 20:21 Michael Wohlwend
2006-02-26 20:48 ` Diego Olivier Fernandez Pons [this message]
2006-02-26 21:28   ` [Caml-list] " Michael Wohlwend
2006-02-26 20:51 ` Brian Hurt
2006-02-26 21:03   ` Diego Olivier Fernandez Pons
2006-02-27 10:30   ` Jean-Christophe Filliatre
2006-02-27 11:02     ` Diego Olivier Fernandez Pons
2006-02-27 14:48     ` Brian Hurt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.A41.4.44.0602262130010.589968-100000@ibm1 \
    --to=diego.fernandez_pons@etu.upmc.fr \
    --cc=caml-list@yquem.inria.fr \
    --cc=micha-1@fantasymail.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).