get_neighboringDAGs {BCDAG}R Documentation

Enumerate all neighbors of a DAG

Description

This functions takes any DAG with q nodes as input and returns all the neighboring DAGs, i.e. all those DAGs that can be reached by the addition, removal or reversal of an edge.

Usage

get_neighboringDAGs(DAG)

Arguments

DAG

Adjacency matrix of a DAG

Value

The (q,q,K) array containing all neighboring DAGs, with K being the total number of neighbors

Examples

# Randomly generate a DAG
q <- 4; w <- 0.2
set.seed(123)
DAG <- rDAG(q,w)
# Get neighbors
neighbors <- get_neighboringDAGs(DAG)
neighbors

[Package BCDAG version 1.1.1 Index]