# NOT RUN {
set.seed(7,kind="Mersenne-Twister")
dataset <- matrix(rnorm(1000),nrow=100,ncol=10)
m <- minForest(dataset,stat="BIC")
DFS(edges=m@edges,v=1,p=10)
# [1] 5 2 9 8
#######################################################################
data(dsDiscr)
m1 <- minForest(dsDiscr,homog=TRUE,forbEdges=NULL,stat="BIC")
vertices <- DFS(edges=m1@edges, v=1, p=m1@p)
# result
vertices
# numeric(0)
# meaning that 1 is an isolated vertex
# OR
m1 <- minForest(dsDiscr,homog=TRUE,forbEdges=NULL,stat="LR")
vertices <- DFS(edges=m1@edges, v=1, p=m1@p)
# result
vertices
# [1] 4 8 12 19 18 14 7 17 5 3 10 13 15 9 6 20 16 11 2
# meaning that 1 reachs all vertices (a tree)
# }
Run the code above in your browser using DataLab