myerson: Myerson value

View source: R/myerson.R

myersonR Documentation

Myerson value

Description

Calculate the Myerson value in a communication game.

Usage

myerson(
  characteristic_func,
  graph_edges,
  n_players = 0,
  method = "exact",
  n_rep = 1000,
  echo = TRUE
)

Arguments

characteristic_func

The characteristic function of the game. It can be a numeric vector with the value of every coalition, in the order given by coalitions: of length 2^n - 1, without the empty coalition (whose value is taken as 0), or of length 2^n, with the empty coalition first. Vectors support up to 30 players. It can also be a function that receives a coalition (a vector of players) and returns its value; in that case there is no limit on the number of players.

graph_edges

Edges of the communication graph of the game: a list of pairs of players (for example list(c(1, 2), c(2, 3))), or a two-column matrix or data frame. Each edge must join two different players.

n_players

Only used if characteristic_func is a function. The number of players in the game.

method

Method used to calculate the Myerson value. Valid methods are: exact for the exact calculation or appro for approximated polynomial calculation, applying to the communication game the sampling procedure of the Shapley value proposed by Castro et al. (2009).

n_rep

Only used if method is appro. The number of iterations to perform in the approximated calculation.

echo

Only used if method is appro. Show progress of the approximated calculation.

Value

The Myerson value for each player.

References

Myerson, R. B. (1977). Graphs and Cooperation in Games. Mathematics of Operations Research, 2(3), 225–229. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1287/moor.2.3.225")}

Castro, J., Gómez, D., & Tejada, J. (2009). Polynomial calculation of the Shapley value based on sampling. Computers & operations research, 36(5), 1726-1730.

Examples

characteristic_func <- c(
1, 2, 0, 3,
3, 1, 4, 2, 5, 3,
3, 6, 4, 5,
15
)
graph_edges <- list(c(1, 2), c(2, 4))
myerson(characteristic_func, graph_edges, method = "exact")
myerson(characteristic_func, graph_edges, method = "appro", n_rep = 1000)

v <- function(S) {
  if (length(S) == 2) {
    return(1)
   }
   return(0)
}
n <- 3
graph_edges <- list(c(1, 2))
myerson(v, graph_edges, n_players = n, method = "exact")
myerson(v, graph_edges, n_players = n, method = "appro", n_rep = 2000)


TUvalues documentation built on Nov. 8, 2026, 1:19 a.m.