| rel_reduction_hasse | R Documentation |
This function computes the reflexive reduction and a kind of transitive reduction which is useful for drawing Hasse diagrams.
rel_reduction_hasse(R)
R |
an object coercible to a 0-1 (logical) square matrix, representing a binary relation on a finite set. |
The input matrix R might not necessarily be acyclic/asymmetric, i.e.,
it may represent any totally preordered set (which induces an equivalence
relation on the underlying preordered set).
The implemented algorithm runs in O(n^3) time
and first determines the transitive closure of R.
If an irreflexive R is given, then the transitive closures
of R and of the resulting matrix are identical.
Moreover, if R is additionally acyclic, then this function
is equivalent to rel_reduction_transitive.
The rel_reduction_hasse function
returns a logical square matrix. dimnames
of R are preserved.
Other binary_relations:
check_comonotonicity(),
pord_nd(),
pord_spread(),
pord_weakdom(),
rel_graph(),
rel_is_antisymmetric(),
rel_is_asymmetric(),
rel_is_cyclic(),
rel_is_irreflexive(),
rel_is_reflexive(),
rel_is_symmetric(),
rel_is_total(),
rel_is_transitive()
## Not run:
# Let ord be a total preorder (a total and transitive binary relation)
# === Plot the Hasse diagram of ord ===
# === requires the igraph package ===
library("igraph")
hasse <- graph.adjacency(rel_reduction_transitive(ord))
plot(hasse, layout=layout.fruchterman.reingold(hasse, dim=2))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.