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

transClos

Transitive closure of a graph


Description

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

Usage

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 A is a graph with adjacency matrix A^* such that A^*_{i,j} = 1 if there is a directed path from i to j. The transitive closure of an undirected graph is defined similarly (by substituting path to directed path).

Value

A

The adjacency matrix of the transitive closure.

Author(s)

Giovanni M. Marchetti

See Also

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)

ggm

Graphical Markov Models with Mixed Graphs

v2.5
GPL-2
Authors
Giovanni M. Marchetti, Mathias Drton, Kayvan Sadeghi
Initial release
2020-02-014

We don't support your browser anymore

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