Learn R Programming

MXM (version 0.9.3)

Transitive closure of an adjacency matrix: Returns the transitive closure of an adjacency matrix

Description

Returns the transitive closure of an adjacency matrix.

Usage

transitiveClosure(amat)

Arguments

amat
The adjacency matrix of a graph.

Value

closure
The transititve closure of the adjacency matrix representing a graph.

Details

A function that computes the transitive closure of a graph. The transitive closure C(G) of a graph is a graph which contains an edge between nodes u and v whenever there is a directed path from u to v (Skiena 1990, p. 203). http://mathworld.wolfram.com/TransitiveClosure.html

References

Skiena S. (1990). Implementing Discrete Mathematics: Combinatorics and Graph Theory with Mathematica. Reading, MA: Addison-Wesley

Examples

Run this code
# example adjacency matrix
# simulate a dataset with continuous data
dataset <- matrix( runif(1000 * 10, 1, 100), nrow = 1000 ) 
test <- pc.con( dataset, method = "pearson", alpha = 0.05 )$G 
transitiveClosure(test)

Run the code above in your browser using DataLab