在 igraph 图中查找具有指定端点的边。此函数处理多重图(具有多条边的图),并且可以考虑或忽略有向图中的边方向。
参见
其他结构查询:[.igraph()
, [[.igraph()
, adjacent_vertices()
, are_adjacent()
, ends()
, gorder()
, gsize()
, head_of()
, incident()
, incident_edges()
, is_directed()
, neighbors()
, tail_of()
作者
Gabor Csardi csardi.gabor@gmail.com
示例
g <- make_ring(10)
ei <- get_edge_ids(g, c(1, 2, 4, 5))
E(g)[ei]
#> + 2/10 edges from e1dc9d4:
#> [1] 1--2 4--5
## non-existant edge
get_edge_ids(g, c(2, 1, 1, 4, 5, 4))
#> [1] 1 0 4
## For multiple edges, a single edge id is returned,
## as many times as corresponding pairs in the vertex series.
g <- make_graph(rep(c(1, 2), 5))
eis <- get_edge_ids(g, c(1, 2, 1, 2))
eis
#> [1] 5 5
E(g)[eis]
#> + 2/5 edges from 8944175:
#> [1] 1->2 1->2