g <- frag.simul.process(n.components=15, vertices=50, disturbance=.15)
igraph::gorder(g)
igraph::components(g)$no
# reduce the number of framents and conserve the number of connected components:
g1 <- frag.graph.reduce(g, n.frag.to.remove = 40, conserve.objects.nr = TRUE)
igraph::gorder(g1)
igraph::components(g1)$no
# reduce the number of framents and do not conserve the number of connected components:
g2 <- frag.graph.reduce(g, n.frag.to.remove = 40, conserve.objects.nr = FALSE)
igraph::gorder(g2)
igraph::components(g2)$no
Run the code above in your browser using DataLab