generate_random_graph: Generate a Random Symmetric Adjacency Matrix

View source: R/generate_random_graph.R

generate_random_graphR Documentation

Generate a Random Symmetric Adjacency Matrix

Description

This function generates a random symmetric adjacency matrix representing a brain network. The adjacency matrix is binary, with edges present based on a specified probability.

Usage

generate_random_graph(n_nodes, edge_prob = 0.1)

Arguments

n_nodes

An integer specifying the number of nodes (brain regions).

edge_prob

A numeric value between 0 and 1 specifying the probability of an edge existing between any two nodes.

Value

A symmetric binary adjacency matrix with no self-loops.

Examples

G <- generate_random_graph(n_nodes = 10, edge_prob = 0.1)

BrainNetTest documentation built on Dec. 3, 2026, 5:08 p.m.