如果您从 R 中使用 igraph,请使用此选项
| adjacent_vertices {igraph} | R 文档 |
此函数类似于 neighbors,但它一次查询多个顶点的相邻顶点。
adjacent_vertices(graph, v, mode = c("out", "in", "all", "total"))
图 |
输入图。 |
v |
要查询的顶点。 |
模式 |
是否查询传出(‘out’)、传入(‘in’)边或两种类型(‘all’)。这对于无向图将被忽略。 |
顶点序列列表。
其他结构查询:[.igraph(), [[.igraph(), are_adjacent(), ends(), get.edge.ids(), gorder(), gsize(), head_of(), incident_edges(), incident(), is_directed(), neighbors(), tail_of()
g <- make_graph("Zachary")
adjacent_vertices(g, c(1, 34))