此函数检查提供的边的互惠对。
用法
which_mutual(graph, eids = E(graph), loops = TRUE)
详细信息
在有向图中,如果图也包含 (B,A) 有向边,则 (A,B) 边是互惠边。
请注意,多重图处理不当,即如果图包含 (A,B) 的两个副本和一个 (B,A) 的副本,则这三个边被认为是互惠边。
根据定义,无向图仅包含互惠边。
参见
reciprocity()
, dyad_census()
如果你只是想要一些关于互惠边的统计数据。
其他 structural.properties: bfs()
, component_distribution()
, connect()
, constraint()
, coreness()
, degree()
, dfs()
, distance_table()
, edge_density()
, feedback_arc_set()
, feedback_vertex_set()
, girth()
, is_acyclic()
, is_dag()
, is_matching()
, k_shortest_paths()
, knn()
, reciprocity()
, subcomponent()
, subgraph()
, topo_sort()
, transitivity()
, unfold_tree()
, which_multiple()
作者
Gabor Csardi csardi.gabor@gmail.com
示例
g <- sample_gnm(10, 50, directed = TRUE)
reciprocity(g)
#> [1] 0.56
dyad_census(g)
#> $mut
#> [1] 14
#>
#> $asym
#> [1] 22
#>
#> $null
#> [1] 9
#>
which_mutual(g)
#> [1] FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE TRUE FALSE FALSE TRUE
#> [13] FALSE TRUE TRUE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE FALSE
#> [25] TRUE TRUE TRUE TRUE FALSE FALSE FALSE FALSE TRUE FALSE FALSE TRUE
#> [37] TRUE FALSE TRUE FALSE TRUE TRUE FALSE TRUE TRUE TRUE TRUE FALSE
#> [49] FALSE TRUE
sum(which_mutual(g)) / 2 == dyad_census(g)$mut
#> [1] TRUE