rel_reduction_hasse {agop} | R Documentation |
Hasse Diagrams
Description
This function computes the reflexive reduction and a kind of transitive reduction which is useful for drawing Hasse diagrams.
Usage
rel_reduction_hasse(R)
Arguments
R |
an object coercible to a 0-1 (logical) square matrix, representing a binary relation on a finite set. |
Details
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
.
Value
The rel_reduction_hasse
function
returns a logical square matrix. dimnames
of R
are preserved.
See Also
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()
Examples
## 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)