Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

rel_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.

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

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)

agop

Aggregation Operators and Preordered Sets

v0.2-3
LGPL (>= 3)
Authors
Marek Gagolewski [aut, cre] (<https://orcid.org/0000-0003-0637-6028>), Anna Cena [ctb] (<https://orcid.org/0000-0001-8697-5383>)
Initial release
2020-01-06

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.