is.acyclic {ggm}R Documentation

Graph queries

Description

Checks if a given graph is acyclic.

Usage

is.acyclic(A)

Arguments

A a square Boolean matrix with dimnames, the edge matrix of a graph.

Value

a logical value, TRUE if the graph is acyclic and FALSE otherwise.

Author(s)

Giovanni M. Marchetti

References

Aho, A.V., Hopcrtoft, J.E. & Ullman, J.D. (1983). Data structures and algorithms. Reading: Addison-Wesley.

See Also

ancGraph

Examples

## Force a cyclic graph
d <- DAG(y ~ x, x ~ z, z~ y, test=FALSE)
## Test acyclicity
is.acyclic(d)

[Package Contents]