Skip to content
Prev 308417 / 398506 Next

help finding edge connecting two nodes

Hello,

You should give a reproducible example showing us what you have tried, 
with an example dataset.
Try the following.

# A graph I've just drawn
v <- c(1,2,1,3,1,4,2,5,2,4,3,5,3,6,5,7,5,8,5,10,6,8,6,10,7,8,7,9,8,9)
g <- graph(v, directed = FALSE)
plot(g, layout=layout.fruchterman.reingold)
E(g)$weight <- 1:15

# This is what you want
E(g)[5 %--% 10]$weight


See the help for

?igraph::iterators


Hope this helps,

Rui Barradas
Em 18-10-2012 23:05, dhaval at mit.edu escreveu: