transClos function

Transitive closure of a graph

Transitive closure of a graph

Computes the transitive closure of a graph (undirected or directed acyclic).

transClos(amat)

Arguments

  • amat: a Boolean matrix with dimnames representing the adjacency matrix of a graph.

Details

The transitive closure of a directed graph with adjacency matrix AA is a graph with adjacency matrix AA^* such that Ai,j=1A^*_{i,j} = 1

if there is a directed path from ii to jj. The transitive closure of an undirected graph is defined similarly (by substituting path to directed path).

Returns

  • A: The adjacency matrix of the transitive closure.

Author(s)

Giovanni M. Marchetti

See Also

DAG, UG

Examples

## Closure of a DAG d <- DAG(y ~ x, x ~ z) transClos(d) ## Closure of an UG g <- UG(~ x*y*z+z*u+u*v) transClos(g)