Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

is.dag

Check whether a directed graph is acyclic


Description

Check whether a directed graph is acyclic.

Usage

is.dag(dag)

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.

Details

The topological sort is performed. If it cannot be performed, NAs are returned. Hence, the functions checks for NAs.

Value

A logical value, TRUE if the matrix represents a DAG and FALSE otherwise.

Author(s)

Michail Tsagris.

R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.

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.

See Also

Examples

G <- pchc::rbn3(100, 20, 0.3)$G
pchc::is.dag(G)  ## TRUE

pchc

Bayesian Network Learning with the PCHC and Related Algorithms

v0.5
GPL (>= 2)
Authors
Michail Tsagris [aut, cre]
Initial release
2021-03-21

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.