igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] E(g) edges in multigraph


From: Tamás Nepusz
Subject: Re: [igraph] E(g) edges in multigraph
Date: Sat, 17 Mar 2012 12:05:38 +0100

> I am trying to get all edges between two vertices in a multigraph using 
> E(g,P) but I get only one edge. Could you please help me retrieve the ids of 
> all multiple edges?
> 
> 
> Here is an example:
> g = graph.ring(3)
> g = add.edges(g, c(0,1)) #make into a multigraph
> E(g, P=c(0,1)) #outputs only one edge and not two (0,1) edges!

Try this:

as.vector(E(g)[0 %--% 1])

If your graph is directed and you are interested in the edges in one direction 
only:

as.vector(E(g)[0 %->% 1])

Best,
T.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]