Thank you, Gabot. Exactly.

 

g <- read.graph("two-col-edgelist-100000rows.txt",format="ncol",names=TRUE)

g2 <- graph.neighborhood(g,1,"A_vertex_name")

 

and all the above commands finish elegantly. 

 

HOWEVER, IT IS A LIST OF GRAPHS AND THE NAMES OF THE VERTICES MAY HAVE LOST?

 

I am planning to use neighborhood to create a set of new graphs and write
them out by the function

 

write.graph(g, "edgelist.txt",format="edgelist") so I will obtain some
resultant files like:

 

Example_file_1:

 

V_NAME_ABC   V_NAME_HHH

V_NAME_ABC   V_NAME_HHK

V_NAME_ABC   V_NAME_ANOTHER

V_NAME_ABC   V_NAME_SAVE

V_NAME_ABC   V_NAME_EXAMP

V_NAME_ABC   V_NAME_TEST

 

 

 

From: [email protected]
[mailto:[email protected]] On Behalf Of Gábor
Csárdi
Sent: Wednesday, December 05, 2012 10:20 PM
To: Help for igraph users
Subject: Re: [igraph] getting k-connected nodes from a vertex

 

Look at the function graph.neighborhood(), I think that does exactly what
you want. 

 

Gabot

 

On Tue, Dec 4, 2012 at 8:47 AM, Ross KK Leung <[email protected]> wrote:

Has igraph any function to retrieve the nodes connected to a specified
vertex recursively? For example, a root is connected to 3 leaves, and then
these 3 leaves are each connected to 2, 1, 4 leaves respectively, and then
that 2, 1, 4 leaves are used again to search. So this should be something
like depth-first search but I’m unable to identify how to get back the
edgelist for this search and the layer (or depth) that I can specify to
search.


_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help





 

-- 
Gabor Csardi <[email protected]>     MTA KFKI RMKI

_______________________________________________
igraph-help mailing list
[email protected]
https://lists.nongnu.org/mailman/listinfo/igraph-help

Reply via email to