我有一个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
Run Code Online (Sandbox Code Playgroud)
我想要的是获得两个变量v1,v2where v1 = 3和v2 = 1(相当于v1 = 1和v2 = 3).我想对图中的所有边做这个E(g)[x], where x is the loop variable.有没有办法做到这一点?
谢谢