|
From: | Gábor Csárdi |
Subject: | Re: [igraph] df traversal |
Date: | Fri, 21 Feb 2014 18:07:00 -0500 |
hi,
trying to traverse the graph, kindly whats wrong in this..why its infinite loop..
graph_dfs<-function(i) #i is id
{
if(V(graph)$reached[i] == FALSE)
{ # print(str(i)); print("is reachable")
str(i); print("is reachable")
V(graph)$reached[i]<-TRUE
node_neighbours<- c(neighbors(graph, i , mode = 2) )#out direction all=1 2=out 3=in 4 = total
for( j in 1:length(node_neighbours) )
graph_dfs(node_neighbours[j])
}#end if
}
thanks in advance
}
_______________________________________________
igraph-help mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/igraph-help
[Prev in Thread] | Current Thread | [Next in Thread] |