V <- LETTERS[1:3]
edL <- list(A=list(edges=c("B","C")),B=list(edges="C"),C=list(edges=NULL))
gc <- new("graphNEL",nodes=V,edgeL=edL,edgemode="directed")
g <- transitive.reduction(gc)
if(require(Rgraphviz)){
par(mfrow=c(1,2))
plot(gc,main="shortcut A->C")
plot(as(g,"graphNEL"),main="shortcut removed")
}
Run the code above in your browser using DataLab