Transitive Closure - R

Download the Transitive Closure R Script.

Data Section

# Get the data in
setwd("/abc/code/R/Tools")
Zad<-read.csv("ipcv.csv",header=FALSE,sep=",",as.is=TRUE)
Zad<-as.matrix(Zad)
print(Zad)

setwd the folder with the data files.

read.csv the Comma Seperated Value (CSV) text file containing the data.

Example: ipcv.csv

0.2,1.0,0.4
0.0,0.6,0.3
0.0,1.0,0.3

Transitive Closure

# find the transitive closure
# standard Tnorm is min
# standard Snorm is max
R<-Zad
TC= TranClos(R,max,pmin,0.001)
print(TC)

 

TC the transitive closure of R using: