6

I'm looking for a library to operate on dynamical graphs. I have a simulation where I must repeatedly calculate the average geodesic length for a graph after doing some changes in its structure (adding and deleting edges, on an undirected graph, all edges have the same weights).

I was using a quick C++ wrap over igraph that I made. igraph is for static graphs, so I was recalculating the geodesic distances from scratch every time I changed the graph. It's a monte carlo simulation, so I must do this millions of times to recover some statistics. It's starting to get real slow.

So I looked for libraries with algorithms for dynamical graphs, that could recalculate just update the average length after I delete or add an edge. I found some papers on the subject, but I'm really no specialist (I'm just a physicist, I'm just incidentally using graphs on a problem... I have almost no knowledge of data structures and algorithms) so I can't even read the papers, let alone implement the algorithms.

I found this library LEDA (http://www.algorithmic-solutions.com/leda/) which seems to have a dynamic graph extension, but it seems to be unmaintained (the links to download the free version are broken) and it's proprietary.

Are there any alternatives? I'm looking for C/C++ libraries. Maybe Haskell if I must, and I'm absolutely desperate.

Aditya
  • 5,509
  • 4
  • 31
  • 51
Rafael S. Calsaverini
  • 13,582
  • 19
  • 75
  • 132
  • How did you solve this problem? Six year later, I still can't find such (high-performance) library. – javaLover Apr 12 '17 at 02:21
  • This question was on-topic when it was asked, but it's off-topic now. At the same time... man, I _really_ want an answer to this. It'd make something I'm working on so much easier. Oh, well. – Nic Apr 28 '17 at 20:49

3 Answers3

1

Since you're doing Monte Carlo anyway, I assume that it would be acceptable to approximate the average shortest-path length. At each step, you could sample a handful of nodes and report the average shortest-path length for paths starting at one of those nodes, which has the same expectation and hopefully reasonable variance.

Alternatively, reference [3] of the JACM paper you mentioned on dynamic shortest-paths is an experimental study from 2004; perhaps the authors would let you use their code.

xyzzy
  • 51
  • 1
0

I know this late, but have you looked at LEMON?

Deathbreath
  • 115
  • 3
  • It uses breath first search. In its slide, it use "Bfs". http://lemon.cs.elte.hu/pub/doc/lemon-intro-presentation.pdf :( – javaLover Apr 12 '17 at 02:20
-1

Have you looked at Boost Graph Library

I haven't used it myself, but as part of Boost you can expect it to be very high quality, but it will demand a measure of C++ expertise.

antlersoft
  • 14,636
  • 4
  • 35
  • 55
  • 1
    Are there algorithms for dynamical graphs in Boost? It seems to me it's only for static graphs. – Rafael S. Calsaverini Jul 06 '11 at 22:06
  • From BGL documentation: "It is highly parameterized so that it can be optimized for different situations: the graph is directed or undirected, allow or disallow parallel edges, efficient access to just the out-edges or also to the in-edges, fast vertex insertion and removal at the cost of extra space overhead, etc." Not sure if this is what you need or if you are looking for algorithms that don't need to visit whole graph to account for changes? – antlersoft Jul 06 '11 at 22:29
  • Yes, I'm interested in algorithms that can calculate the change in the a geodesic path quicker based on the fact that I know the geodesic path before I deleted or added an edge, as an example. On the lines of this article: http://www.ams.org/mathscinet-getitem?mr=2145260 . – Rafael S. Calsaverini Jul 06 '11 at 22:58