1

I need a rooted tree from undirected graph as graph objects in R. The problem seems trivial, but I don't find anything. I find layout functions in igraph, but the result is not an igraph object, but a matrix (?!?). suppose the following tree as igraph object:

edges<- c(1,5, 2,5, 3,5, 4,5 ,5,6 ,6,10 ,6,7 ,7,8, 7,9, 10,11 ,6,12, 12,15, 12,13, 13,14) g<-make_graph(edges, n=max(edges), directed = FALSE)

and now i want a igraph object which is rooted tree at node 6. How do I get that?

Stefka
  • 11
  • 1
  • For the scope above I was using **dominator_tree()** in igraph, but this does not work and outouts always **Error in simple_vs_index(V(graph), idx, na_ok = na_ok) : Unknown vertex selected** unless you actually manually make your tree a rooted tree. It says that if there is no path from the root to any node than it collects the roots, but I dont think it does so. For instance **g – Stefka Oct 26 '17 at 08:56

0 Answers0