Search code examples
javajung

JUNG cannot display large graphs?


I am using JUNG for a project and when I am displaying relatively large graphs eg 1500 nodes, my pc would not be able to handle it (graphs are rendered but If I want to navigate the graph the system become very slow). Any Suggestions.


Solution

  • So, there are two things that JUNG visualization doesn't always scale very well right now:

    1. iterative force-directed layouts
    2. interaction: figuring out which node or edge (if any) is being referenced for hover and click events.

    It sounds like it's the latter that you're running into right now.

    Depending on your requirements, you have a couple of options:

    • (a) turn off mouse events, or at least hover events
    • (b) hack the visualization system so that lookups of event targets aren't O(m+n).

    Simple solutions for (b) basically just partition the viewing area into smallish chunks and only sends events to elements that are in the same chunk as the pointer. (Obviously, the smaller you make the chunks, the more memory is required.)

    We've had plans to do (b) (and a design sketched out) for some time but have been working on other things. Anyone that wants to help with a more permanent solution, please contact me.