apply.po.ranking | R Documentation |
This function is an R translation of the Python po.ranking() function It merges alternatives that are 'I' (indifferent), constructs a 0/1 partial-order matrix from 'P+' entries, sorts the alternatives by row sums, and then removes transitive edges.
apply.po.ranking(partial.order.str)
partial.order.str |
An n x n character matrix containing pairwise relations. The main relation codes are:
|
The function is an R implementation of the pre-order rank and regime function in the pyDecision package Source: https://github.com/Valdecy/pyDecision/blob/master/pyDecision/algorithm/regime.py
A list with elements:
partial.order.str: An updated partial.order.str after merges. Dimensions may be smaller than the input.
partial.order.mat: An n' x n' numeric matrix of 0/1, where 1 indicates 'P+'.
alts: A character vector of alternative labels, possibly merged (e.g., "a2; a1").
alts_rank: The final ordering of alternatives from most dominating to least dominating.
rank: A 0/1 matrix after removing transitive edges.
# Create a small 3x3 partial-order matrix
po_str <- matrix(c("P+", "P+", "R",
"R", "-", "I",
"R", "I", "-"), nrow=3, byrow=TRUE)
# Apply the pre-order ranking
res <- apply.po.ranking(po_str)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.