首页 文章

maxgramta等效于igraph 1.0中的Fruchterman-Reingold布局?

提问于
浏览
3

给定一个时间图(在每个边缘都有一个时间属性),我有一个脚本,用于使用Fruchterman-Reingold布局绘制图形的演变 . 我的脚本基于这个例子:Temporal Networks with igraph and R with 20 lines of code .

其中一个技巧是从最后一个快照 t-1 的布局开始计算当前snapshopt t 的布局,然后用 maxdelta 限制节点位移,以便在快照之间有一种平滑过渡的感觉 . 这是一个动画示例:https://vimeo.com/53071346

在igraph 1.0中,布局函数 layout.fruchterman.reingold 变为 layout_with_frmaxdelta 参数消失,快照之间的过渡过于激动 .

我们怎样才能在igraph 1.0中达到同样的效果?

1 回答

  • 2

    正如您所注意到的,Fruchterman-Reingold布局已在igraph 1.0中从头开始重写, maxdelta 参数消失为"side effect"(新实现不支持它) . 我没有't know whether the new implemenetation misses the argument only because there was no time to implement or because there'这是一个阻止实施的固有限制,但不管怎样,请在GitHub上提出问题 . 我不能做出任何承诺,因为我没有编写代码的那部分,但也许很快就会重新添加 .

    同时,通过查看source code of the algorithm,似乎温度参数是最大位移的限制因素 . 您可以尝试将最大位移发送为 start.temp 并将迭代次数设置为1 - 这将沿X轴和Y轴将位移限制为 start.temp .

    另一个替代方案是 layout.graphopt() 函数,它似乎支持使用 max.sa.movement 参数直接限制最大位移 .

相关问题