此函数类似于 neighbors()
,但它一次查询多个顶点的相邻顶点。
用法
adjacent_vertices(graph, v, mode = c("out", "in", "all", "total"))
参见
其他结构查询:[.igraph()
, [[.igraph()
, are_adjacent()
, ends()
, get_edge_ids()
, gorder()
, gsize()
, head_of()
, incident()
, incident_edges()
, is_directed()
, neighbors()
, tail_of()
示例
g <- make_graph("Zachary")
adjacent_vertices(g, c(1, 34))
#> [[1]]
#> + 16/34 vertices, from 6c4cc7d:
#> [1] 2 3 4 5 6 7 8 9 11 12 13 14 18 20 22 32
#>
#> [[2]]
#> + 17/34 vertices, from 6c4cc7d:
#> [1] 9 10 14 15 16 19 20 21 23 24 27 28 29 30 31 32 33
#>