apply.po.ranking: Apply Pre-Order Ranking (partial-order analysis)

View source: R/REGIME.R

apply.po.rankingR Documentation

Apply Pre-Order Ranking (partial-order analysis)

Description

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.

Usage

apply.po.ranking(partial.order.str)

Arguments

partial.order.str

An n x n character matrix containing pairwise relations. The main relation codes are:

  • "P+": The row alternative strictly dominates the column alternative.

  • "I": The two alternatives are indifferent.

  • "R", "-", or other placeholders can appear but are less critical here.

Details

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

Value

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.

Examples

# 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)



RMCDA documentation built on June 8, 2025, 11:14 a.m.