Skip to contents

Randomly generates a valid directed acyclic graph (DAG) topology \(T\) and assigns a corresponding Boolean transition function \(F\) to each node. The algorithm samples parent set configurations, keeping the constraint that the maximum in-degree for any node is 2, and further ensures the resulting structure does not contain directed cyclic loops.

Usage

GenerateNetwork(num.node)

Arguments

num.node

An integer representing the total number of genes/nodes in the network.

Value

A square transition function matrix combining the initial DAG topology with randomly assigned Boolean logic functions. Elements with a value of 0 indicate no directed edge, while positive integers indicate the presence of an edge and specify the defining Boolean function type (codes 1-12: 1-10 for two-input functions, 11-12 for one-input identity/negation functions).

Examples

# Generate a true network topology and Boolean rules for 5 nodes
set.seed(123)
true_network <- GenerateNetwork(num.node = 5)

# Graph the network with built-in exported function plot_network
plot_network(true_network)