agop (version 0.2-2)

rel_reduction_hasse: 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.

Value

The rel_reduction_hasse function returns a logical square matrix. dimnames of R are preserved.

Details

The input matrix \(R\) might not necessarily be acyclic/assymetric, i.e., it can represent any totally preordered set (which induces an equivalence relation on the underlying preordered set). The algorithm implemented 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.

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

Run this code
# 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))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab