Since each generator function expects the graph object as its first argument one can make use of the fantastic magrittr pipes to improve reading. See the documentation of the magrittr package for details on the forward-pipe operator.
library(grapherator)
library(magrittr)
set.seed(1) # reproducability
g = graph(lower = 0, upper = 10) %>%
addNodes(n = 20, generator = addNodesUniform) %>%
addEdges(generator = addEdgesComplete) %>%
addWeights(generator = addWeightsRandom, method = runif, min = 5, max = 10) %>%
addWeights(generator = addWeightsRandom, method = runif, min = 5, max = 10)
print(g)
#> GRAPHERATOR GRAPH
#> #nodes : 20 (UNG)
#> #edges : 190 (CEG)
#> #weights per edge: 2 (RWG,RWG)
do.call(gridExtra::grid.arrange, c(plot(g), list(nrow = 1)))Example network.
Need a high-speed mirror for your open-source project?
Contact our mirror admin team at info@clientvps.com.
This archive is provided as a free public service to the community.
Proudly supported by infrastructure from VPSPulse , RxServers , BuyNumber , UnitVPS , OffshoreName and secure payment technology by ArionPay.