Check whether a directed graph is acyclic | R Documentation |
Check whether a directed graph is acyclic.
is.dag(dag)
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. |
The topological sort is performed. If it cannot be performed, NAs are returned. Hence, the functions checks for NAs.
A logical value, TRUE if the matrix represents a DAG and FALSE otherwise.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
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.
pchc, fedhc, mmhc
G <- pchc::rbn3(100, 20, 0.3)$G
pchc::is.dag(G) ## TRUE
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.