开发者

How to implement a cluster graph in java

开发者 https://www.devze.com 2023-04-01 11:22 出处:网络
I want to draw a cluster graph like this. Is there a library for this? How should Ibui开发者_开发问答ld the data structure to contain the input data? Like a dictionary with key as the node itself and

I want to draw a cluster graph like this. Is there a library for this? How should I bui开发者_开发问答ld the data structure to contain the input data? Like a dictionary with key as the node itself and value as an array with the nodes connecting to. What could be a more precise term to describe this?


Try a library like JUNG.

JUNG is a framework made for displaying and working with any kind of graphs and networks on Java. It supports transitions, collapsing, complex layouts, …


About the data structure: It is complicated, and depends on the type of cluster (bidirectional or unidirectional).
In the last case, you shouldn't use a Dictionary, or connections would be stored twice.
Look at JUNG, for example. I think its data is Serializable.


Take a look at JGraphT: it provides the data structures and you can then render that using JGraph.

0

精彩评论

暂无评论...
验证码 换一张
取 消