get_hasse_diag: Adjacency List of Hasse diagram

View source: R/visualize.r

get_hasse_diagR Documentation

Adjacency List of Hasse diagram

Description

Returns the adjacency list of the Hasse diagram of a preference as an (n x 2) matrix. This is the transitive reduction of the preference relation.

Usage

get_hasse_diag(df, pref)

Arguments

df

A data frame.

pref

A preference on the columns of df, see psel for details.

Details

A row (i, j) in the resulting matrix means that df[i,] is better than df[j,] with regard to the preference p. The matrix is the transitive reduction (Hasse diagram) of the induced relations, i.e., if (1,2) and (2,3) occur in the result, then (1,3) will not be contained. The number of rows in the result depends on the number of non-transitive Better-Than-Relationships in df w.r.t. p.

See Also

get_btg to plot the Hasse diagram.

Examples


get_hasse_diag(mtcars, low(mpg))


patrickroocks/rpref documentation built on Feb. 6, 2023, 1:39 p.m.