Learn R Programming

catnet (version 1.16.1)

isDAG: Check Direct Acyclic Graph (DAG) Condition

Description

For a pair of node and parent lists, the function checks whether the DAG condition holds or not.

Usage

isDAG(lnodes, lpars)

Value

A logical TRUE/FALSE value.

Arguments

lnodes

a list of nodes

lpars

a list of node parents

Author

N. Balov

Details

The DAG verification algorithm is based on the topological ordering of the graph nodes. If node ordering is not possible, the graph is not a DAG.

Examples

Run this code
  cnet <- cnRandomCatnet(numnodes=20, maxParents=3, numCategories=2)
  isDAG(lnodes=cnet@nodes, lpars=cnet@parents)

Run the code above in your browser using DataLab