caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Christophe Raffalli <raffalli@univ-savoie.fr>
To: caml-list@inria.fr
Subject: Re: [Caml-list] Poset variant of union-find datastructure
Date: Thu, 28 Jul 2011 10:53:37 +0200	[thread overview]
Message-ID: <4E312391.9030703@univ-savoie.fr> (raw)
In-Reply-To: <20110727202007.GG21817@localhost>

Le 27/07/2011 22:20, Guillaume Yziquel a écrit :
> Hi.
>
> I'm wondering if people on this list may have any insight as to how
> implement a "poset-find" datastructure much like a union-find
> datastructure.
>
> A typical union find signature can be found here:
>
> http://www.enseignement.polytechnique.fr/informatique/INF564/html/unionFind.mli.html
>
> The core of the signature I'm interested in is:
>
> 	type 'a point
> 	val fresh : 'a -> 'a point
> 	val find : 'a point -> 'a
> 	val union : 'a point -> 'a point -> unit
> 	val equivalent : 'a point -> 'a point -> bool
>
> and I'd like a similar signature like:
>
> 	type 'a point
> 	type rel : G | Geq | Eq | Leq | L
> 	val fresh : 'a -> 'a point
> 	val find : 'a point -> 'a
> 	val relate : rel -> 'a point -> 'a point -> unit
> 	val relation : 'a point -> 'a point -> rel option
>
> Has anybody given thought to this kind of datastructure, or is there any
> prior work? Or is there really no better alternative than a graph? What
> worries me about a graph is that I do not really perceive an efficient way
> to query the order between two 'a points.
>
Hello,
 
I only see the graph solution (unfortunately) ... With variants:

- just a graph, querying the relation requiring to traverse the graph
- computing the transitive closure of the graph (relate taking more time),
but querying being much faster.
- computing both the transitive closure and the transitive reduction of
the grap
which reduce a bit the time for relate (less edges to follow). But not
changing the
worst case complexity, I think.

I would be very happy too if there were a more efficient solution
(logarithmic complexity both for relation and relate ?)

Cheers,
Christophe
 

  reply	other threads:[~2011-07-28  8:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-27 20:20 Guillaume Yziquel
2011-07-28  8:53 ` Christophe Raffalli [this message]
2011-07-28 17:03   ` Guillaume Yziquel
     [not found] <fa.4YXCBZTjiruOkOWERgIhmlS84TY@ifi.uio.no>
2011-07-29 15:50 ` Radu Grigore

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=4E312391.9030703@univ-savoie.fr \
    --to=raffalli@univ-savoie.fr \
    --cc=caml-list@inria.fr \
    /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).