[Top][All Lists]

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

[igraph] Getting the vertices of an edge

From: Prithwiraj MUKHERJEE
Subject: [igraph] Getting the vertices of an edge
Date: Mon, 7 Feb 2011 17:16:35 +0100

Hello list

I have been using igraph in R for a while, but my knowledge is limited to the user manual.
My question is: Is there a way to programatically obtain the edges once an edge is selected using E()?

Here is an example:
#a small world network
> N<-simplify(watts.strogatz.game(1,10,2,.05))
#now i select a specified edge
> a<-E(N)[2]
> a
Edge sequence:
e [2] 3 -- 2

Now, I need a piece of code that would be of the form
with the output

For a directed edge, it should be of the form c(source_vertex,destination_vertex)

Is this possible? Ideally, such a code should work in for loops as well.

On a related note, if i choose a vertex say V(A)[i], can a function return a vector of the index numbers of all edges passing through it?

Best Regards

reply via email to

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