JUNG cannot display large graphs?

旧巷老猫 提交于 2019-12-10 16:47:07

问题


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.


回答1:


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.




回答2:


How much memory are you starting your VM with? Assuming your working on windows, looking at the Task Manager, does the VM hit the maximum amount of allocated memory and start using swap?




回答3:


The problem probably lies with the calculation of your vertices' positions. The only layout that I've found fairly easy to calculate was the Tree Layout and obviously that's not suitable for all data sets.

The solution probably is to write your own custom layout with a lot less calculations than say an FRLayout.



来源:https://stackoverflow.com/questions/2346402/jung-cannot-display-large-graphs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!