
Computes transitive and reflexive reduction of an endorelation.
transitive_reduction(x)
reflexive_reduction(x)
# S3 method for relation
reduction(x, operation = c("transitive", "reflexive"), ...)
an R object inheriting from class relation
,
representing an endorelation.
character string indicating the kind of reduction.
currently not used.
Let
The transitive reduction of
The transitive reduction of an acyclic relation can be obtained
by subtracting from
The transitive reduction of a cyclic relation is the transitive
reduction of the condensation, combined with the component
representation of
The reflexive reduction of
S. Warshall (1962), A theorem on Boolean matrices. Journal of the ACM, 9/1, 11--12. tools:::Rd_expr_doi("10.1145/321105.321107").
J. A. La Poutré and J. van Leeuwen (1988), Maintenance of Transitive Closures and Transitive Reductions of Graphs. Proceedings of the International Workshop of Graph-Theoretic Concepts in Computer Science, Springer, London, 106--120.
relation()
,
reflexive_reduction()
,
transitive_reduction()
,
reduction()
,
relation_condensation()
,
relation_component_representation()
.
R <- as.relation(1 : 5)
relation_incidence(R)
## transitive closure/reduction
RR <- transitive_reduction(R)
relation_incidence(RR)
R == transitive_closure(RR)
## same
require("sets") # closure() and reduction() etc.
R == closure(reduction(R))
## reflexive closure/reduction
RR <- reflexive_reduction(R)
relation_incidence(RR)
R == reflexive_closure(RR)
## same:
R == closure(reduction(R, "reflexive"), "reflexive")
## transitive reduction of a cyclic relation:
## (example from La Poutre and van Leeuwen)
require("sets") # set(), pair() etc.
if(require("Rgraphviz")) {
G <- set(pair(1L, 2L), pair(2L, 1L), pair(1L, 3L), pair(3L, 1L),
pair(3L, 7L), pair(2L, 5L), pair(2L, 6L), pair(6L, 5L),
pair(5L, 7L), pair(4L, 6L), pair(5L, 4L), pair(4L, 7L))
R <- endorelation(graph = G)
plot(relation_ensemble(R, R), type = c("raw", "simplified"), main =
c("original graph", "transitive reduction"))
}
Run the code above in your browser using DataLab