Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the fastest force-directed network graph engine for large data sets?

We currently have a dynamically updated network graph with around 1,500 nodes and 2,000 edges. It's ever-growing. Our current layout engine uses Prefuse - the force directed layout in particular - and it takes about 10 minutes with a hefty server to get a nice, stable layout.

I've looked a little GraphViz's sfpd algorithm, but haven't tested it yet...

Are there faster alternatives I should look at?

  • I don't care about the visual appearance of the nodes and edges - we process that separately - just putting x, y on the nodes.
  • We do need to be able to tinker with the layout properties for specific parts of the graph, for instance, applying special tighter or looser springs for certain nodes.

Thanks in advance, and please comment if you need more specific information to answer!

EDIT: I'm particularly looking for speed comparisons between the layout engine options. Benchmarks, specific examples, or just personal experience would suffice!

like image 431
peteorpeter Avatar asked Mar 31 '11 00:03

peteorpeter


3 Answers

I wrote a JavaScript-based graph drawing library VivaGraph.js.

It calculates layout and renders graph with 2K+ vertices, 8.5K edges in ~10-15 seconds. If you don't need rendering part it should be even faster.

Here is a video demonstrating it in action: WebGL Graph Rendering With VivaGraphJS.

Online demo is available here. WebGL is required to view the demo but is not needed to calculate graphs layouts. The library also works under node.js, thus could be used as a service.

Example of API usage (layout only):

var graph = Viva.Graph.graph(),
    layout = Viva.Graph.Layout.forceDirected(graph);

graph.addLink(1, 2);
layout.run(50); // runs 50 iterations of graph layout

// print results:
graph.forEachNode(function(node) { console.log(node.position); })

Hope this helps :)

like image 96
Anvaka Avatar answered Sep 17 '22 23:09

Anvaka


I would have a look at OGDF, specifically http://www.ogdf.net/doku.php/tech:howto:frcl I have not used OGDF, but I do know that Fast Multipole Multilevel is a good performant algorithm and when you're dealing with the types of runtimes involved with force directed layout with the number of nodes you want, that matters a lot. Why, among other reasons, that algorithm is awesome: Fast Multipole method. The fast multipole method is a matrix multiplication approximation which reduces the O() runtime of matrix multiplication for approximation to a small degree. Ideally, you'd have code from something like this: http://mgarland.org/files/papers/layoutgpu.pdf but I can't find it anywhere; maybe a CUDA solution isn't up your alley anyways.

Good luck.

like image 23
J Trana Avatar answered Sep 18 '22 23:09

J Trana


The Gephi Toolkit might be what you need: some layouts are very fast yet with a good quality: http://gephi.org/toolkit/

30 secondes to 2 minutes are enough to layout such a graph, depending on your machine. You can use the ForAtlas layout, or the Yifan Hu Multilevel layout.

For very large graphs (+50K nodes and 500K links), the OpenOrd layout wil

like image 37
Seb Avatar answered Sep 21 '22 23:09

Seb