Random Graph Generation with Lucy

#devtools::install_github("robertness/lucy")
library(lucy)

Some functions that generate highly connected DAGs that are common in neural networks, neural networks, signaling networks, and Bayesian networks.

Simulate a directed acyclic graph (DAG).

g <- sim_DAG(10)
igraphviz(g)

dag

Simulate a multi-layer perceptron structure.

g <- mlp_graph(c("I1", "I2"), c("O1", "O2", "O3"), c(3, 2, 4))
igraphviz(g)

mlp

Simulate a DAG composed of stacked layers (a generalization of a mulilayer perceptron).

g <- layer_DAGs(3, 4)
igraphviz(g)

layered_dag

Given a input network that has a power-law degree distribution (scale-free network), fit the parameters of that power law and simulate a new network based on that fit. The simulated graph need not have the same amount of vertices as the input graph.

power_law_graph <- barabasi.game(40)
sim_graph <- power_law_sim(power_law_graph, 40)
par(mfrow=(c(1, 2)))
igraphviz(power_law_graph, main = "Input Graph")
igraphviz(sim_graph, main = "Simulated Graph")

power law sim



robertness/lucy documentation built on May 27, 2019, 10:32 a.m.