跳到内容

请参阅以下链接以了解已实现的重连方法。

用法

rewire(graph, with)

参数

graph

要重连的图

with

对重连方法之一的函数调用,请参见下面的详细信息。

重连后的图。

参见

其他重连函数: each_edge(), keeping_degseq()

示例

g <- make_ring(10)
g %>%
  rewire(each_edge(p = .1, loops = FALSE)) %>%
  plot(layout = layout_in_circle)

print_all(rewire(g, with = keeping_degseq(niter = vcount(g) * 10)))
#> IGRAPH 644f582 U--- 10 10 -- Ring graph
#> + attr: name (g/c), mutual (g/l), circular (g/l)
#> + graph attributes:
#> | + name:
#> |   [1] "Ring graph"
#> | + mutual:
#> |   [1] FALSE
#> | + circular:
#> |   [1] TRUE
#> + edges from 644f582:
#>  [1] 3-- 8 1-- 4 9--10 1-- 5 2-- 6 2-- 3 5-- 7 4-- 9 6--10 7-- 8