Learn R Programming

poseticDataAnalysis (version 1.0.0)

TransitiveClosure: Computing transitive closure.

Description

Computes the transitive closure of the input binary relation.

Usage

TransitiveClosure(rel)

Value

A transitive binary relation, as a two-columns character matrix (each row comprises an element (pair) of the transitivity closed relation).

Arguments

rel

A two-columns character matrix, each row comprising an element (pair) of the binary relation.

Examples

Run this code
rel <- matrix(c(
  "a", "b",
  "c", "b",
  "d", "a",
  "c", "a",
  "a", "a",
  "b", "b",
  "c", "c",
  "d", "d"
), ncol = 2, byrow = TRUE)

t.clo<-TransitiveClosure(rel)

Run the code above in your browser using DataLab