tucoopy.transforms.communication¶
Communication constraints and restricted games.¶
This module currently provides the Myerson restriction induced by a communication graph. It constructs a new TU game where a coalition's worth is the sum of the worths of its connected components in the communication graph.
myerson_restriction ¶
myerson_restriction(
game, *, edges, require_complete=True, max_players=16
)
Compute the Myerson restriction of a TU game induced by a communication graph.
In cooperative games with communication constraints, players can only cooperate effectively within connected components of the communication graph. Given an undirected graph \(G=(N,E)\) and a coalition \(S \subseteq N\), let \(\{C_1, \dots, C_k\}\) be the connected components of the subgraph induced by \(S\). The Myerson restricted game \(v_G\) is defined by:
with the TU convention \(v_G(\varnothing)=0\).
Intuition: A coalition \(S\) can only realize the value of the groups that can actually communicate (the connected components). The total value is the sum of the values generated by each communicating group.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
game | Game | Original TU game \(v\) on the player set \(N\). | required |
edges | Iterable[tuple[int, int]] | Undirected edges of the communication graph \(G\) as pairs of player indices. Self-loops are ignored. Duplicate edges are allowed. | required |
require_complete | bool | If True, require | True |
max_players | int | Safety limit for the number of players. This routine enumerates all coalitions and is therefore exponential in | 16 |
Returns:
| Type | Description |
|---|---|
Game | A new complete TU game with characteristic function \(v_G\). |
Raises:
| Type | Description |
|---|---|
NotSupportedError | If |
InvalidGameError | If |
InvalidParameterError | If any edge endpoint is out of range. |
Notes
- Complexity: This function enumerates all coalitions, so its runtime and memory scale as \(\Theta(2^n)\). Use
max_playersas a guardrail. - The resulting game is complete: it explicitly stores values for every coalition.
- This function implements the restricted game used to define the Myerson value (the Shapley value of \(v_G\)) in communication situations.
Examples:
Restrict a 3-player game with a path graph 0--1--2:
>>> gG = myerson_restriction(g, edges=[(0, 1), (1, 2)])
>>> gG.value(0) # empty coalition
0.0
If players 0 and 2 cannot communicate directly (only through 1), then coalition {0,2} has two singleton components:
>>> from tucoopy.base.coalition import mask_from_players
>>> S = mask_from_players([0, 2])
>>> gG.value(S) == g.value(mask_from_players([0])) + g.value(mask_from_players([2]))
True