图:解决紧密重叠的节点 [英] igraph: Resolving tight overlapping nodes

查看:261
本文介绍了图:解决紧密重叠的节点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个只有几百个节点和边的图.断开连接的子图分离出来并能很好地分解,但是子图中的节点重叠并且不能很好地分解.我尝试了几种布局算法,还尝试更改布局算法中的相关参数(例如:iter,kkconst,start.temp等).但是,我仍然无法分散紧密聚集的节点.参见下图.

I have a graph with few hundred nodes and edges. The disconnected subgraphs separate out and resolve well but the nodes within subgraphs overlap and do not resolve well. I have tried several layout algorithms and have also tried changing the relevant parameters within the layout algorithm (ex: iter, kkconst, start.temp etc). But, I am still not able to disperse the tightly clustered nodes. See figure below.

我希望找到一些参数来控制吸引力/排斥力/重力等,但似乎没有. bdemarest中的答案和数字>问题似乎确实可以解决此问题.奇怪的是,新版本的igraph中已弃用了几个看似有用的参数(coolexp,maxdelta,area,repulserad等).

I was hoping to find some parameter to control attraction/repulsion/gravity etc but there seems to be none. The answer and figures from bdemarest in this question does seem to fix exactly this issue. Strangely enough, several seemingly useful parameters have been deprecated in the new version of igraph (coolexp, maxdelta, area, repulserad etc).

有没有人知道一种方法,可以使子图保持良好的分离状态,同时又可以很好地散布紧密的节点,以至于它们不会重叠?

Does anyone know of a way to keep the sub graphs well separated while spreading out close nodes well enough that they do not overlap?

推荐答案

我设法使用软件包qgraph使它能够正常工作.

I managed to get it to work using package qgraph.

这是一个有效的示例:

library(igraph)
library(qgraph)

g <- barabasi.game(355, directed=FALSE)

png("plot1.png", height=6, width=12, units="in", res=250)
par(mfrow=c(1, 3))

plot(g,layout=layout_with_fr,vertex.size=4,vertex.label=NA)
mtext("layout_with_fr", side=1)

e <- get.edgelist(g)
l <- qgraph.layout.fruchtermanreingold(e,vcount=vcount(g))
plot(g,layout=l,vertex.size=4,vertex.label=NA)
mtext("qgraph.layout.fruchtermanreingold default", side=1)

l <- qgraph.layout.fruchtermanreingold(e,vcount=vcount(g),
      area=8*(vcount(g)^2),repulse.rad=(vcount(g)^3.1))
plot(g,layout=l,vertex.size=4,vertex.label=NA)
mtext("qgraph.layout.fruchtermanreingold modified", side=1)

dev.off()

这篇关于图:解决紧密重叠的节点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆