Append an equivalence class to a power relation with all coalitions of elements that do not appear in the power relation.

## Arguments

- powerRelation
A

`PowerRelation`

object created by`PowerRelation()`

or`as.PowerRelation()`

- includeEmptySet
If

`TRUE`

, include the empty set in the last equivalence class if it is missing from the power relation.

## Value

`PowerRelation`

object containing the following values:

`$elements`

: vector of elements`$eqs`

: equivalence classes. Nested list of lists, each containing vectors representing groups of elements in the same equivalence class`$coalitionLookup`

:`function(v)`

taking a coalition vector`v`

and returning the equivalence class it belongs to. See`coalitionLookup()`

for more.`$elementLookup`

:`function(e)`

taking an element`e`

and returning a list of 2-sized tuples. See`elementLookup()`

for more.

## Details

For a given set of elements \(N = \lbrace 1, ..., n \rbrace\), a `PowerRelation`

object describes a total preorder
of its subsets, or coalitions, \(\mathcal{P} \subseteq 2^N\), where \(2^N\) is the superset of elements.

If \(\mathcal{P} \neq 2^N\), that means that there are some coalitions \(S \in 2^N, S \notin \mathcal{P}\), such that we cannot compare \(S \succsim T\) or \(T \succsim S\) for every \(T \in \mathcal{P}\).

This may be caused by \(2^N\) having too many coalitions to consider. In certain cases, it may be more interesting to only consider the top ranking coalitions and "shoving" all remaining coalitions into the back.

For this use-case, `appendMissingCoalitions()`

takes the set \(2^N \setminus \mathcal{P}\)
and attaches it in form of an equivalence class to the back of the power relation.

I.e., take as an example \(12 \succ 13 \succ (1 \sim 2)\). Here, we have

$$ \begin{aligned} 2^N &= \lbrace 123, 12, 13, 23, 1, 2, 3, \emptyset \rbrace\\ \mathcal{P} &= \lbrace 12, 13, 1, 2 \rbrace\\ 2^N \setminus \mathcal{P} &= \lbrace 123, 23, 3, \emptyset \rbrace . \end{aligned} $$

Adding the missing coalitions to the power relation then gives us \(12 \succ 13 \succ (1 \sim 2) \succ (123 \sim 23 \sim 3 \sim \emptyset)\).

## See also

Other helper functions for transforming power relations:
`makePowerRelationMonotonic()`

## Examples

```
pr <- as.PowerRelation(list(c(1,2), 3))
# 12 > 3
appendMissingCoalitions(pr)
#> 12 > 3 > (123 ~ 13 ~ 23 ~ 1 ~ 2 ~ {})
# 12 > 3 > (123 ~ 13 ~ 23 ~ 1 ~ 2 ~ {})
appendMissingCoalitions(pr, includeEmptySet = FALSE)
#> 12 > 3 > (123 ~ 13 ~ 23 ~ 1 ~ 2)
# 12 > 3 > (123 ~ 13 ~ 23 ~ 1 ~ 2)
```