[英]How to generate clear graph with jgrapht with very big number of vertices that don't overlap each other
I am working on generating a graph with Java using jgraph and jgrapht libraries. 我正在使用jgraph和jgrapht库在Java中生成图形。 The problem is that my graph has a very big number of vertices (varying from 300 to 1000 in some cases) and no matter what I try, vertices and edges keep on overlapping each other creating a mess and, of course, a non-readable graph.
问题是我的图有很多顶点(在某些情况下为300到1000),无论我尝试什么,顶点和边都不断重叠,从而造成混乱,当然,这也是不可读的图形。 The method I used until now for placing the vertices on the JFrame is using random numbers as coordinates.
到目前为止,我用于在JFrame上放置顶点的方法是使用随机数作为坐标。 Is there some other way to make this work?
还有其他方法可以使这项工作吗? Maybe a better working algorithm or another Java library for better results?
也许是一个更好的算法或另一个Java库以获得更好的结果? Thank you in advance!
先感谢您!
We are currently having the same issue . 我们目前有同样的问题。 Our graphs can also be extremely big .
我们的图也可能非常大。 Using random number co-ordinates to generate the graph does not seem to be such a good idea ( Just my opinion ).
使用随机数坐标生成图似乎不是一个好主意(仅我个人观点)。 I have been using the graphiz library to generate graphs .
我一直在使用graphiz库生成图。 It can handle fairly large graphs without them overlapping each other .
它可以处理相当大的图而不会彼此重叠。 You can check it out here
你可以在这里查看
Depending on the type of graph you want can select one of graph algorithms ( dot,neato , fdp ,etc) Check out their gallery as well 根据您想要的图形类型,可以选择一种图形算法(点,neato,fdp等)以及查看它们的图库
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.