【发布时间】:2014-01-20 20:54:42
【问题描述】:
我有一个 igraph 图,想简单地获取每条边的 from_id 和 to_id。例如:
g <- erdos.renyi.game(4, 1, type="gnm", directed=FALSE)
E(g)[1] # will return some edge, possibly not the same one
# Edge sequence:
# e
# e [1] 3 -- 1
我想要的是获得两个变量v1、v2,其中v1 = 3 和v2 = 1(相当于v1 = 1 和v2 = 3)。我想对图中E(g)[x], where x is the loop variable 中的所有边执行此操作。有没有办法做到这一点?
谢谢
【问题讨论】: