Check whether a directed graph is acyclic: Check whether a directed graph is acyclic
Description
Check whether a directed graph is acyclic.
Usage
is.dag(dag)
Value
A logical value, TRUE if the matrix represents a DAG and FALSE otherwise.
Arguments
dag
A square matrix representing a directed graph which contains either 0 or 1, where G[i, j] = 1, means there is an arrow from node i to node j.
Author
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Details
The topological sort is performed. If it cannot be performed, NAs are returned. Hence, the functions checks for NAs.
References
Chickering D.M. (1995). A transformational characterization of equivalent Bayesian network structures.
Proceedings of the 11th Conference on Uncertainty in Artificial Intelligence, Montreal, Canada, 87--98.