caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* ocamlgraph predecessors
@ 2009-08-08  5:24 Benjamin Ylvisaker
  2009-08-08 13:35 ` [Caml-list] " Edgar Friendly
                   ` (2 more replies)
  0 siblings, 3 replies; 13+ messages in thread
From: Benjamin Ylvisaker @ 2009-08-08  5:24 UTC (permalink / raw)
  To: caml-list

I have been using ocamlgraph for a while, and have been generally  
happy with it.  I experienced some poor performance with moderately  
large graphs (10-100k vertices) recently, which led me to look through  
the source code a little.  It seems that doing anything with the  
predecessors of a vertex, even just getting a list of them, requires  
scanning through all the vertices in a graph.  This seems a little  
crazy to me.  Am I missing something?  Is there some kind of work- 
around that gives reasonable performance for predecessor operations  
(i.e. not O(|V|)).

Thanks,
Ben


^ permalink raw reply	[flat|nested] 13+ messages in thread
* Re: [Caml-list] ocamlgraph predecessors
@ 2009-08-09 18:32 rixed
  2009-08-10  1:59 ` Jacques Garrigue
  0 siblings, 1 reply; 13+ messages in thread
From: rixed @ 2009-08-09 18:32 UTC (permalink / raw)
  To: caml-list

> What you're asking is similar to the problem of finding the predecessor
> of an arbitrary node in a singly-linked-list.  You have no option but to
> scan the whole list to find its predecessor.  If you had a
> doubly-linked-list, predecessor lookups would work easily, but that's a
> different data structure, with much more overhead.

Much more overhead, really ?
So this is for performance reasons that all functionnal languages
promote singly-linked lists, while for instance in Linux every list
is implemented with a doubly linked list for purely ideological reasons ?

:-)


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

end of thread, other threads:[~2009-08-26 14:35 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-08  5:24 ocamlgraph predecessors Benjamin Ylvisaker
2009-08-08 13:35 ` [Caml-list] " Edgar Friendly
2009-08-08 20:16   ` Benjamin Ylvisaker
2009-08-09 14:56     ` Edgar Friendly
2009-08-25 14:22       ` Julien Signoles
2009-08-25 14:22 ` Julien Signoles
2009-08-26 14:35   ` Benjamin Ylvisaker
2009-08-26  6:54 ` Jean-Christophe Filliâtre
2009-08-09 18:32 rixed
2009-08-10  1:59 ` Jacques Garrigue
2009-08-10 12:19   ` kcheung
2009-08-10 17:46     ` Benjamin Ylvisaker
2009-08-12 22:40   ` Francis Dupont

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