Learn R Programming

ggm (version 0.5)

is.acyclic: 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.

References

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

See Also

ancGraph

Examples

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

Run the code above in your browser using DataLab