Create a PowerRelation object based on coalition parameters separated by ">" or "~".

## Usage

newPowerRelation(
...,
rankingCoalitions = list(),
rankingComparators = c(),
equivalenceClasses = list()
)

## Arguments

...

Coalition vector, comparison character (">" or "~"), coalition vector, comparison character, coalition vector, ...

rankingCoalitions

as well as an ordered list of equivalence classes $equivalenceClasses for convenience ## Details A power relation describes the ordinal information between coalitions. createPowerset() offers a convenient way of creating a powerset over a set of elements that can be used to call the newPowerRelation() function. Each coalition in that case is put on a separate line (see example). In RStudio this allows us to easily rearrange the coalitions using the Alt+Up or Alt+Down shortcut (Option+Up or Option+Down on MacOS). A coalition is a vector or a sets::set(). Every vector is turned into a sets::set(). ## Mathematical background Let $$N = \lbrace 1, ..., n \rbrace$$ be a finite set of elements (sometimes also called players). $$2^N$$ describes the powerset of $$N$$, or the set of all subsets, also coalitions. Let $$\mathcal{P} \subseteq 2^N$$ be a collection of coalitions. A power relation on $$\mathcal{P}$$ is a total preorder $$\succeq \subseteq \mathcal{P} \times \mathcal{P}$$. With that, $$\mathcal{T}(\mathcal{P})$$ denotes the family of all power relations on every collection $$\mathcal{P} \subseteq 2^N$$. Given a power relation $$\succeq \in \mathcal{T}(\mathcal{P})$$, $$\sim$$ denotes its symmetric part whereas $$\succ$$ its asymmetric part. For example, let $$S, T \in \mathcal{P}$$. Then: $S \sim T \textrm{ if } S \succeq T \textrm{ and } T \succeq S$ $S \succ T \textrm{ if } S \succeq T \textrm{ and not } T \succeq S$ ## References Moretti S, Öztürk M (2017). “Some axiomatic and algorithmic perspectives on the social ranking problem.” In International Conference on Algorithmic Decision Theory, 166--181. Springer. Bernardi G, Lucchetti R, Moretti S (2019). “Ranking objects from a preference relation over their subsets.” Social Choice and Welfare, 52(4), 589--606. ## See also Other newPowerRelation functions: newPowerRelationFromString() ## Examples if(interactive()) createPowerset(1:3, copyToClipboard = TRUE) # pasted clipboard and rearranged lines using # Alt + Up, and # Alt + Down shortcut in RStudio pr <- newPowerRelation( c(1,2), ">", c(1,2,3), ">", c(1,3), "~", c(2), ">", c(1), "~", c(2,3), "~", c(3), ) # Elements: 1 2 3 # 12 > 123 > (13 ~ 2) > (1 ~ 23 ~ 3) print(pr) #> Elements: 1 2 3 #> 12 > 123 > (13 ~ 2) > (1 ~ 23 ~ 3) # {1, 2, 3} pr$elements
#> [1] 1 2 3

# {1, 2}, {1, 2, 3}, {1, 3}, {2}, {1}, {2, 3}, {3}
pr$rankingCoalitions #> [[1]] #> {1, 2} #> #> [[2]] #> {1, 2, 3} #> #> [[3]] #> {1, 3} #> #> [[4]] #> {2} #> #> [[5]] #> {1} #> #> [[6]] #> {2, 3} #> #> [[7]] #> {3} #> # ">" ">" "~" ">" ">" ">" pr$rankingComparators
#> [1] ">" ">" "~" ">" "~" "~"

# {{1, 2}}, {{1, 2, 3}}, {{1, 3}, {2}}, {{1}, {2, 3}, {3}}
pr$equivalenceClasses #> [[1]] #> [[1]][[1]] #> {1, 2} #> #> #> [[2]] #> [[2]][[1]] #> {1, 2, 3} #> #> #> [[3]] #> [[3]][[1]] #> {1, 3} #> #> [[3]][[2]] #> {2} #> #> #> [[4]] #> [[4]][[1]] #> {1} #> #> [[4]][[2]] #> {2, 3} #> #> [[4]][[3]] #> {3} #> #> # not all coalitions of a powerset have to be present newPowerRelation(c(1,2), ">", c(1)) #> Elements: 1 2 #> 12 > 1 # cycles produce a warning (but no errors) newPowerRelation(c(1,2), ">", c(1), ">", c(1,2)) #> Warning: Found the following duplicate. Did you mean to introduce cycles? #> {1, 2} #> Elements: 1 2 #> 12 > 1 > 12 # use createPowerset directly # 123 > 12 > 13 > 23 > 1 > 2 > 3 > {} newPowerRelation(rankingCoalitions = createPowerset(1:3)) #> Elements: 1 2 3 #> 123 > 12 > 13 > 23 > 1 > 2 > 3 > {} # 123 > (12 ~ 13) > (23 ~ 1) > (2 ~ 3) > {} newPowerRelation(rankingCoalitions = createPowerset(1:3), rankingComparators = c(">", "~")) #> Elements: 1 2 3 #> 123 > (12 ~ 13) > (23 ~ 1) > (2 ~ 3) > {} # using equivalenceClasses parameter # (12 ~ 13 ~ 123) > (1 ~ 3 ~ {}) > (2 ~ 23) pr <- newPowerRelation(equivalenceClasses = list( list(c(1,2), c(1,3), c(1,2,3)), list(1, 3, c()), list(2, c(2,3)) )) # and manipulating the order of the equivalence classes # (1 ~ 3 ~ {}) > (2 ~ 23) > (12 ~ 13 ~ 123) newPowerRelation(equivalenceClasses = pr$equivalenceClasses[c(2,3,1)])
#> Elements: 1 2 3
#> (1 ~ 3 ~ {}) > (2 ~ 23) > (12 ~ 13 ~ 123)

# It's discouraged to directly change the ordering of a power relation inside a
# PowerRelation object. Instead extract rankingCoalitions, rearrange the list
# and pass it to newPowerRelation
newOrdering <- rev(pr$rankingCoalitions) # 3 > 23 > (1 ~ 2) > (13 ~ 123 ~ 12) newPowerRelation(rankingCoalitions = newOrdering, rankingComparators = pr$rankingComparators)
#> Elements: 1 2 3
#> (23 ~ 2 ~ {}) > (3 ~ 1 ~ 123) > (13 ~ 12)

# 3 > 23 > 1 > 2 > 13 > 123 > 12
newPowerRelation(rankingCoalitions = newOrdering)
#> Elements: 1 2 3
#> 23 > 2 > {} > 3 > 1 > 123 > 13 > 12