caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Data structure for a directed bipartite graph
@ 2007-10-10 16:52 Orlin Grigorov
  2007-10-10 18:34 ` [Caml-list] " Vincent Aravantinos
  2007-10-10 19:36 ` Jean-Christophe Filliatre
  0 siblings, 2 replies; 3+ messages in thread
From: Orlin Grigorov @ 2007-10-10 16:52 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1210 bytes --]

A bipartite graph is a graph, which has two kinds of nodes, and every node
is connected only to nodes from the other kind.  In other words, if the two
types of nodes are A and B, then there can be an edge between nodes of type
A to nodes of type B (resp. edge from B to A), but never an edge between A
and A, or B and B.

So, I was thinking about a data structure in OCaml, in which I want to store
such graph, and also to allow me easy access to elements, as well as adding
new nodes and edges (therefore, the structure would be imperative, that is,
will have a state).

So, how about this:

1) an array, which holds all the nodes and the information about them (e.g.
type of the node, other info contained in it)

2) a two dimensional array, indicating existence of an edge between each two
nodes.

Maybe it's worth mentioning that the number of nodes for my particular
purposes will never be more than 200, so I don't think the matrix will take
up too much memory?!

Thank you in advance.   I am in the process of producing my Master's thesis
in Canada, and I am just starting to make an implementation in OCaml, which,
even though newly discovered language by me, for a very short time became my
favorite!

[-- Attachment #2: Type: text/html, Size: 1281 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-10 19:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-10 16:52 Data structure for a directed bipartite graph Orlin Grigorov
2007-10-10 18:34 ` [Caml-list] " Vincent Aravantinos
2007-10-10 19:36 ` Jean-Christophe Filliatre

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).