简体   繁体   English

根据jung的边数排列顶点

[英]Arranging the vertices based on the number of edges in jung

I have created a network based on interactions. 我创建了一个基于交互的网络。 Some vertices have more interaction and some has less interaction. 一些顶点具有更多的相互作用,而某些顶点具有较少的相互作用。 I have to display the vertex with more interaction at the center of the network and other vertices should lie around the central vertex. 我必须在网络中心显示具有更多交互作用的顶点,而其他顶点应位于中心顶点周围。 How can i proceed with this? 我该如何进行呢? Please help me with this 请在这件事上给予我帮助

If none of the existing layout algorithms do what you want, then you will need to provide your own Layout class. 如果现有的布局算法都不能满足您的要求,那么您将需要提供自己的Layout类。

An intermediate option that you might try would be to identify the vertices that have the highest degree, fix[1] their positions in places at the middle of the viewing area that look good to you, and then let the layout algorithm select the positions for the rest of the vertices. 您可以尝试的一个中间选项是,确定度数最高的顶点,将其位置固定[1]在对您而言看起来不错的查看区域中间的位置,然后让布局算法为以下位置选择位置:其余的顶点。

[1] use setLocation() and lock() before you start the layout algorithm: http://jung.sourceforge.net/doc/api/edu/uci/ics/jung/algorithms/layout/AbstractLayout.html#setLocation(V , double, double) [1]在开始布局算法之前,请使用setLocation()和lock(): http : //jung.sourceforge.net/doc/api/edu/uci/ics/jung/algorithms/layout/AbstractLayout.html#setLocation( V (double,double)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM