# NOT RUN {
###################################
# Example with serial processing.
###################################
library(igraph)
library(gRbase)
# specified the number of vertices and edges
X=10
edge= 20
# Generate a decomposable graph
Graph <-decGraph (X,edge,parallel=FALSE,clusters=NULL)
###################################
# Example with parallel processing.
###################################
library(parallel)
# Create cluster
cl <- makeCluster(2)
# Send the gRbase package to all the nodes
clusterEvalQ(cl, library(gRbase))
# Generate a decomposable graph.
Graph <-decGraph (X,edge,parallel=TRUE,clusters=cl)
# Stop the cluster
stopCluster(cl)
Graph
# }
Run the code above in your browser using DataLab