<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE message PUBLIC
  "-//MLarc//DTD MLarc output files//EN"
  "../../mlarc.dtd"[
  <!ATTLIST message
    listname CDATA #REQUIRED
    title CDATA #REQUIRED
  >
]>

  <?xml-stylesheet href="../../mlarc.xsl" type="text/xsl"?>


<message 
  url="2003/11/839330ec827afc2945d89edbbaf6a8c3"
  from="Eray Ozkural &lt;exa@k...&gt;"
  author="Eray Ozkural"
  date="2003-11-07T03:52:15"
  subject="Re: [Caml-list] Efficient and canonical set representation?"
  prev="2003/11/6c51cac155fc19a70c332c51f09bb199"
  next="2003/11/944504cb86937958edfda29223507e1c"
  prev-in-thread="2003/11/8e4bb7df1307031640c93d02c75186de"
  prev-thread="2003/11/272973bb60ea7c7353e7e93caaaffba9"
  next-thread="2003/11/dc476b21502f19abf3cbe8dc40f256bb"
  root="../../"
  period="month"
  listname="caml-list"
  title="Archives of the Caml mailing list">

<thread subject="[Caml-list] Efficient and canonical set representation?">
<msg 
  url="2003/11/4d47045d2b8c12d333c06969e3119ff7"
  from="Harrison, John R &lt;johnh@i...&gt;"
  author="Harrison, John R"
  date="2003-11-06T16:41:11"
  subject="[Caml-list] Efficient and canonical set representation?">
<msg 
  url="2003/11/6cebc068448cd67feb91c54909c26d81"
  from="Brian Hurt &lt;bhurt@s...&gt;"
  author="Brian Hurt"
  date="2003-11-06T17:03:25"
  subject="Re: [Caml-list] Efficient and canonical set representation?">
</msg>
<msg 
  url="2003/11/8e4bb7df1307031640c93d02c75186de"
  from="Eray Ozkural &lt;exa@k...&gt;"
  author="Eray Ozkural"
  date="2003-11-07T03:43:17"
  subject="Re: [Caml-list] Efficient and canonical set representation?">
</msg>
<msg 
  url="2003/11/839330ec827afc2945d89edbbaf6a8c3"
  from="Eray Ozkural &lt;exa@k...&gt;"
  author="Eray Ozkural"
  date="2003-11-07T03:52:15"
  subject="Re: [Caml-list] Efficient and canonical set representation?">
</msg>
</msg>
</thread>

<contents>
Hello John,

I forgot to mention: this is exactly the same question that I asked aeons ago 
for representing hypergraphs on haskell list. (For those who didn't remember: 
a hypergraph is basically a collection of sets whose elements are drawn from 
a finite set X, it is the generalization of a graph in which each edge 
connects multiple vertices rather than 2)

Of course there is a way to represent hypergraphs efficiently, but it's not a 
functional way. In the optimal and general purpose iterative method, you use 
the equivalent of adjacency list representation extended to hypergraphs: 
basically an array of pins (for each net) and an array of nets (for each 
pin).

 Since you are asking this question, you probably already know this. I am 
pretty sure a good ocaml implementation doesn't exist, but the idea is the 
same as in C and you can code it ;)

If speed isn't a paramount concern over abstraction at the present you can 
hack the Hypergraph module that uses edison which I had posted to haskell 
list. If you can't find it or can't get it to work, let me know and structure 
monster will try to help :)

Regards,

On Thursday 06 November 2003 18:41, Harrison, John R wrote:
&gt; Does anyone know a representation of finite sets over an orderable
&gt; polymorphic type that's (1) efficient and (2) canonical? Even better would
&gt; be a CAML or OCaml implementation. More precisely I'm looking for:
&gt;
&gt;   1. Log-time lookup and insertion, and linear-time union, intersection
&gt; etc.
&gt;
&gt;   2. Equal sets are represented by the same object.
&gt;
&gt; For example, ordered lists satisfy (2) but only part of (1), while all the
&gt; variants of balanced trees I can remember that satisfy (1) --- AVL trees
&gt; etc. --- fail (2).
&gt;
&gt; Thanks,
&gt;
&gt; John.
&gt;
&gt; -------------------
&gt; To unsubscribe, mail caml-list-request@inria.fr Archives:
&gt; http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ:
&gt; http://caml.inria.fr/FAQ/ Beginner's list:
&gt; http://groups.yahoo.com/group/ocaml_beginners

-- 
Eray Ozkural (exa) &lt;erayo@cs.bilkent.edu.tr&gt;
Comp. Sci. Dept., Bilkent University, Ankara  KDE Project: http://www.kde.org
www: http://www.cs.bilkent.edu.tr/~erayo  Malfunction: http://mp3.com/ariza
GPG public key fingerprint: 360C 852F 88B0 A745 F31B  EA0F 7C07 AE16 874D 539C

-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners

</contents>

</message>

