Pular para conteúdo

tucoopy.solutions.myerson

Myerson value (communication graph).

This module computes the Myerson value by applying the Myerson restriction induced by a communication graph and then computing the Shapley value of the restricted game.

MyersonResult dataclass

Result container for the Myerson value.

Attributes:

Name Type Description
x list[float]

Allocation vector (length n_players).

meta dict[str, object]

Diagnostic metadata about the computation parameters.

myerson_value

myerson_value(
    game, *, edges, max_players=16, require_complete=True
)

Compute the Myerson value for a TU game with communication constraints.

In cooperative games with restricted communication, players can only cooperate effectively within connected components of a communication graph. Given an undirected graph \(G\), define the Myerson restricted game:

\[ v_G(S) = \sum_{C \in \mathrm{components}_G(S)} v(C). \]

The Myerson value is then defined as the Shapley value of this restricted game:

\[ \phi^{\text{Myerson}}(v, G) = \phi(v_G). \]

Parameters:

Name Type Description Default
game GameProtocol

TU game.

required
edges Iterable[tuple[int, int]]

Undirected edges of the communication graph.

required
max_players int

Safety bound. The computation is exponential in n_players.

16
require_complete bool

If True, require the original game to be complete.

True

Returns:

Type Description
MyersonResult

Allocation vector and metadata.

Raises:

Type Description
NotSupportedError

If the number of players exceeds max_players.

InvalidGameError

If require_complete=True and the game is incomplete.

InvalidParameterError

If the communication graph edges is invalid (e.g. out-of-range endpoints).

Notes
  • If the graph is complete (all players connected), the Myerson value reduces to the Shapley value.
  • If the graph has no edges, each player acts alone and the value reduces to the singleton payoffs.
  • The Myerson value models cooperation under communication constraints and is a fundamental concept in network games.

Examples:

>>> res = myerson_value(g, edges=[(0,1), (1,2)])
>>> res.x