Algorithmic Game Theory · Lecture Notes
Chapter 10: Multi-Agent Systems
In a warehouse, hundreds of robots pick orders; in a search-and-rescue team, drones divide up regions; in a smart grid, households buy and sell energy. In each of these systems there are several decision makers, each with its own information and its own goal. We call such decision makers agents and the system as a whole a multi-agent system. Because agents are affected by one another's decisions, the interaction among them is a game. Starting from the notion of an agent, these notes cover cooperation and coordination problems, task allocation with the contract net, coalitional games (the Shapley value, the core, power indices), and free riding in the public goods game. For every topic a numerical example is worked through with all intermediate steps.
Learning outcomes
- Agents and MAS
- Explain the basic properties of an agent and the problems of cooperation, competition, and coordination in multi-agent systems.
- Task allocation
- Run the contract net protocol (announcement, bid, award) on a small example and compare its result with the optimum.
- Coalitional games
- Write down a characteristic function; compute the Shapley value from marginal contributions over all orderings; test whether an allocation is in the core; find the power index in weighted voting.
- Public goods and free riding
- Show numerically why contributing nothing is a dominant strategy in the public goods game, and recognize its counterparts in multi-agent systems.
10.1Agents and multi-agent systems
In the earlier chapters the players were mostly people: buyers bidding in an auction, voters casting ballots, users shopping in a marketplace. In this chapter a large share of the players are software: robots, drones, autonomous vehicles, trading programs. We call such software agents. Agents do not think like humans, but like humans they pursue their own goals and are affected by the decisions of other agents. For this reason the tools of game theory apply to them directly.
10.1.1A warm-up game: the Shapley coalition game
Three players, A, B, and C, will work together to produce some value. Each player can produce a certain value alone. When two players work together, a synergy bonus arises on top of the sum of their stand-alone values. The rule of the game is this: the value of a coalition (a group working together) is the sum of its members' stand-alone values plus the synergy bonus of every pair inside the coalition. Finally, the value of the coalition of all three players, v(N), is divided among the players.
Figure 10.1 shows a sample round. The stand-alone values add up to 6 + 4 + 5 = 15 and the synergies to 4 + 2 + 0 = 6. Working all together, the players produce v(ABC) = 15 + 6 = 21 units. The game poses two questions:
- If the 21 units are split equally, everyone gets 7. Is A treated unfairly by this split?
- Should the most valuable player alone always receive the largest share?
An equal split looks fair at first glance. But A is both the most valuable player alone (6) and a partner in two synergies (4 and 2). B contributes to only one synergy (4), and C to only one (2). For a split to count as "fair" we need a rule that measures each player's contribution. That rule is the Shapley value, defined in 10.4.5. The answer to the game is computed in 10.4.8: A's Shapley share is 9, so the equal split gives A 2 units less than A's contribution warrants. The answer to the second question is also "no" in general. What determines the split is not the stand-alone value but the average of the value a player adds to all possible groups.
This game combines the two big themes of the chapter. The first is that agents working together produce value that none could produce alone (cooperation). The second is how that value is divided among the agents (sharing). If the division is done badly, some agents want to leave the group and the cooperation falls apart. The rest of the chapter builds on these two themes.
10.1.2What is a multi-agent system?
A multi-agent system (MAS) is a system made up of several autonomous agents that perceive, decide, and act in the same environment. Each agent observes the environment with its own sensors, makes its own decisions, and changes the environment through its own actions. The agents may share a common goal, or each agent may compete with the others for its own interest.
Three parts of the definition matter. The first is "several": the problem of a single agent is a decision problem, while the problem of several agents is a game. The second is "autonomous": agents make their decisions themselves rather than taking orders from a center. The third is "the same environment": an agent's action changes the environment, and this change affects the other agents' perceptions and payoffs.
Figure 10.2 summarizes this structure. Each agent has a two-way link to the environment: perception and action. Agents can also exchange messages with one another. No agent in the figure sees the whole environment. Every agent's information is local. A warehouse robot sees only the shelves around it. A drone scans only the region it flies over. An autonomous vehicle senses only the vehicles near it. For this reason two design problems always arise in multi-agent systems:
- Coordination: the agents' decisions must be compatible with one another. Two robots must not go to the same shelf, and two drones must not scan the same region.
- Communication: agents fill in their missing information with messages. But messaging has a cost (time, energy, bandwidth), and messages can be delayed or lost.
Typical examples of multi-agent systems are robot teams, autonomous vehicle fleets, distributed sensor networks, and traffic or economic simulations. In all of them the number of agents is large, information is scattered, and having a single center compute everything is either impossible or too expensive.
The connection to game theory. If agents are affected by one another's decisions, the interaction among them is a game. The four elements of a game map directly onto a multi-agent system: the players are the agents, the strategies are the agents' action choices, the payoffs are the utility functions that measure the agents' goals, and the information structure is who observes what. The person who designs the agents takes on two roles. They program the agents' insides (the decision rule), but they also determine the rules the agents face (who gets what, who pays what). The second role is that of the mechanism designer, who sets the rules. Mechanism design means building the rules of the game so that players, pursuing their own interests, choose the desired outcome.
10.1.3The agent concept and its four properties
In everyday language an "agent" is someone who acts on another's behalf. In artificial intelligence, an agent is a piece of software or a machine that acts on its own in an environment. Wooldridge and Jennings (1995) gather the most basic properties a system needs in order to count as an agent into four items. This is called the weak notion of agency; "weak" indicates that the definition does not include human-like aspects of the agent such as consciousness or intention, and only describes its observable behavior.
An agent is a computer system with the following four properties:
- Autonomy: it makes its own decisions without human intervention and manages its own internal state.
- Reactivity: it perceives changes in the environment and responds to them in a timely way.
- Pro-activeness: it does not merely respond; it takes the initiative and plans in order to reach its goal.
- Social ability: it communicates, negotiates, and cooperates with other agents.
The four properties are easiest to see on a single agent. Consider a search-and-rescue drone. Table 10.1 matches each property with one behavior of this drone.
| Property | Meaning | Drone example |
|---|---|---|
| Autonomy | Makes its own decisions | Chooses its own route |
| Reactivity | Responds to change in time | Brakes when it sees an obstacle |
| Pro-activeness | Takes initiative toward a goal | Heads to the station before its battery runs out |
| Social ability | Interacts with other agents | Bids for a task |
The difference between reactivity and pro-activeness is subtle but important. Reactive behavior is triggered by an event: an obstacle appears and the drone brakes. Without the event there would be no behavior. Pro-active behavior is triggered by a goal: the drone computes that its charge will not last for the rest of the route and heads for the station before any warning has appeared. A pro-active agent anticipates the future; a reactive agent answers the present. A good agent balances the two. A purely reactive agent misses long-term goals. A purely pro-active agent may stick to its plan so firmly that it cannot respond in time to an unexpected obstacle.
Social ability is the property that separates a multi-agent system from a single-agent one. Agents without social ability affect one another only through the environment, even when they share it. Socially able agents exchange messages, make bids, and strike agreements. Task allocation (10.3) and coalition formation (10.4) rest on this ability.
The agent in game theory. Game theory models one aspect of an agent in detail: its decision. In game theory an agent is a rational player. Its preferences are expressed by a utility function, and the agent tries to maximize its expected utility. Here "expected" refers to the case where the outcome is uncertain: the utility of each possible outcome is weighted by its probability and summed. For example, a drone prefers a route that yields a utility of 10 or 4 with equal probability over a route that yields a sure 6, because the expected utility of the first route is 0.5 · 10 + 0.5 · 4 = 7.
10.1.4How does an agent decide? Architectures
The four properties describe what an agent does. How the agent reaches its decision is determined by its agent architecture. The architecture is the internal path from perception to action. Table 10.2 compares five common architectures.
| Architecture | Decision mechanism | Strength | Example |
|---|---|---|---|
| Reactive | State → action rules; no internal model | Fast, robust | Robot vacuum, swarm behavior |
| Deliberative | World model + planning / search | Long-term goals | Exploration robot, logistics planner |
| BDI | Belief, desire, intention | Human-like reasoning | Air traffic management, virtual assistant |
| Learning | Learns a policy from experience | Adapts to unknown environments | Game-playing agents |
| Hybrid | Reactive lower layer + deliberative upper layer | Speed and foresight together | Autonomous vehicle |
The reactive architecture is the simplest. Inside the agent is a rule table: "if the way ahead is clear, move forward; if you hit a wall, turn randomly." The agent keeps no model of the environment and computes nothing about the future. For this reason it is very fast and robust to sensor errors. Household robot vacuums come close to this architecture. Swarm behavior is also the product of reactive rules: Reynolds (1987) showed that realistic flocks of birds emerge when each bird follows just three local rules (avoid collisions with neighbors, fly in the same direction as neighbors, move toward the center of the neighbors).
The deliberative architecture keeps a model of the environment and searches over this model to produce a sequence of actions (a plan). An exploration robot stores the map in memory and computes the shortest path to its goal. Planning makes it possible to reach long-term goals, but it is slow. If the environment changes before the plan is finished, the plan may become invalid.
The BDI architecture organizes planning around three notions that resemble human reasoning. Beliefs are what the agent holds to be true about the environment ("runway 3 is free"). Desires are the states the agent would like to reach ("land the aircraft", "save fuel"). Desires can conflict with one another. Intentions are the goals the agent has chosen from among its desires and has committed to achieving ("land the aircraft on runway 3"). Intention keeps the agent from changing its mind at every moment: the agent stays committed to its intention until new information signals an important change.
The learning architecture does not have its rules written in advance; it works out from experience which action gives good results in which situation. The learned rule is a policy: a function that assigns to each state an action (or a probability distribution over actions). This architecture adapts to unknown environments. Game-playing agents mostly work this way.
The hybrid architecture combines layers. The lower layer of an autonomous vehicle is reactive: if a pedestrian suddenly steps in front of it, it brakes without waiting for the planner. Its upper layer is a planner: it computes the route and lane changes ahead of time. In this way speed and foresight are obtained together.
One distinction must be kept in mind: the architecture describes the inside of the agent, whereas game theory studies the interaction between agents. A game-theoretic model does not care whether the agent contains reactive rules or BDI logic. It looks only at which strategies the agent can choose and what it earns from each outcome. In the rest of the chapter, agents are treated at this abstract level, that is, through their strategies and payoffs.
10.1.5Real-world applications
Multi-agent systems are used today in many fields. Each application connects to a game-theoretic question later in the chapter.
- Autonomous vehicles
- Coordination is needed for the crossing order at intersections, lane changes, and convoy driving. If two vehicles try to enter the same lane at the same moment, there is a risk of collision. This is a coordination game (10.2.5).
- Drone teams
- In search and rescue the regions must be shared out: which drone will scan which region? This is a task allocation problem (10.3).
- Warehouse robots
- Hundreds of robots pick orders. Routes must be collision-free, and jobs must be distributed evenly among the robots.
- Online marketplaces
- Buyer and seller agents post price offers and negotiate automatically. This is the territory of auctions and mechanism design.
- Smart grid
- Energy is traded among households, storage units, and producers, and demand is managed. If everyone draws energy at the peak hour, the grid is strained; this is an incentive problem (10.2.6).
- Simulation
- In traffic, epidemic, and economic models, individuals are represented as agents. The simple rules of the individuals can produce unexpected patterns at the system level (10.2.7).
All of these applications ask the same question: when agents with their own goals come together, how do we obtain a good outcome at the system level? What counts as a "good outcome" depends on the context. A short total delivery time in a warehouse, a low total energy cost in a grid, and a fair division of the gain in a coalition are all good outcomes. Game theory separates two questions. The analysis question is where the agents end up when they act in their own interest (the equilibrium). The design question is how the rules should be set up so that the point they reach is a good one (the mechanism).
10.1.6Common mistakes about agents
Confusing pro-activeness with reactivity. The behavior "the drone returns to the station before its battery runs out" is not reactivity but pro-activeness. There is no external event triggering the drone; it acts on its own goal to prevent a problem that will arise later. An example of reactivity is "braking when it sees an obstacle".
Taking a convention to be a property of an agent. A rule such as "everyone drives on the right" (a convention) is not a property of a single agent but a coordination rule shared among agents.
Thinking an agent is only a physical robot. A trading program, a bidding bot, or a virtual assistant is also an agent. Being an agent does not require a body; the four properties are enough.
Mixing up architecture and game theory. Writing an agent with a BDI architecture does not prevent it from being modeled as a rational player. The architecture describes the inside of the agent, and the game model describes what lies between agents.
10.2Cooperation and coordination
How much do the agents' goals overlap? This question determines which problem has to be solved in a multi-agent system. If the goals are exactly the same, the problem is purely one of coordination: everyone wants the same thing, but the decisions have to be made compatible. If the goals are exactly opposed, the problem is one of strategy: each agent tries to predict its opponent's move and to make itself unpredictable. Most real systems lie between these two extremes.
10.2.1Cooperative, competitive, and mixed systems
Multi-agent systems fall into three types according to the relationship among the agents' goals.
- Cooperative MAS
- The agents have a common goal. They share information, tasks, and resources. The central problem is coordination: who does what, and when? Example: a search-and-rescue drone team. Every drone wants to find the missing person; it does not matter which drone finds them.
- Competitive MAS
- The agents have different objectives. Each agent tries to increase its own payoff while taking the others' behavior into account. The central problem is strategy. Example: bidder agents in an auction. An item that one bidder wins is lost by another.
- Mixed-motive MAS
- Some goals are shared, while some resources are contested. Example: households sharing the same electricity grid. All of them want the grid not to collapse (a common goal), but they compete for the limited energy in the cheap hours (competition). Most real systems are of this type.
The question of which structure is more efficient has no single answer. Table 10.3 summarizes the conditions under which each extreme is efficient.
| Structure | Condition under which it is efficient |
|---|---|
| Cooperation | Goals overlap, communication is cheap, and there is work no single agent can do |
| Competition | There is private information that can be revealed through prices or bids (market, auction) |
Cooperation is indispensable for work that no single agent can do, such as drones carrying a heavy load together. The advantage of competition concerns information. If only the agent itself knows its own cost, the center cannot see this information directly. An auction or a tender pushes the agents to reveal it through their bids: the lowest-cost agent submits the lowest bid and gets the job. Competition thus becomes a tool for gathering information. This is exactly what mechanism design does: it sets up rules that steer competition toward a good outcome. Which structure to choose depends on the purpose of the system and on the structure of its resources.
10.2.2The spectrum of interests: three small games
The three types of system can be represented by three small two-player games. Each game is given by a payoff matrix: the rows are Player 1's options, the columns are Player 2's options, and each cell lists (Player 1's payoff, Player 2's payoff). A cell is a Nash equilibrium when both players are at a best response in that cell. That is, with the other side's choice held fixed, neither player can raise their payoff by changing their own choice alone.
Figure 10.3 places the three games on a spectrum running from full cooperation to full competition. Each game stands for one type of problem.
Left: pure coordination. The two players' payoffs are equal in every cell (u1 = u2). Interests are entirely shared. If both choose Right, both get 2; if both choose Left, both get 1; if they choose differently, both get 0. There is no conflict, but there is a problem: if the players do not know which side the other will choose, they may make incompatible choices. The solution is communication or a common rule (a convention, e.g., "everyone keeps right").
Middle: the Prisoner's Dilemma. Interests partly conflict. If both players stay silent, both get −1. If one defects and the other stays silent, the defector gets 0 and the silent one gets −3. If both defect, both get −2. Here the individual incentive runs against the common good, and a solution requires incentive design (10.2.3).
Right: Matching Pennies. Interests are completely opposed: one player's gain is the other's loss (u1 + u2 = 0, a zero-sum game). If the two players choose the same face, Player 1 wins; if they choose different faces, Player 2 wins. What matters here is being unpredictable. The way to achieve it is a mixed strategy: choosing each option with a certain probability, for instance by flipping a coin.
The pure Nash equilibria of the three games are found by checking, in each cell, whether both players are at a best response.
- Pure coordination, (Right, Right) = (2, 2). With Player 2 at Right, if Player 1 switches to Left, Player 1 gets 0; since 2 > 0, Player 1 does not switch. The game is symmetric, so Player 2 does not switch either. This cell is an equilibrium.
- Pure coordination, (Left, Left) = (1, 1). A player who switches to Right gets 0; since 1 > 0, nobody switches. This cell is also an equilibrium, but it is worse for both than (Right, Right).
- Pure coordination, (Right, Left) and (Left, Right). Both get 0; a player who changes sides matches the other and gets 1 or 2. These cells are not equilibria. Conclusion: there are two pure equilibria, and the problem is which one will be played.
- Prisoner's Dilemma. If the other side stays Silent, Defect gives 0 and Silent gives −1: Defect is better. If the other side Defects, Defect gives −2 and Silent gives −3: Defect is again better. Defect is better whatever the other side does. The only equilibrium is (Defect, Defect) = (−2, −2).
- Matching Pennies. At (Heads, Heads), Player 2 gets −1 and gets 1 by switching to Tails. At (Heads, Tails), Player 1 gets −1 and gets 1 by switching to Tails. In each of the four cells, the losing player wants to change their choice. There is no pure equilibrium.
- The mixed equilibrium in Matching Pennies. Let Player 2 play Heads with probability q. Player 1's expected payoff from Heads is q · 1 + (1 − q) · (−1) = 2q − 1, and from Tails it is q · (−1) + (1 − q) · 1 = 1 − 2q. For Player 1 to be indifferent between the two options we need 2q − 1 = 1 − 2q, that is, q = 1/2. By symmetry Player 1 also plays p = 1/2. The equilibrium is (½, ½), and each player's expected payoff is 0.
Example 10.1 exposes three different problems at three points of the spectrum. In the coordination game there are several equilibria, and the problem is selection. In the Prisoner's Dilemma the equilibrium is unique but inefficient. In Matching Pennies there is no pure equilibrium and randomness is required. A person designing a multi-agent system cannot choose the right tool without understanding where on this spectrum the system lies. A coordination problem is solved with a common rule. An incentive problem, in contrast, is not solved by a common rule alone; it needs an arrangement that changes the payoffs.
10.2.3Individual rationality and collective harm
The Prisoner's Dilemma carries the most important warning for multi-agent systems. In this game Defect is a dominant strategy: whatever the other side does, Defect yields the higher payoff. So both rational players choose Defect, and the equilibrium is (−2, −2). Yet (Silent, Silent) would have given both (−1, −1). Each player does the best for themselves, but the result is worse for both. Individual rationality produces a collectively bad outcome.
This situation is expressed through the notion of Pareto optimality. An outcome is Pareto optimal if there is no other outcome that improves at least one person's situation without making anyone worse off. (Defect, Defect) is not Pareto optimal: moving to (Silent, Silent) improves both players. The lesson of the Prisoner's Dilemma is that a Nash equilibrium need not be Pareto optimal.
In multi-agent systems this structure has many counterparts.
- Bandwidth
- When every agent raises its own data rate, its own transfer seems to get faster, but the network congests and becomes slower for everyone.
- Shared resource
- A shared processor, energy supply, or data pool is overused. Each agent puts its own job first, and the common resource is exhausted.
- Information sharing
- Sharing information improves the common model, but withholding it gives the agent a short-term advantage.
The many-player version of this structure is the public goods game, which is examined numerically in 10.5. The exhaustion of a common resource through overuse is called the tragedy of the commons. In both the logic is the same: the individual's gain and the group's gain move in opposite directions.
10.2.4Decision making: centralized or distributed?
Agents plan on the basis of what they know about the environment. Who makes the decision: a single center, or each agent itself? This is the first big decision in designing a multi-agent system. Table 10.4 compares the two options.
| Centralized control | Distributed (full autonomy) | |
|---|---|---|
| Advantage | All information at one point: the optimum can be computed; easy coordination, low risk of conflict | Flexible, scalable, fast response to local events; the system keeps working when one part fails |
| Disadvantage | Single point of failure and bottleneck; computation explodes as the number of agents grows; agents may not report private information honestly | Decisions made on local information may be inconsistent; selfish agents may settle at an inefficient equilibrium (the Price of Anarchy) |
| Example | Traffic-light control center; central server in a sensor network | Drone teams, autonomous vehicles, robotic exploration |
The greatest strength of centralized control is that a center holding all the information can compute the optimum. But it has three weaknesses. The first is the single point of failure: if the center breaks down, the whole system stops. The second is scaling: as the number of agents grows, so do the messages arriving at the center and the problem the center has to solve. For example, trying every way of assigning n agents to n tasks means evaluating n! assignments one by one (10.3.5); this number reaches 3,628,800 at n = 10. The third is honesty: the center depends on the agents to report private information such as costs. A selfish agent may report a high cost in order to get an easier job.
Distributed control removes these weaknesses: if one agent breaks down the others keep working, adding a new agent is easy, and every agent reacts to local events immediately. But it has weaknesses of its own. Decisions made with local information may be inconsistent (10.2.5). Selfish agents may also reach an inefficient equilibrium, as in the Prisoner's Dilemma. The system-level cost of selfish behavior is measured by the ratio of the cost of the worst equilibrium to the cost of the optimum. This ratio is called the Price of Anarchy.
Most real multi-agent systems are hybrid: agents decide autonomously, but a center sets the rules, prices, or tenders. The center does not decide what each agent will do; it only sets the rules of the game. The contract net described in 10.3.2 is an example: a manager puts tasks out to tender, but it does not know the costs and leaves the choice of who does the job to the bids.
10.2.5Distributed coordination and conventions
In distributed coordination, agents decide without a center, using local information and messaging. A protocol that achieves this must handle three things together. Communication delay: by the time a message arrives, the situation may have changed. Fault tolerance: if a message is lost or an agent does not respond, the system must not lock up. Scalability: as the number of agents grows, the number of messages must not get out of control.
The most typical problem of a distributed system is the lack of common knowledge. Suppose two robots meet in a narrow corridor. Each will step to one side to let the other pass. If both step to their own right, their paths separate and they get by. If one steps to its right and the other to its left, they head for the same side and again end up nose to nose. This situation is written as a game in Table 10.5.
| R1 ╲ R2 | Right | Left |
|---|---|---|
| Right | (1, 1) | (−1, −1) |
| Left | (−1, −1) | (1, 1) |
At (Right, Right), a robot that switches to Left on its own drops to −1, so nobody deviates. The same holds for (Left, Left). In the other two cells both get −1 and the robot that changes sides rises to 1; these cells are not equilibria. Both equilibria are equally good. The problem is not which one is better but which one will be played.
A convention or social law is a common rule, known to all agents, that selects one of the equilibria of a coordination game in advance. The rule "everyone keeps right" selects the (Right, Right) equilibrium in the corridor game.
The strength of a convention is that it is self-enforcing. If everyone keeps right, keeping right is each agent's best response; an agent that breaks the rule hurts only itself. This is why no police are needed to enforce a convention. The source of this strength is that a convention selects an equilibrium; a rule that selects a non-equilibrium outcome does not enforce itself.
In the corridor game, the expected payoffs of three situations are compared: no convention (mixed strategy), a convention, and a common signal.
- No convention. The robots do not know which side the other will choose. The only reasonable symmetric behavior is to choose each side with probability ½. If R2 chooses Right with probability q, R1's expected payoff from Right is q − (1 − q) = 2q − 1, and from Left it is −q + (1 − q) = 1 − 2q. Indifference gives q = 1/2. This is a mixed Nash equilibrium.
- Payoff at the mixed equilibrium. The robots choose the same side with probability ½ (each gets 1) and different sides with probability ½ (each gets −1). The expected payoff is ½ · 1 + ½ · (−1) = 0. Half of the encounters end in a collision.
- With a convention. Under the rule "everyone keeps right", both robots choose Right and each gets exactly 1. The payoff rises from 0 to 1.
- With a common signal. Let a common signal, like a traffic light, say "both right" or "both left" with probability one half each. A robot that knows the other will go right when the signal says "right" has right as its best response; the same holds for "left". Nobody wants to ignore the signal, and each robot again gets 1.
The last step of Example 10.2 shows an important notion. A traffic light gives everyone a common signal and selects which of the two equilibria is played. An equilibrium of this kind, in which following the signal is the best response for every player, is called a correlated equilibrium. A correlated equilibrium arises when the players are given an outside "recommendation" and following it is in each player's own interest. The traffic light at an intersection is an everyday example.
10.2.6Game theory and incentives
Game theory does two separate jobs in multi-agent systems.
- Analysis: the Nash equilibrium
- Where do the agents' strategic decisions lead at equilibrium? Is the equilibrium efficient? This is predicting the outcome once the rules of the system are given.
- Design: the mechanism
- How do rules, payments, and auctions steer agents toward honest reporting and cooperation? This is choosing the rules that will produce the desired outcome.
The power of design shows in two examples.
Energy sharing. In a smart grid, some households produce energy with solar panels. If the incentive is set up in a balanced way, for instance with a fair payment for surplus production fed into the grid, households feed the surplus into the grid and everyone gets enough energy. If the incentive is set up wrongly, for instance if the same price applies at every hour, everyone draws energy at the hour that suits them best, namely the evening peak, and the grid is strained.
Distributed network resources. Bandwidth and computing power are shared resources. Without usage fees or quotas, every agent uses the resource to the fullest for its own work, and overuse results. A fee or quota makes each agent feel the cost that its own use imposes on others.
The conclusion from the two examples is this. The right incentive increases cooperation and reduces conflict. The wrong incentive breeds selfish behavior, excessive risk-taking, and free riding. Incentive design means setting up rules under which selfish behavior is also good for the system, instead of expecting agents not to be selfish.
10.2.7Communication, learning, and emergent behavior
In the basic models of game theory, the players know the game and play the equilibrium at once. In multi-agent systems three real-world circumstances complicate this simple picture.
Communication and information. Agents have different information. One robot knows that a shelf is empty; another does not. Who knows what, that is, the information structure, changes the equilibrium. Games in which players do not fully know one another's payoffs or types are called games of incomplete information. For agents to exchange information they need a common language and a messaging protocol. The contract net (10.3.2) is such a protocol.
Learning and adaptation. Instead of computing the equilibrium in advance, agents can update their strategies step by step from feedback. There are three common methods. In best-response dynamics, each agent plays a best response to the others' latest move. In fictitious play, each agent plays a best response to the average of its opponent's past moves. In reinforcement learning, the agent chooses actions that have given good results more often. But there is a problem: because the other agents are learning too, each agent's environment keeps changing. Such an environment is called non-stationary. In a non-stationary environment there is no guarantee that learning converges to an equilibrium.
In the corridor game (Table 10.5), let the two robots start from the cell (Right, Left); both have payoff −1. Two different update rules are compared.
- Simultaneous best response, round 1. R1 plays a best response to R2's last choice, Left: Left. At the same time R2 plays a best response to R1's last choice, Right: Right. The new cell is (Left, Right), and both again get −1.
- Simultaneous best response, round 2. R1 chooses Right as the best response to Right, and R2 chooses Left as the best response to Left. The cell becomes (Right, Left) again.
- Result. The two robots oscillate forever between (Right, Left) and (Left, Right). Each tries to adapt to the other, but because the other changes at the same moment, the adaptation never happens. The dynamics do not converge.
- Sequential best response. This time let only R1 update. R1 chooses Left as the best response to R2's Left. The cell becomes (Left, Left). When R2's turn comes, R2 is already at a best response and does not change. The dynamics reach an equilibrium in a single step.
Example 10.3 makes the consequence of a non-stationary environment concrete. For each robot the environment is the behavior of the other robot; since the other robot is learning too, this environment changes in every round. Putting the updates in sequence (or adding a small random wait for the robots) breaks the cycle. The practice in network protocols of having colliding messages wait a random time and resend rests on the same idea.
Emergent behavior. Simple local rules can produce unexpected patterns at the system level. This is called emergent behavior. The most famous example is Schelling's (1971) segregation model. Individuals from two groups are placed on a grid. Each individual moves to an empty spot if the share of its own group among its neighbors falls below a small threshold (for instance below one third). No individual wants segregation; everyone is content to live in a mixed neighborhood. Even so, the moves cascade, and in the end sharply segregated neighborhoods form. A mild preference about neighbors produces strong segregation that nobody wanted.
This example carries a methodological lesson: the behavior of the system cannot be read off by looking at the agents one by one. This is why equilibrium analysis and simulation are used together in multi-agent systems. Equilibrium analysis gives the stationary points the system can reach; simulation shows how the system travels to these points, or whether it gets there at all. Traffic jams and price fluctuations are further patterns of this kind that arise from the interaction among agents.
10.2.8Common mistakes in coordination
Looking for the one equilibrium of a game with several. The corridor game has two pure equilibria: (Right, Right) and (Left, Left). There is also a ½–½ mixed equilibrium. The answer to "how many pure equilibria are there?" is 2; the mixed equilibrium is not added to this count.
Taking a coordination problem for an incentive problem. In the corridor game there is no conflict of interest; both robots want to avoid a collision. No payment or penalty is needed here; a common rule is enough. In the Prisoner's Dilemma, by contrast, a common rule ("let us both stay silent") does not enforce itself, because the rule does not select an equilibrium.
Taking the commonly good outcome to be an equilibrium. (Silent, Silent) is better for both players than (Defect, Defect), but it is not an equilibrium: a player who switches to Defect while the other is silent gets 0 instead of −1.
Assuming centralized control is always superior. If the center knows all the information it can compute the optimum, but it has to get this information from the agents, and the agents may not report it honestly. The center is also a single point of failure.
10.3Task allocation
The most common concrete problem a multi-agent system faces is distributing jobs among agents. Which drone will scan which region, which robot will pick which order, which server will do which computation? The contract net protocol, one of the oldest distributed methods, can be compared with the centralized optimum on a small example.
10.3.1Task and resource allocation
Task allocation is the problem of distributing jobs among suitable agents, taking abilities and costs into account. The goal is usually to optimize some aggregate measure, for example to minimize the total time. When what is being distributed is not jobs but a resource such as processor time, bandwidth, or energy, the problem is called resource allocation.
On paper the problem looks simple: write down in a table how long each agent needs for each job, and look for the assignment with the smallest total. In reality there are three difficulties.
- Private information. Often only the agent itself knows the costs. How many minutes a robot needs to pick an order depends on the robot's position, charge, and load. The center cannot see this table.
- Scale. The number of agents is large. There may be hundreds of robots and thousands of orders.
- Time. Tasks arrive over time. Not all tasks are known up front; decisions have to be made as new orders come in.
A good method balances solution quality against communication and computation cost. Computing for hours or sending thousands of messages to find a perfect assignment can be more expensive than finding a slightly worse assignment instantly. Table 10.6 compares four common methods.
| Method | How it works | Pros / cons |
|---|---|---|
| Centralized optimization | All costs are collected and the assignment problem is solved (Hungarian algorithm) | Optimal / needs all information |
| Contract net | A task is announced, agents bid, the best bid wins | Simple, distributed / can be greedy |
| Auction | Tasks or resources are sold by bidding; bundles in a combinatorial auction | Can be designed to be incentive compatible |
| Market-based | Prices are adjusted to supply and demand, agents react to prices | Scales / convergence can be slow |
Centralized optimization collects all costs at a center and solves the assignment problem: assign n tasks to n agents so that each agent gets exactly one task and the total cost is minimal. The classical solution of this problem is the Hungarian algorithm. The Hungarian algorithm finds the optimum in about n3 steps; that is, about a thousand steps suffice for n = 10. What the method lacks is not computation but information: the center must know the entire cost table.
The contract net does not gather information at the center; it puts tasks out to tender one at a time. Auction methods generalize this idea. In a combinatorial auction, agents bid not on single tasks but on bundles of tasks: "I can do G1 and G2 together in 5 minutes." Bundle bids capture complementarities among tasks (such as picking two nearby orders together). In market-based methods each task or resource has a price. The price rises when demand is in excess and falls when it is low; agents decide which task to take by looking at the price. This method scales to very large systems, but it can take time for prices to settle at equilibrium.
10.3.2The contract net protocol
The Contract Net Protocol was proposed by Smith (1980) for distributed problem solving. The protocol imitates the tendering process in the construction industry: a client announces the job, contractors submit bids, and the job is given to the best bid. FIPA (the Foundation for Intelligent Physical Agents), which sets agent standards, also published the protocol as a standard in 2002 (FIPA, 2002).
In the contract net protocol, the agent that has a task plays the role of manager, and the agents that can do the job play the role of contractor. Four steps are followed for each task:
- Task announcement: the manager broadcasts the task and the bid deadline to the contractors.
- Bid: each eligible contractor sends a bid stating its cost or capability.
- Award: the manager compares the bids and awards the contract to the best one.
- Result report: when the contractor finishes the job, it reports the result to the manager.
Figure 10.4 shows the order of the messages. The order cannot be changed: a task that has not been announced cannot be bid on, and an award cannot be made before the bids are collected. The roles are not fixed; they can change from task to task. A robot that has taken on a task as contractor can put a sub-part of that task out to tender to other robots and become the manager for that subtask. In this way a large job is broken into pieces by nested tenders.
The most important property of the protocol concerns information. The manager does not know the costs; the bids reveal this private information. The manager does not have to learn the whole cost table; for each task it sees only the bids for that task. Bidding is a reverse auction: in an ordinary auction the highest bid wins, whereas here the job goes to whoever reports the lowest cost. This structure raises the question of whether bidders will be honest; that question is taken up in 10.3.6.
10.3.3The contract net step by step
Let us run the protocol on a small example. A manager will put three tasks (G1, G2, G3) out to tender in turn. There are three robots (R1, R2, R3). Each robot can take at most one task. Each robot's estimated time (in minutes) for each task is given in Figure 10.5. These times are the robots' costs, and the robots report them honestly as bids. An important detail: only the robots know the table; the manager does not see it. Each robot knows only its own column.
The critical point of the table is this: R1 is the cheapest robot for both G1 (2) and G2 (3). Since R1 can take only one task, which task it goes to will determine the total time.
- Announcement of G1. The manager broadcasts G1 to all idle robots: R1, R2, R3.
- Bids for G1. Each robot reports its own cost for G1: R1 → 2, R2 → 3, R3 → 6.
- Award of G1. The lowest bid is R1's (2 min). G1 goes to R1. R1 is now busy. Total time 2 min.
- Announcement of G2. The manager broadcasts G2 to the idle robots: R2, R3. R1 does not receive the announcement because it is busy.
- Bids for G2. R2 → 7, R3 → 8. Although R1 (3 min) is the cheapest robot for G2, it cannot bid.
- Award of G2. The lowest bid is R2's (7 min). G2 goes to R2. Total time 2 + 7 = 9 min.
- Announcement of G3. Only R3 remains idle.
- Bid for G3. R3 → 9. There is only one bid.
- Award of G3. G3 goes to R3; since only one bid is left, the choice is forced. Total time 9 + 9 = 18 min.
The contract net finds the assignment G1→R1, G2→R2, G3→R3, and the total time is 18 minutes.
Figure 10.6 and Figure 10.7 show the bid and award steps of the first tender. The next two tenders proceed in the same way; the only difference is that after each award the number of idle robots drops by one. Table 10.7 summarizes the three tenders together.
| Announcement | Idle robots | Bids | Award | Total |
|---|---|---|---|---|
| G1 | R1, R2, R3 | R1 2, R2 3, R3 6 | R1 (2) | 2 |
| G2 | R2, R3 | R2 7, R3 8 | R2 (7) | 9 |
| G3 | R3 | R3 9 | R3 (9) | 18 |
Figure 10.8 compares the result with the optimum. A center that tries all assignments gives G1 to R3 (6), G2 to R1 (3), and G3 to R2 (4), and obtains a total of 6 + 3 + 4 = 13 minutes. The contract net's 18 minutes is 5 minutes above the optimum. As a ratio, 18/13 ≈ 1.385; that is, the contract net is about 38% more expensive.
Where does the difference come from? At each step the contract net makes the best decision of the moment: it gives G1 to the cheapest robot, R1. This decision is right for G1, but it uses up R1 for G2. Although R1 is the cheapest robot for G2, G2 goes to R2 at 7 minutes. The optimum, by contrast, makes a somewhat expensive choice for G1 (R3, 6 min) but saves R1 for G2. Methods that make the choice that looks locally best at every step are called greedy methods. Greedy methods are fast, but because they do not take the future into account they can miss the overall optimum.
10.3.4Code trace: contract_net()
The sequential tender logic of the contract net can be written as a Python function of a few lines. The function takes two inputs. tasks is the list of tasks in the order in which they are put out to tender: ["G1", "G2", "G3"]. cost is a nested dictionary: cost[r][g] is robot r's cost for task g. In the example, cost["R1"] = {"G1": 2, "G2": 3, "G3": 5}.
def contract_net(tasks, cost):
free = set(cost)
assign, total = {}, 0
for g in tasks:
bids = {r: cost[r][g] for r in free}
winner = min(bids, key=bids.get)
assign[g] = winner
total += bids[winner]
free.remove(winner)
return assign, totalThe code works line by line as follows.
free = set(cost): Building a set from a dictionary takes the dictionary's keys.freeinitially contains all the robots: {R1, R2, R3}.assign, total = {}, 0: The assignments are kept in an empty dictionary, and the total time starts at 0.for g in tasks: The tasks are put out to tender in order. Each iteration is one announcement.bids = {r: cost[r][g] for r in free}: Only the idle robots bid. Each robot reports its own cost for task g. This line is the bid step of the protocol.winner = min(bids, key=bids.get):minpicks, among the dictionary's keys (the robots), the one with the smallestbids.getvalue. This line is the award step.assign[g] = winnerandtotal += bids[winner]: The task is recorded for the winner, and the winning bid is added to the total.free.remove(winner): The winning robot becomes busy and does not take part in later tenders.
| g | free (start of iteration) | bids | winner | assign | total |
|---|---|---|---|---|---|
| — | {R1, R2, R3} | — | — | {} | 0 |
| G1 | {R1, R2, R3} | {R1: 2, R2: 3, R3: 6} | R1 | {G1: R1} | 2 |
| G2 | {R2, R3} | {R2: 7, R3: 8} | R2 | {G1: R1, G2: R2} | 9 |
| G3 | {R3} | {R3: 9} | R3 | {G1: R1, G2: R2, G3: R3} | 18 |
contract_net() trace. Orange cells are the winning bids; on the right are the assignment list and the total of 18 min.Table 10.8 and Figure 10.9 summarize the run of the code on the example. The most instructive part of the trace is the G2 iteration: in this iteration R1 is not in the set free. R1, which took G1 cheaply, was also the cheapest candidate for G2 (3), but it is now busy. At each step the function makes the locally best decision, but the result is not the overall optimum. The cost of the code is also low: for m tasks and n robots, at most n bids are compared in each iteration, so the total work is about m · n steps.
One more detail of the code matters: in case of a tie, the min function picks the first robot it meets in the dictionary. If two robots submit the same bid, the winner depends on the internal order of the collection. In a real protocol the tie-breaking rule (for example, the lower-numbered robot wins) should be stated explicitly. No tie occurs in this example.
10.3.5The centralized optimum: optimum()
To judge the result of the contract net we need to know the optimum. A center that knows all the costs can try every assignment of robots to tasks. For three tasks and three robots, an assignment is an ordering of the robots: the first robot in the ordering takes G1, the second takes G2, and the third takes G3. The three robots have 3! = 3 · 2 · 1 = 6 different orderings.
from itertools import permutations
def optimum(tasks, cost):
best = None
for p in permutations(cost):
t = sum(cost[r][g]
for g, r in zip(tasks, p))
if best is None or t < best[0]:
best = (t, p)
return bestThe code works line by line as follows.
best = None: No assignment has been tried yet.for p in permutations(cost):permutations(from Python'sitertoolsmodule) generates all orderings of the robots.p = ("R3", "R1", "R2")means that G1 is assigned to R3, G2 to R1, and G3 to R2.zip(tasks, p): Pairs the tasks with the robots in the ordering: (G1, R3), (G2, R1), (G3, R2).t = sum(cost[r][g] for g, r in ...): Computes the total time of this assignment.if best is None or t < best[0]: If this is the first assignment or one better than any so far,bestis updated. An assignment with an equal time does not replace the current best.
| p | t | Comparison | best |
|---|---|---|---|
| (R1, R2, R3) | 2 + 7 + 9 = 18 | first assignment | (18, R1 R2 R3) |
| (R1, R3, R2) | 2 + 8 + 4 = 14 | 14 < 18 ⇒ new best | (14, R1 R3 R2) |
| (R2, R1, R3) | 3 + 3 + 9 = 15 | 15 ≥ 14 ⇒ unchanged | (14, R1 R3 R2) |
| (R2, R3, R1) | 3 + 8 + 5 = 16 | 16 ≥ 14 ⇒ unchanged | (14, R1 R3 R2) |
| (R3, R1, R2) | 6 + 3 + 4 = 13 | 13 < 14 ⇒ new best | (13, R3 R1 R2) |
| (R3, R2, R1) | 6 + 7 + 5 = 18 | 18 ≥ 13 ⇒ unchanged | (13, R3 R1 R2) |
optimum() trace. On the right are the total times of the six orderings; the best is (R3, R1, R2) with 13 min (orange). The orange cells on the left are the optimal assignment.Table 10.9 and Figure 10.10 show the result: the optimum is 13 minutes and is obtained with the assignment G1→R3, G2→R1, G3→R2. The assignment found by the contract net is the first row of the list (18 min). One more thing is visible in the table: two of the six assignments take 18 minutes, so in this example the contract net has found the worst possible total.
The problem with this method is scale. For n robots there are n! orderings, and this number grows very quickly. Table 10.10 shows a few values.
| n | n! (number of assignments) | n3 |
|---|---|---|
| 3 | 6 | 27 |
| 5 | 120 | 125 |
| 10 | 3,628,800 | 1,000 |
| 15 | 1,307,674,368,000 | 3,375 |
At n = 10 there are more than three and a half million assignments; at n = 15 the number exceeds a trillion. Trying all assignments is impractical except for small examples. The Hungarian algorithm finds the same optimum in O(n3) time: about a thousand steps at n = 10 and about three thousand at n = 15. But whichever algorithm is used, the real obstacle of the centralized solution is not computation but information: the center must know all the costs.
10.3.6Bids and honesty
So far it has been assumed that the robots bid their costs honestly. Is this assumption valid if the robots are selfish agents? The answer depends on what the winner is paid. In the contract net, bidding is a reverse auction: the lowest bid wins, and the winner receives a payment for doing the job. The robot's gain is the difference between the payment it receives and its true cost.
Consider the tender for G1. The true costs are R1 2, R2 3, R3 6. Two payment rules are compared.
- The winner is paid its own bid (first price). If R1 bids 2 honestly, it wins, receives 2, and since its cost is 2 its gain is 2 − 2 = 0.
- Inflating under first price. Let R1 raise its bid to 2.9. If the other bids do not change, R1 still has the lowest bid (2.9 < 3), wins, and receives 2.9. Its gain is 2.9 − 2 = 0.9. Under this rule the contractor wants to inflate its cost; an honest bid is not the best.
- The winner is paid the second-lowest bid (Vickrey). R1 bids 2 honestly and wins; the payment is the second-lowest bid, 3. Its gain is 3 − 2 = 1.
- Inflating does not help under Vickrey. With any bid below 3 (2.5 or 2.9), R1 still wins and still receives 3: the gain of 1 does not change. If the bid goes above 3, R1 loses and its gain drops to 0. Inflating the bid either leaves the gain unchanged or lowers it.
- Underbidding does not help under Vickrey either. R2's cost is 3. Suppose R2 bids 1.5 to get the job. It wins, but the payment is the second-lowest bid, R1's 2. Its gain is 2 − 3 = −1: it makes a loss. With the honest bid (3) it loses the auction and its gain is 0; this is better.
Example 10.5 illustrates a general result. If the winner is paid its own bid, the contractor wants to inflate its cost. If the second-lowest bid is paid (the Vickrey rule), an honest bid is best: the robot's bid determines only whether it wins, not the payment. Because the payment depends on the others' bids, the robot has no way of raising the payment by lying. All the robot can do is decide whether winning is profitable, and an honest bid always makes that decision correctly. This result holds for a single task: if tasks are tendered in sequence and a robot that takes a task leaves later tenders, then because of the opportunity cost of later tasks an honest bid may no longer be dominant. The VCG mechanism, which chooses the whole assignment together, removes this problem.
This result is valid for the tender of a single task. When tasks are tendered in sequence, a robot may want to lose a tender on purpose in order to take a later task. Honesty for the assignment as a whole is secured by a general rule that makes each robot pay for the loss it imposes on the others: the VCG mechanism (Vickrey–Clarke–Groves). VCG is the multi-item generalization of the Vickrey rule.
10.3.7Strengths, weaknesses, and improvements
The result in the example shows both the strength and the weakness of the contract net.
Strengths.
- Distributed: the manager makes a good assignment without knowing the cost table. The information stays with the robots and is shared only as far as necessary.
- Few messages: in a system with n robots, the number of messages per task is O(n): one announcement (broadcast), at most n bids, and one award.
- Flexibility: adding a new robot is easy; the robot simply starts listening to announcements. The task of a robot that breaks down is put out to tender again.
Weaknesses.
- Greedy and sequential: in the example, 18 min against an optimum of 13 min (38% more). R1, which took G1 cheaply, stayed busy although it was the best candidate for G2.
- Strategic bidding: robots can inflate their costs strategically (10.3.6).
- Order dependence: the order in which tasks are put out to tender changes the result.
Order dependence is seen most clearly by trying all six tender orders with the same cost table. Table 10.11 gives the results.
| Tender order | 1st tender | 2nd tender | 3rd tender | Total |
|---|---|---|---|---|
| G1, G2, G3 | G1→R1 (2) | G2→R2 (7) | G3→R3 (9) | 18 |
| G1, G3, G2 | G1→R1 (2) | G3→R2 (4) | G2→R3 (8) | 14 |
| G2, G1, G3 | G2→R1 (3) | G1→R2 (3) | G3→R3 (9) | 15 |
| G2, G3, G1 | G2→R1 (3) | G3→R2 (4) | G1→R3 (6) | 13 |
| G3, G1, G2 | G3→R2 (4) | G1→R1 (2) | G2→R3 (8) | 14 |
| G3, G2, G1 | G3→R2 (4) | G2→R1 (3) | G1→R3 (6) | 13 |
Two of the six orders reach the optimum (13), and one gives the worst result (18). The optimum is found in the orders where G1 is left to the end: G1 has several good candidates (R1 2, R2 3, R3 6), so putting it out to tender last costs little. By contrast, if G1 comes first, R1 grabs it, even though R1 is also the best candidate for G2. Spending the scarce robot in the first tender makes the later tenders more expensive.
The weaknesses of the contract net are reduced by three improvements.
- Re-tendering (repairing assignments by swaps)
- After the first assignment, robots propose pairwise swaps. If two robots exchanging their tasks reduces the total time, the swap is made. Local repairs undo some of the greedy decisions.
- Combinatorial auction
- Robots bid not on single tasks but on bundles of tasks. In this way a robot can reflect in its bid the link between tasks, such as "if I take G1 I cannot take G2".
- Second-price or VCG payments
- The winner is paid the second-best bid (or, in general, the loss it imposes on the others). An honest bid becomes the best strategy (10.3.6).
The contract net's 18-minute assignment (G1→R1, G2→R2, G3→R3) is improved by re-tendering.
- Task swap between R1 and R2. Before the swap, R1 does G1 (2) and R2 does G2 (7): total 9. After the swap, R1 does G2 (3) and R2 does G1 (3): total 6. The swap saves 3 minutes. The new assignment is G1→R2, G2→R1, G3→R3; total 3 + 3 + 9 = 15.
- Task swap between R2 and R3. Before the swap, R2 does G1 (3) and R3 does G3 (9): total 12. After the swap, R2 does G3 (4) and R3 does G1 (6): total 10. The swap saves 2 minutes. The new assignment is G1→R3, G2→R1, G3→R2; total 6 + 3 + 4 = 13.
- Is there another profitable swap? 13 is the optimum (Table 10.9); no swap can lower the total further. The optimum is reached with two swaps.
Example 10.6 shows the power of re-tendering, but a caveat is needed: pairwise swaps may not reach the optimum in every instance. There are non-optimal assignments in which no pairwise swap yields a gain. Swapping is therefore a practical tool for improving the greedy result, not a guarantee of the optimum.
10.3.8Common mistakes in task allocation
Assuming the manager knows the costs. In the contract net the manager does not see the cost table; it learns the costs only from the bids. If the manager knew the table there would be no need for a tender; it would compute the optimum directly.
Thinking a busy robot bids. Each robot takes at most one task. In the G2 tender R1's cost (3) is the lowest, but R1 does not bid because it is busy. The winner of G2 is R2 (7).
Looking for the cause of the loss in honesty. In the example the robots bid honestly and the result is still not optimal. The cause of the loss is not strategic bidding but the greedy, sequential tender. Inflating costs does not reduce this loss.
Overstating the number of messages. The number of messages per task is O(n), not O(n2): one announcement, n bids, one award. Robots exchange messages only with the manager, not with one another.
Computing the percentage against the wrong base. 18 minutes is (18 − 13)/13 ≈ 38% above the optimum. (18 − 13)/18 ≈ 28% is the share of the contract net's time that is wasted; the two answer different questions.
10.4Coalitional games
In task allocation each robot did its job alone. In many jobs, though, agents working together produce value that none of them could produce alone. This section studies the formation of groups and the sharing of the value a group produces among its members. This branch of game theory is called cooperative game theory or coalitional games. The branch has three basic tools: the Shapley value as a fairness criterion, the core as a stability criterion, and power indices that measure strength in voting.
10.4.1Coalition formation
Agents that cannot reach a goal alone can form temporary or permanent coalitions. Freight companies share vehicles: instead of two half-empty trucks, one full truck is sent. Drones carry together a heavy load that none could lift alone. Computing servers split a job into pieces and solve it together. In every case the group produces more than its members could produce alone.
A coalition is a group formed by agents that decide to act together. The coalition consisting of all agents is called the grand coalition. The process of deciding which coalitions the agents split into is called coalition formation.
These games differ from the games of the earlier sections at one point: they are cooperative. In the Prisoner's Dilemma, even if the players agreed to "both stay silent", the agreement had no enforcement; each player would have wanted to break it. In coalitional games it is assumed that binding agreements can be made: a contract, a law, or a software protocol makes the members of a coalition keep their promises. So the question changes. It is no longer "which strategy will each player choose?" but this: who joins with whom, and how is the gain shared?
The two questions are linked. If the sharing is not fair the coalition falls apart: agents who feel wronged leave and form another group. The stability of a coalition depends on the sharing rule. For this reason fairness and stability are treated together.
- The Shapley value
- A fairness criterion: everyone receives their average marginal contribution (10.4.5).
- The core
- A stability criterion: no subgroup can secede and get more (10.4.9).
10.4.2Coalition structures
Agents do not have to unite in a single large group. Consider three logistics firms A, B, and C. The three can work separately, two can merge while the third stays apart, or all three can join together.
A coalition structure is a partition of the agents into disjoint coalitions. Every agent is in exactly one coalition, and no two coalitions share a member. The total value of a structure is the sum of the values of the coalitions in it.
Figure 10.11 shows all structures of the three agents. The values come from the characteristic function given in Table 10.12. If everyone works alone the total is 10 + 20 + 30 = 60. If {B, C} merge and A stays apart, the total is 70 + 10 = 80. {A, C} with {B}: 60 + 20 = 80. {A, B} with {C}: 50 + 30 = 80. All three together produce 120. From society's point of view the question is: which structure has the largest total value? In this example the answer is the grand coalition.
Number of structures. The number of ways to partition n agents into non-empty disjoint groups is called the Bell number and is denoted Bn. For three agents there are 5 structures. Bell numbers can be computed step by step with the following relation: count according to how many of the first n agents are in the group that contains agent n + 1. If this group contains k of the first n agents, there are C(n, k) ways to choose those k agents, and the remaining n − k agents are partitioned in Bn−k ways. The total is:
Bn+1 = Σk=0n C(n, k) · Bn−k, B0 = 1.
With this relation we get B1 = 1, B2 = 1 + 1 = 2, B3 = B2 + 2B1 + B0 = 2 + 2 + 1 = 5. For four agents, B4 = C(3,0)·B3 + C(3,1)·B2 + C(3,2)·B1 + C(3,3)·B0 = 5 + 6 + 3 + 1 = 15. The number grows very quickly: there are 4,140 structures for n = 8 and 115,975 for n = 10. In general, finding the best structure is NP-hard (Sandholm et al., 1999); that is, as the number of agents grows, no known algorithm solves it quickly on every instance.
In the example game this difficulty does not arise, because the game is superadditive: joining together never hurts. In this case the best structure is always the grand coalition, and only one question remains: how should the 120 produced by the grand coalition be shared?
10.4.3The characteristic function
Let N = {1, …, n} be the set of players. A coalitional game is given by a function that assigns a value v(S) to every coalition S ⊆ N. v(S) is the total value the members of S can obtain together, independently of the others. The value of the empty coalition is 0: v(∅) = 0. The function v is called the characteristic function.
If the gain can be distributed freely within the group, that is, if the value of the coalition can be divided like money and handed out among the members in any desired proportion, such games are called transferable-utility games (TU games).
The characteristic function gathers all the information about the game in a single table. Which actions the players choose and how they work do not show in the table; only how much value each group ends up producing does. This abstraction is the foundation of cooperative game theory: since the details inside a group are settled by binding agreements, only the strength of the groups matters.
The main example of the chapter is three logistics firms. Together the firms make a profit of 120 thousand TL; the best pair makes 70 and the best single firm 30. All values of the characteristic function are given in Table 10.12.
| S | {A} | {B} | {C} | {A, B} | {A, C} | {B, C} | {A, B, C} |
|---|---|---|---|---|---|---|---|
| v(S) | 10 | 20 | 30 | 50 | 60 | 70 | 120 |
A coalitional game is superadditive if, for every pair of disjoint coalitions S and T (S ∩ T = ∅),
v(S ∪ T) ≥ v(S) + v(T)
holds. The merger of two disjoint groups produces no less than the sum of what they produce separately; that is, joining together does no harm.
That the logistics game is superadditive is shown by checking all pairs of disjoint coalitions. Pairs that involve the empty coalition hold automatically (v(∅) = 0). Six pairs remain.
- Two singletons merge. v(AB) = 50 ≥ 10 + 20 = 30 ✓; v(AC) = 60 ≥ 10 + 30 = 40 ✓; v(BC) = 70 ≥ 20 + 30 = 50 ✓.
- A pair and a singleton merge. v(ABC) = 120 ≥ v(BC) + v(A) = 70 + 10 = 80 ✓; 120 ≥ v(AC) + v(B) = 60 + 20 = 80 ✓; 120 ≥ v(AB) + v(C) = 50 + 30 = 80 ✓.
All six inequalities hold; the game is superadditive. For this reason the grand coalition {A, B, C} makes the total value largest, and the value to be shared is 120. Whether the coalition forms and survives, however, depends on how this value is shared: even in a superadditive game the core can be empty.
Superadditivity does not hold in every game. As a coalition grows, the cost of coordination can rise: vehicle planning becomes harder in a very large freight partnership. In such a game two separate groups can produce more than the merged group, and the best structure need not be the grand coalition.
10.4.4How should 120 be split?
The grand coalition produces 120. How should this value be shared? There are two conditions that every reasonable split must satisfy.
An imputation x = (xA, xB, xC) is a payoff vector that satisfies two conditions:
- Efficiency: its sum equals the value of the grand coalition, xA + xB + xC = v(N) = 120. No value is wasted.
- Individual rationality: everyone gets at least their stand-alone value, xi ≥ v({i}). Otherwise that agent would leave the coalition and work alone.
There are infinitely many imputations that satisfy these two conditions. Table 10.13 compares four proposals.
| Proposal | xA | xB | xC | Rationale / problem |
|---|---|---|---|---|
| Equal split | 40 | 40 | 40 | Simple; but ignores C's larger contribution |
| Proportional to stand-alone value (10 : 20 : 30) | 20 | 40 | 60 | Looks only at v({i}); ignores synergies |
| The strong C's proposal | 10 | 25 | 85 | A and B together can get 50; they will not accept |
| Shapley value | 30 | 40 | 50 | Average marginal contribution |
All four proposals are imputations: they sum to 120 and everyone gets at least their stand-alone value. In C's proposal, for example, A gets exactly 10, so it does not fall below its stand-alone value. Even so, the proposals are very different.
The equal split is the simplest rule, but it ignores that C adds more value to every group. The proportional split divides 120 in proportion to the stand-alone values: since the total stand-alone value is 10 + 20 + 30 = 60, each player gets 120/60 = 2 times its stand-alone value. This rule does not see synergies: it does not account for the extra value of 20 that A creates with B and 20 with C (50 − 30 and 60 − 40). The strong C's proposal gives C 85. But then A and B together get 10 + 25 = 35, whereas if the two broke away and formed their own coalition they would earn v(AB) = 50. This proposal will not be accepted. The Shapley value, in contrast, gives each player the average of the value it adds to all possible groups.
The table brings out two separate criteria: is the split fair (the Shapley value) and is it stable (the core)? C's proposal is not stable, because a subgroup wants to leave. The equal split is stable in this game, but it does not reflect contributions.
10.4.5The Shapley value: definition and axioms
The idea of the Shapley value is explained with a simple story. The players arrive one by one in a random order and join the coalition. Each player is credited with the value it adds to the coalition at the moment it arrives. For example, if the order is A → B → C, A arrives first and adds v(A) − v(∅) = 10 to the empty coalition. When B arrives, the coalition grows from {A} to {A, B}, and B's contribution is v(AB) − v(A) = 50 − 10 = 40. C arrives last and adds v(ABC) − v(AB) = 120 − 50 = 70. This value that a player adds to a coalition is called its marginal contribution.
A single order is not fair: the player who arrives last often collects the largest synergy. This is why the Shapley value averages over all orders.
The Shapley value φi of player i is the average marginal contribution of i over all n! arrival orders of the n players:
φi = (1/n!) · Σπ [ v(Piπ ∪ {i}) − v(Piπ) ]
Here the sum runs over all orders π, and Piπ is the set of players that come before i in the order π.
The same value can also be written over coalitions instead of orders. The number of orders in which the set of players before i is S equals the number of arrangements of the members of S among themselves (|S|!) times the number of arrangements of those after i ((n − |S| − 1)!). Therefore
φi = ΣS ⊆ N∖{i} [ |S|! · (n − |S| − 1)! / n! ] · [ v(S ∪ {i}) − v(S) ]
holds. This formula sums over the 2n−1 coalitions that do not contain i, instead of over n! orders. In a three-player game the weights are as follows: for |S| = 0, 0! · 2!/3! = 2/6 = 1/3; for |S| = 1, 1! · 1!/3! = 1/6; for |S| = 2, 2! · 0!/3! = 2/6 = 1/3. The weights add up to 1/3 + 2 · 1/6 + 1/3 = 1.
Computational cost. The exact computation requires either n! orders or 2n−1 subsets. Both grow very quickly as n grows. For large n the Shapley value is computed approximately by sampling: a few thousand random orders are chosen and the marginal contributions in these orders are averaged. As the number of samples grows, the average approaches the true value.
The importance of the Shapley value does not come from its being merely an intuitive rule. Shapley (1953) showed that this value is the only rule that satisfies four natural conditions. These conditions are called axioms.
Among the rules that assign a payoff vector to every coalitional game, the only rule that satisfies the following four axioms is the Shapley value.
- Efficiency: Σi φi = v(N). The value of the grand coalition is distributed exactly.
- Symmetry: Two players that make the same contribution receive the same share. Formally, if v(S ∪ {i}) = v(S ∪ {j}) for every S containing neither i nor j, then φi = φj.
- Dummy player: A player that contributes nothing to any coalition, that is, a player with v(S ∪ {i}) = v(S) for every S, receives φi = 0.
- Additivity: If the values of two games are added, the Shapley shares add as well: φi(v + w) = φi(v) + φi(w).
The proof of the theorem is outside the scope of these notes. But it is easy to see why the definition satisfies the axioms. Efficiency: in every order, the sum of the marginal contributions is the sum of the values added step by step from the empty coalition to the grand coalition, and it telescopes to v(N) − v(∅) = v(N). Averaging leaves the total at v(N). Dummy player: a player whose contribution is 0 in every order has an average of 0. Symmetry: a mapping that swaps i and j matches i's contribution in each order with j's contribution in another order; the averages come out equal. Additivity: the marginal contribution is linear in v; the contribution of a sum is the sum of the contributions.
The Shapley value is used today outside game theory as well. In machine learning, the SHAP (SHapley Additive exPlanations) method, which splits a single decision of a model into the contributions of the input features, treats the features as "players" and the model's prediction as the "coalition value", and assigns each feature its Shapley value.
10.4.6The Shapley value step by step
In the logistics game the Shapley value is computed by writing out the marginal contributions in each of the six arrival orders.
In each order the agents arrive one by one; for each, the value it adds to the coalition at the moment it arrives is written down. The values are read from Table 10.12.
- A → B → C. A: 10 − 0 = 10; B: v(AB) − v(A) = 50 − 10 = 40; C: v(ABC) − v(AB) = 120 − 50 = 70. Row total 10 + 40 + 70 = 120.
- A → C → B. A: 10 − 0 = 10; C: v(AC) − v(A) = 60 − 10 = 50; B: v(ABC) − v(AC) = 120 − 60 = 60. Row total 120.
- B → A → C. B: 20 − 0 = 20; A: v(AB) − v(B) = 50 − 20 = 30; C: 120 − 50 = 70. Row total 120.
- B → C → A. B: 20; C: v(BC) − v(B) = 70 − 20 = 50; A: v(ABC) − v(BC) = 120 − 70 = 50. Row total 120.
- C → A → B. C: 30 − 0 = 30; A: v(AC) − v(C) = 60 − 30 = 30; B: 120 − 60 = 60. Row total 120.
- C → B → A. C: 30; B: v(BC) − v(C) = 70 − 30 = 40; A: 120 − 70 = 50. Row total 120.
- Add up the columns and divide by 6. A: 10 + 10 + 30 + 50 + 30 + 50 = 180, φA = 180/6 = 30. B: 40 + 60 + 20 + 20 + 60 + 40 = 240, φB = 40. C: 70 + 50 + 70 + 50 + 30 + 30 = 300, φC = 50.
The Shapley value is φ = (30, 40, 50). Its sum is 120; the efficiency axiom holds.
| Order | A | B | C |
|---|---|---|---|
| A → B → C | 10 | 40 | 70 |
| A → C → B | 10 | 60 | 50 |
| B → A → C | 30 | 20 | 70 |
| B → C → A | 50 | 20 | 50 |
| C → A → B | 30 | 60 | 30 |
| C → B → A | 50 | 40 | 30 |
| Total | 180 | 240 | 300 |
| φ = total / 6 | 30 | 40 | 50 |
Table 10.14 shows the computation at a glance. Two regularities in the table help check the computation. First, every row sums to 120; if a row does not total 120, there is a subtraction error in it. Second, in the orders where a player arrives first, its contribution is always its stand-alone value: A's first two rows are 10, B's third and fourth rows are 20, and C's last two rows are 30.
Checking with the coalition formula. The same result is obtained with the weighted formula of 10.4.5. For A there are four coalitions that do not contain A: ∅ (weight 1/3), {B} and {C} (weight 1/6), and {B, C} (weight 1/3).
φA = (1/3)·10 + (1/6)·(50 − 20) + (1/6)·(60 − 30) + (1/3)·(120 − 70) = 10/3 + 5 + 5 + 50/3 = 30
For B: (1/3)·20 + (1/6)·(50 − 10) + (1/6)·(70 − 30) + (1/3)·(120 − 60) = 20/3 + 20/3 + 20/3 + 20 = 40. For C: (1/3)·30 + (1/6)·(60 − 10) + (1/6)·(70 − 20) + (1/3)·(120 − 50) = 10 + 25/3 + 25/3 + 70/3 = 50. The two methods give the same result.
Interpreting the result. C receives the largest share (50), because it is both the most valuable player alone (30) and the one that adds the most value to every group. A receives the smallest share (30). Still, A's share is three times its stand-alone value (10), because the synergy A adds to groups is large: A adds 50 to {B, C}. The Shapley value gives each player its stand-alone value plus its average share of the synergies it creates.
10.4.7Code trace: shapley()
The definition of the Shapley value can be turned into code directly. The function takes two inputs: the player list N = ["A", "B", "C"] and the characteristic function v. v is a dictionary whose keys are frozensets: v[frozenset()] = 0, v[frozenset({"A"})] = 10, …, v[frozenset({"A", "B", "C"})] = 120. A frozenset is an immutable set; an ordinary set cannot be a dictionary key, but an immutable one can.
from itertools import permutations
def shapley(N, v):
phi = {i: 0 for i in N}
orders = list(permutations(N))
for order in orders:
S = frozenset()
for i in order:
gain = v[S | {i}] - v[S]
phi[i] += gain
S = S | {i}
return {i: phi[i] / len(orders) for i in N}The code works line by line as follows.
phi = {i: 0 for i in N}: Each player's total contribution starts at 0.orders = list(permutations(N)):permutationsgenerates all arrival orders: 3! = 6 orders for three players.for order in orders: Each order is processed separately. WithS = frozenset()the coalition starts empty.for i in order: The players arrive in the sequence of the order.gain = v[S | {i}] - v[S]: The marginal contribution of i.S | {i}is S with i added; since the union of afrozensetand an ordinary set is again afrozenset, it can be used as a dictionary key.phi[i] += gainandS = S | {i}: The gain is added to i's total, and i joins the coalition.return {i: phi[i] / len(orders) for i in N}: The totals are divided by the number of orders (6).
| order | i | S (before) | gain | phi (A, B, C) |
|---|---|---|---|---|
| (A, B, C) | A | ∅ | 10 − 0 = 10 | (10, 0, 0) |
| B | {A} | 50 − 10 = 40 | (10, 40, 0) | |
| C | {A, B} | 120 − 50 = 70 | (10, 40, 70) | |
| (A, C, B) | A | ∅ | 10 − 0 = 10 | (20, 40, 70) |
| C | {A} | 60 − 10 = 50 | (20, 40, 120) | |
| B | {A, C} | 120 − 60 = 60 | (20, 100, 120) | |
| (B, A, C) | B | ∅ | 20 − 0 = 20 | (20, 120, 120) |
| A | {B} | 50 − 20 = 30 | (50, 120, 120) | |
| C | {A, B} | 120 − 50 = 70 | (50, 120, 190) | |
| (B, C, A) | B | ∅ | 20 − 0 = 20 | (50, 140, 190) |
| C | {B} | 70 − 20 = 50 | (50, 140, 240) | |
| A | {B, C} | 120 − 70 = 50 | (100, 140, 240) | |
| (C, A, B) | C | ∅ | 30 − 0 = 30 | (100, 140, 270) |
| A | {C} | 60 − 30 = 30 | (130, 140, 270) | |
| B | {A, C} | 120 − 60 = 60 | (130, 200, 270) | |
| (C, B, A) | C | ∅ | 30 − 0 = 30 | (130, 200, 300) |
| B | {C} | 70 − 30 = 40 | (130, 240, 300) | |
| A | {B, C} | 120 − 70 = 50 | (180, 240, 300) |
shapley() trace. The order is C → B → A, and A joins last (orange); the phi totals (180, 240, 300) have not yet been divided by 6.Table 10.15 and Figure 10.12 show the trace. When the loops finish, phi = {A: 180, B: 240, C: 300}. The last line divides each total by 6 and returns {A: 30.0, B: 40.0, C: 50.0}. The trace accumulates the columns of Table 10.14 row by row; at the end of each order the sum of phi has grown by 120 (120 after the first order, 240 after the second, …, 720 = 6 · 120 after the sixth).
The cost of the code is n! · n steps: n players are processed in each of the n! orders. For n = 10 this is about 36 million steps and is still feasible for a computer; for n = 20 it is 20! · 20 ≈ 4.9 · 1019 steps and is not. For large games, a few thousand randomly chosen orders are used in place of the orders list; the rest of the code does not change.
10.4.8Back to the game: the pairwise synergy model
Let us return to the opening Shapley Coalition Game (10.1.1). In the game, the value of a coalition is the sum of its members' stand-alone values plus the synergy bonus of every pair inside it. In the sample round the stand-alone values are A 6, B 4, C 5, and the synergies are A–B 4, A–C 2, B–C 0. The characteristic function is: v(A) = 6, v(B) = 4, v(C) = 5, v(AB) = 6 + 4 + 4 = 14, v(AC) = 6 + 5 + 2 = 13, v(BC) = 4 + 5 + 0 = 9, v(ABC) = 15 + 6 = 21.
In this model there is no need to compute the six orders one by one; the Shapley value reduces to a short rule.
Let each player's stand-alone value be ai, each pair's synergy be sij, and the value of a coalition be v(S) = Σi∈S ai + Σ{i,j}⊆S sij. Then
φi = ai + ½ · Σj≠i sij
That is, each player receives its stand-alone value and half of every synergy it takes part in.
The proof uses the Shapley axioms. The game is written as a sum of simpler games. For each i define a "stand-alone game": ui(S) = ai if i ∈ S, and 0 otherwise. For each pair {i, j} define a "synergy game": wij(S) = sij if i and j are both in S, and 0 otherwise. From the definition, v = Σi ui + Σ{i,j} wij.
In the stand-alone game ui, every player other than i is a dummy: their presence does not change the value of any coalition. By the dummy player axiom they get 0; by the efficiency axiom, i receives all of ui(N) = ai.
In the synergy game wij, the players other than i and j are dummies and get 0. i and j are symmetric: wij(S ∪ {i}) = wij(S ∪ {j}) = 0 for every S containing neither i nor j. By the symmetry axiom they receive equal shares; since by efficiency these shares sum to sij, each receives sij/2.
By the additivity axiom, the Shapley value of v is the sum of the Shapley values of these simple games. Player i receives ai from its own stand-alone game and sij/2 from every synergy game it takes part in. □
| Player | Alone | Synergy share | φ | Equal share |
|---|---|---|---|---|
| A | 6 | 4/2 + 2/2 = 3 | 9 | 7 |
| B | 4 | 4/2 + 0 = 2 | 6 | 7 |
| C | 5 | 2/2 + 0 = 1 | 6 | 7 |
| Total | 15 | 6 | 21 | 21 |
The result φ = (9, 6, 6) given by the rule is checked with the six arrival orders.
- A → B → C: A 6, B 14 − 6 = 8, C 21 − 14 = 7.
- A → C → B: A 6, C 13 − 6 = 7, B 21 − 13 = 8.
- B → A → C: B 4, A 14 − 4 = 10, C 7.
- B → C → A: B 4, C 9 − 4 = 5, A 21 − 9 = 12.
- C → A → B: C 5, A 13 − 5 = 8, B 8.
- C → B → A: C 5, B 9 − 5 = 4, A 12.
- Average. A: (6 + 6 + 10 + 12 + 8 + 12)/6 = 54/6 = 9. B: (8 + 8 + 4 + 4 + 8 + 4)/6 = 36/6 = 6. C: (7 + 7 + 7 + 5 + 5 + 5)/6 = 36/6 = 6.
The average over the six arrival orders also gives (9, 6, 6).
Now the two opening questions can be answered. Does the equal split treat A unfairly? Measured by contribution, yes: A's Shapley share is 9, while the equal split gives 7. A falls 2 short of its contribution, while B and C each receive 1 more than theirs. Should the most valuable player alone always receive the largest share? In this round A is both the most valuable player alone and the player with the largest share, but that is a coincidence. The share is found by adding half of the synergies to the stand-alone value. A player with a low stand-alone value but a partner in large synergies can receive more than a player with a high stand-alone value but no synergy with anyone. For example, if the synergies were A–B 10, A–C 0, B–C 0, B's share would be 4 + 5 = 9 and C's would be 5; C, with the higher stand-alone value, would receive less.
The game measures the outcome by an equal-split error: the total deviation of the equal split from the Shapley value. In the sample round this error is |7 − 9| + |7 − 6| + |7 − 6| = 2 + 1 + 1 = 4.
How do people actually split? Experiments show that the theory alone is not sufficient. In three-person coalitional games, the choices of subjects who propose a "fair" split for others are best explained as a mixture of the Shapley value and the equal split (de Clippel and Rozen, 2022). People care about contribution, but they also care about equality. In the example, a fifty-fifty mixture gives ½ · (9, 6, 6) + ½ · (7, 7, 7) = (8, 6.5, 6.5). Splitting by contribution (Shapley) and splitting equally often diverge; which one counts as fair depends on the context. In a partnership, investors may find a split by contribution fair, while in a family siblings may find an equal split fair.
10.4.9The core
The Shapley value is a fairness criterion: it gives each player the average of its contributions. But a fair split need not be stable. If a subgroup gets more by seceding from the grand coalition and sharing its own value, that group leaves, however fair the split may look. The notion that measures stability is the core.
A coalition S blocks an imputation x if the total its members receive in x is less than v(S), that is, if Σi∈S xi < v(S): the members of S can leave and, by sharing v(S) among themselves, all be better off. An imputation x is in the core if and only if
Σi∈N xi = v(N) and Σi∈S xi ≥ v(S) for every S ⊆ N
hold; that is, if no coalition blocks x.
The idea of "blocking" becomes concrete as follows. If the members of S receive a total of 35 in x, but can earn 50 together if they leave, they can split the 50 so that each gets more than in x (for example by splitting the extra 15 equally). So S has no reason to accept x. The core is the set of imputations against which no group has such an objection.
The inequalities in the definition include individual rationality for one-player S's and efficiency for the grand coalition. Therefore every payoff vector in the core is an imputation. In the logistics game, the constraints that define the core are:
- Singleton constraints
- xA ≥ 10, xB ≥ 20, xC ≥ 30
- Pair constraints
- xA + xB ≥ 50, xA + xC ≥ 60, xB + xC ≥ 70
- Efficiency
- xA + xB + xC = 120
The core is a system of linear inequalities (Gillies, 1959). The solution set of linear inequalities is a polygonal (in general, polyhedral) region. So the core can be empty, can consist of a single point, or can be a region. An empty core and a region-shaped core are both seen with examples in this section.
A shortcut for the pair constraints. Using the efficiency equation, the pair constraints turn into upper bounds on single players. Since xA + xB ≥ 50 and xA + xB = 120 − xC, we get 120 − xC ≥ 50, that is, xC ≤ 70. In the same way xB ≤ 120 − 60 = 60 and xA ≤ 120 − 70 = 50. In general, in a three-player game each player can receive at most v(N) − v(N ∖ {i}). This value is what i adds to the grand coalition as the last one to join; if i receives more than this, the other two leave and take their own value.
The Shapley value and the core. The Shapley value is a fairness criterion and the core a stability criterion; the two do not always coincide. The Shapley value can lie outside the core, and when the core is empty the Shapley value still exists. But in one class of games the two are compatible.
A coalitional game is convex if each player's marginal contribution does not decrease as the coalition it joins grows: for every i and S ⊆ T ⊆ N ∖ {i}, v(S ∪ {i}) − v(S) ≤ v(T ∪ {i}) − v(T). A convex game has a kind of "snowball effect": as the group grows, the value a newcomer adds increases or stays the same.
In a convex game the core is non-empty, and the Shapley value is always in the core.
The proof of the theorem is long, but it is easy to check that the logistics game is convex. Table 10.17 lists the value each player adds to four coalitions. In each row the values do not decrease from left to right: as the coalition grows the contribution does not shrink. Our example is a convex game; therefore the Shapley split (30, 40, 50) is in the core. This is also confirmed by the constraint check in 10.4.11.
| Player | to ∅ | to a single player | to a single player | to a pair |
|---|---|---|---|---|
| A | 10 | {B}: 30 | {C}: 30 | {B, C}: 50 |
| B | 20 | {A}: 40 | {C}: 40 | {A, C}: 60 |
| C | 30 | {A}: 50 | {B}: 50 | {A, B}: 70 |
Convexity is a sufficient condition, not a necessary one: in a non-convex game too, the Shapley value can be in the core. The condition that decides exactly whether the core is empty is the Bondareva–Shapley theorem (Bondareva, 1963; Shapley, 1967): the core is non-empty if and only if the game is balanced. Although the general definition is technical, for three-player games the condition becomes concrete. In a three-player game the core is non-empty if and only if the following two conditions hold:
- The total value of every coalition structure does not exceed v(N): v(N) ≥ v(A) + v(B) + v(C) and, for each i, v(N) ≥ v({i}) + v(N ∖ {i}).
- Half the sum of the values of the pairs does not exceed v(N): v(N) ≥ ½ · [v(AB) + v(AC) + v(BC)].
Why the second condition is necessary is easy to see: for an x in the core, adding the three pair constraints gives 2(xA + xB + xC) ≥ v(AB) + v(AC) + v(BC); the left side is 2v(N). In the logistics game ½ · (50 + 60 + 70) = 90 ≤ 120 and the value of every structure is at most 80; both conditions hold.
10.4.10The geometry of the core
In a three-player game, imputations can be drawn on a triangle. Thanks to the efficiency equation xA + xB + xC = 120, once two of the three numbers are chosen the third is determined; so the imputations form a two-dimensional region.
Figure 10.13 shows the starting situation. Each player first receives its stand-alone value: 10 + 20 + 30 = 60. A surplus of 120 − 60 = 60 units remains. Each way of dividing this surplus among the three players is a point of the triangle. At the vertices the entire surplus goes to a single player. For example, at vertex C, C receives all 60 in addition to its own 30, giving the imputation (10, 20, 90).
The core is found by cutting from this triangle the pieces that the pair constraints slice off.
- The {A, B} constraint. xA + xB ≥ 50 ⇔ xC ≤ 70. If C is given more than 70, A and B together get less than 50; they leave and take their own 50. This constraint cuts off the small triangle around vertex C.
- The {A, C} constraint. xA + xC ≥ 60 ⇔ xB ≤ 60. Vertex B is cut off.
- The {B, C} constraint. xB + xC ≥ 70 ⇔ xA ≤ 50. Vertex A is cut off too.
In Figure 10.14 the remaining region is a polygon with six vertices. Its vertices are the points where each player's share is at its lower bound (the stand-alone value) or its upper bound (v(N) − v(N ∖ {i})): xA ∈ [10, 50], xB ∈ [20, 60], xC ∈ [30, 70]. If one player is at its lower bound and another at its upper bound, the third's share is fixed by efficiency. For example, if A gets 10 and B gets 60, C gets 120 − 70 = 50. The six vertices are: (10, 40, 70), (10, 60, 50), (30, 20, 70), (30, 60, 30), (50, 20, 50), (50, 40, 30).
The three points in the figure show three different situations with respect to the core. The Shapley value is inside the hexagon: it does not touch any of the three boundaries. The equal split is inside as well: 40 ≤ 50, 40 ≤ 60, 40 ≤ 70. C's proposal y, however, lies in the cut-off piece at vertex C: xC = 85 > 70. The geometry also answers the question "which coalition blocks?": the edge on which y falls outside is the edge of the {A, B} constraint; the coalition that blocks y is {A, B}.
10.4.11Checking the core step by step
Whether an imputation is in the core is determined by checking each of the seven constraints one by one. If an imputation is in the core, no coalition can leave, take its own value (v(S)), and be better off.
The Shapley imputation x = (30, 40, 50) and C's proposal y = (10, 25, 85) are tested against the seven constraints.
- {A}: v(A) = 10. For x, 30 ≥ 10 ✓; for y, 10 ≥ 10 ✓ (equality suffices).
- {B}: v(B) = 20. For x, 40 ≥ 20 ✓; for y, 25 ≥ 20 ✓.
- {C}: v(C) = 30. For x, 50 ≥ 30 ✓; for y, 85 ≥ 30 ✓.
- {A, B}: v(AB) = 50. For x, 30 + 40 = 70 ≥ 50 ✓; for y, 10 + 25 = 35 ≥ 50 ✗. If {A, B} leave together they get 50; they block y.
- {A, C}: v(AC) = 60. For x, 30 + 50 = 80 ≥ 60 ✓; for y, 10 + 85 = 95 ≥ 60 ✓.
- {B, C}: v(BC) = 70. For x, 40 + 50 = 90 ≥ 70 ✓; for y, 25 + 85 = 110 ≥ 70 ✓.
- {A, B, C}: total = 120. For x, 30 + 40 + 50 = 120 ✓; for y, 10 + 25 + 85 = 120 ✓.
Conclusion: the Shapley imputation x is in the core. y is outside the core, because {A, B} blocks it. Since the game is convex, the Shapley value being in the core is also consistent with what Theorem 10.3 leads us to expect.
| Coalition S | Constraint | x = (30, 40, 50) | y = (10, 25, 85) |
|---|---|---|---|
| {A} | Σ ≥ 10 | 30 ✓ | 10 ✓ |
| {B} | Σ ≥ 20 | 40 ✓ | 25 ✓ |
| {C} | Σ ≥ 30 | 50 ✓ | 85 ✓ |
| {A, B} | Σ ≥ 50 | 70 ✓ | 35 ✗ |
| {A, C} | Σ ≥ 60 | 80 ✓ | 95 ✓ |
| {B, C} | Σ ≥ 70 | 90 ✓ | 110 ✓ |
| {A, B, C} | total = 120 | 120 ✓ | 120 ✓ |
Table 10.18 summarizes the check of the two imputations. A single ✗ is enough to throw an imputation out of the core. To exclude an imputation from the core it suffices to find one blocking coalition; to show that it is in the core, all the constraints must be checked.
A shortcut check. If the upper bounds of 10.4.9 (xA ≤ 50, xB ≤ 60, xC ≤ 70) and the lower bounds (the stand-alone values) are known, an imputation that sums to 120 can be checked by comparing six numbers. For the proportional split (20, 40, 60), for example: 10 ≤ 20 ≤ 50, 20 ≤ 40 ≤ 60, 30 ≤ 60 ≤ 70. All hold; the proportional split is in the core as well. In the logistics game the core is wide, and three of the four proposals of Table 10.13 (equal, proportional, Shapley) are in the core. In this game the core does not select a single imputation; it only eliminates unacceptable ones.
10.4.12A game with an empty core: the majority game
In the logistics game the core was a wide hexagon. Not every game has a stable split of this kind.
Three agents will share a prize of 1 unit. If any two agents agree, they get the prize. The characteristic function is: v(S) = 1 if |S| ≥ 2, and 0 otherwise. This game is called the majority game.
- Write the constraints. The singleton constraints are xi ≥ 0. The pair constraints: xA + xB ≥ 1, xA + xC ≥ 1, xB + xC ≥ 1. Efficiency: xA + xB + xC = 1.
- Add the pair constraints. Each player appears in two constraints. The sum is 2(xA + xB + xC) ≥ 3, that is, xA + xB + xC ≥ 3/2.
- Contradiction. Efficiency requires the total to be exactly 1. But 1 < 3/2. No imputation can satisfy all three pair constraints at once: the core is empty.
- The Shapley value. The three players are symmetric; by the symmetry axiom they receive equal amounts, and by efficiency the total is 1. φ = (1/3, 1/3, 1/3). This split is fair, but each pair gets only 2/3 and could get 1 by leaving: it is not stable.
What an empty core means can be seen from a sequence of bargains. Suppose A and B agree and share the prize as (½, ½, 0). C, left out, offers A (0.6, 0, 0.4): A gets 0.6 instead of 0.5, C gets 0.4 instead of 0; both gain. Now B, left out this time, offers C (0, 0.3, 0.7): C gets 0.7 instead of 0.4, B gets 0.3 instead of 0. Now A is the one left out and can make B a better offer. In every split at least one pair gets at most 2/3 in total (because the three pairs sum to 2), and that pair wants to exclude the third and share the 1. The bargaining never ends.
The lesson: a stable split does not exist in every game. In that case the rule has to be relaxed. Instead of "no group can gain anything by leaving", one says "no group can gain too much by leaving". This idea is expressed by the ε-core: no coalition can gain more than ε by leaving, that is, Σi∈S xi ≥ v(S) − ε for every S. In the majority game the pair constraints become xi + xj ≥ 1 − ε. Adding the three gives 2 ≥ 3(1 − ε), that is, ε ≥ 1/3. For ε = 1/3 the imputation (1/3, 1/3, 1/3) satisfies every pair constraint with exact equality: 2/3 = 1 − 1/3. The set of imputations that make ε smallest is called the least core. The solution that continues this idea step by step and picks a single imputation in every game is called the nucleolus; in the majority game the nucleolus is also (1/3, 1/3, 1/3).
10.4.13Weighted voting and power indices
An important application of coalitional games is voting. In a parliament the parties' seat counts, in a company the partners' shareholdings, in a network the nodes' voting rights can differ. Does the one with more weight have more power? The answer is "not always".
A weighted voting game is written [q; w1, …, wn]. Here wi is the voting weight of i, and q is the quota needed for a decision to pass. If the total weight of a coalition reaches the quota, the coalition wins and v(S) = 1; otherwise it loses and v(S) = 0.
In an arrival order, the player who, together with those before it, raises the total from below the quota to the quota or above is called the pivotal player. A member of a winning coalition whose departure makes the coalition lose is called a critical (swing) member.
A player's power in voting is measured by how often it decides outcomes. Two classical indices measure this.
The Shapley–Shubik index (Shapley and Shubik, 1954) is the Shapley value of the weighted voting game. In a voting game the marginal contribution can only be 0 or 1: it is 1 if the player is the one who pushes the total past the quota, and 0 otherwise. So the Shapley value of i is the fraction of orders in which i is pivotal.
The Banzhaf index, by contrast, looks not at orders but at coalitions. In each winning coalition one counts which members are critical. A player's Banzhaf index is the ratio of its number of critical memberships to the sum of all players' critical memberships.
A parliament has 100 seats: party A has 50, party B has 49, and party C has 1. A simple majority, that is, 51 votes, is needed for a decision. The game is [51; 50, 49, 1].
- Winning coalitions. No party reaches 51 alone. The pairs: A + B = 99 ✓, A + C = 51 ✓, B + C = 50 ✗. All three together: 100 ✓. The winning coalitions are {A, B}, {A, C}, {A, B, C}.
- Shapley–Shubik: six orders. A → B → C: total 50 with A, 99 with B; pivotal B. A → C → B: 50 with A, 51 with C; pivotal C. B → A → C: 49 with B, 99 with A; pivotal A. B → C → A: 49 with B, 50 with C, 100 with A; pivotal A. C → A → B: 1 with C, 51 with A; pivotal A. C → B → A: 1 with C, 50 with B, 100 with A; pivotal A.
- The Shapley–Shubik index. A is pivotal in four orders, B in one, C in one: (4/6, 1/6, 1/6) = (2/3, 1/6, 1/6).
- Banzhaf: critical members. In {A, B}, if A leaves 49 remains, if B leaves 50 remains; both are critical. In {A, C}, if A leaves 1 remains, if C leaves 50 remains; both are critical. In {A, B, C}, if A leaves 50 remains (loses); if B leaves 51 remains (still wins); if C leaves 99 remains (still wins). Only A is critical.
- The Banzhaf index. The numbers of critical memberships are A 3, B 1, C 1; total 5. The index is (3/5, 1/5, 1/5).
Figure 10.15 shows how striking the result is. B and C differ by 48 seats, yet the two parties are equally powerful. Why? The only way to win is a coalition that includes A, and for A a single seat is enough to pass the quota. B's extra 48 seats do not change the outcome of any coalition. Power is measured not by weight but by the number of situations in which the player can change the outcome. Weight ≠ power.
The two indices give different numbers because they count different things. The Shapley–Shubik index cares about the order in which coalitions are built and models the process by which the grand coalition forms. The Banzhaf index ignores order; it counts every winning coalition equally. Both find A the strongest and B and C equal. In terms of ranking, then, the two indices agree in this game.
A historical example: the 1958 Council of Ministers of the EEC. At the founding of the European Economic Community, the votes in the Council of Ministers were distributed as follows: France, Germany, and Italy 4 each; Belgium and the Netherlands 2 each; Luxembourg 1. A qualified majority required 12 votes: the game is [12; 4, 4, 4, 2, 2, 1]. Luxembourg's vote could not change the outcome of any coalition. The reason is an even–odd observation: all weights other than Luxembourg's are even, so the total of every coalition without Luxembourg is even. Luxembourg's 1 vote could carry a coalition from below the quota to the quota only if the total were exactly 11; but 11 is odd, and no coalition can have a total of 11. So Luxembourg is never pivotal and its power is 0. The Shapley–Shubik index of the other countries is 7/30 for each of the big three and 3/20 for each of Belgium and the Netherlands.
10.4.14Code trace: power_index()
The Shapley–Shubik index is computed with simpler code than the code for the Shapley value: instead of looking up coalition values, the weights are added up and the player who passes the quota is recorded. The function takes three inputs: the player list N, the weight dictionary w = {"A": 50, "B": 49, "C": 1}, and the quota q = 51.
from itertools import permutations
def power_index(N, w, q):
pivots = {i: 0 for i in N}
orders = list(permutations(N))
for order in orders:
total = 0
for i in order:
total += w[i]
if total >= q:
pivots[i] += 1
break
return {i: pivots[i] / len(orders) for i in N}The code works line by line as follows.
pivots = {i: 0 for i in N}: The number of orders in which each player is pivotal starts at 0.orders = list(permutations(N)): All arrival orders (3! = 6) are generated.total = 0: Each order starts with the empty coalition, that is, 0 votes.total += w[i]: The weight of the arriving player is added to the total.if total >= q: If the total has reached the quota for the first time, the arriving player is pivotal;pivots[i]is increased by one.break: The pivot has been found in this order; the rest of the order does not matter. The inner loop is cut short and the next order begins. Each order has exactly one pivotal player.return {i: pivots[i] / len(orders) for i in N}: The pivot counts are divided by the number of orders.
| order | Running total | Pivot | pivots (A, B, C) |
|---|---|---|---|
| A → B → C | 50 < 51 → 99 ≥ 51 | B | (0, 1, 0) |
| A → C → B | 50 < 51 → 51 ≥ 51 | C | (0, 1, 1) |
| B → A → C | 49 < 51 → 99 ≥ 51 | A | (1, 1, 1) |
| B → C → A | 49 → 50 < 51 → 100 ≥ 51 | A | (2, 1, 1) |
| C → A → B | 1 < 51 → 51 ≥ 51 | A | (3, 1, 1) |
| C → B → A | 1 → 50 < 51 → 100 ≥ 51 | A | (4, 1, 1) |
Table 10.19, Figure 10.16, and Figure 10.17 show the trace. In the end pivots = {A: 4, B: 1, C: 1} and the function returns (2/3, 1/6, 1/6). B's 49 seats bring no more power than C's 1 seat. The break line of the trace is important: in the order B → C → A, the total is 50 when B and C have arrived; when A arrives it reaches 100 and A is pivotal. Without break, the code would also count as pivotal the players who arrive after the quota has been passed, and the result would be wrong.
10.4.15Common mistakes in coalitional games
Confusing the marginal contribution with the coalition value. In the order A → B → C, B's contribution is not v(AB) = 50 but v(AB) − v(A) = 40. The row total coming out to v(N) catches this mistake: 10 + 50 + 70 = 130 ≠ 120.
Computing the Shapley value from a single order. A single order gives the last arrival a large share. The order A → B → C gives C 70; the Shapley value is 50. The average over all orders must be taken.
Checking only the singleton constraints for the core. y = (10, 25, 85) satisfies all the singleton constraints, but {A, B} blocks it. Individual rationality is only one part of the core.
Assuming what is fair is stable. The Shapley value always exists, but it need not be in the core. In the majority game (1/3, 1/3, 1/3) is fair, but the core is empty and every pair wants to leave.
Taking weight for power. In [51; 50, 49, 1] the weight shares are (0.50, 0.49, 0.01), whereas the Shapley–Shubik index is (2/3, 1/6, 1/6). In the Luxembourg example, 1 vote brings no power at all.
Mixing up the two power indices. (3/5, 1/5, 1/5) is the Banzhaf index (critical memberships); (2/3, 1/6, 1/6) is the Shapley–Shubik index (pivotal orders). Whichever index the question asks for is the one to compute.
10.5The public goods game
In coalitional games it was assumed that binding agreements could be made. In many multi-agent systems there is no such agreement: each agent decides on its own how much to contribute to a common resource, and nobody can force it to contribute. The public goods game is the many-player version of the Prisoner's Dilemma. The game shows with numbers why the common good does not arise by itself.
10.5.1What is a public good?
A public good is a good with two properties:
- Non-excludability: nobody can be excluded from benefiting from the good. Those who do not contribute benefit too.
- Non-rivalry: one person's use does not reduce another's.
Open-source software is a good example. Whoever wrote the code and whoever did not can download and use the software (non-excludability). One person's use of the software does not reduce anyone else's (non-rivalry). Clean air and a shared dataset are also public goods. A loaf of bread, by contrast, is not a public good: someone who does not pay cannot get it, and bread eaten by one person cannot be eaten by another.
The problem with public goods arises from non-excludability. Since the good is open to everyone, each person may think: "Even if I do not contribute, others will, and I will benefit." If everyone thinks this way, nobody contributes and the good is never produced.
10.5.2The rules of the game
In the public goods game, each of n players starts with e tokens. Player i puts ki tokens, between 0 and e, into a common pool. The tokens in the pool are multiplied by a factor r and shared equally among the n players. Player i's payoff is
ui = e − ki + (r/n) · Σj kj
Here Σj kj is the total number of tokens put into the pool. r/n is the part of a token that returns to the contributor, and is called the marginal per-capita return (MPCR).
The payoff formula has two parts. e − ki is the tokens the player keeps in its pocket. (r/n) · Σ kj is the share it receives from the pool. This share depends not on the player's own contribution but on everyone's total contribution. A player who does not contribute receives the same share from the pool; non-excludability is built into the formula.
The example of the chapter uses these numbers: n = 4 players, each with e = 10 tokens, multiplier r = 1.6. The marginal per-capita return is r/n = 1.6/4 = 0.4. A contribution of one token has two separate consequences.
- Individual consequence
- For a player who contributes 1 token, 1 token leaves the pocket and 0.4 comes back from the pool. The net effect is −1 + 0.4 = −0.6.
- Social consequence
- The 1 token becomes 1.6 in the pool and is distributed to the four players at 0.4 each. The group's total payoff rises by −1 + 1.6 = +0.6.
The individual and social consequences have opposite signs. Contributing hurts the player but benefits the group. This is the essence of the dilemma.
Payoffs are computed in four scenarios (n = 4, e = 10, r = 1.6).
- Everyone gives 10. The pool is 40 · 1.6 = 64 and the per-person share is 64/4 = 16. Everyone gets 10 − 10 + 16 = 16. The group's total is 64.
- Nobody gives. The pool is 0. Everyone keeps the 10 in their pocket: 10 each, total 40.
- P1 free rides, the others give 10. 30 tokens enter the pool: 30 · 1.6 = 48, 12 per person. P1 gets 10 − 0 + 12 = 22, the others get 10 − 10 + 12 = 12. Total 22 + 3 · 12 = 58.
- Only P1 gives 10. 10 tokens enter the pool: 10 · 1.6 = 16, 4 per person. P1 gets 0 + 4 = 4, the others get 10 + 4 = 14. Total 4 + 3 · 14 = 46.
| Scenario | Σk | Pool × 1.6 | P1 | Others (each) | Total |
|---|---|---|---|---|---|
| Everyone 10 | 40 | 64 | 16 | 16 | 64 |
| Nobody | 0 | 0 | 10 | 10 | 40 |
| P1 free rides | 30 | 48 | 22 | 12 | 58 |
| Only P1 | 10 | 16 | 4 | 14 | 46 |
Table 10.20 shows the dilemma plainly. For P1 the best case is when the others give and P1 does not (22). The worst case is when the others do not give and P1 does (4). For the group, the best case is that everyone gives (64) and the worst is that nobody gives (40). The Total column shows one more rule: the group's total is n · e + (r − 1) · Σk = 40 + 0.6 · Σk. Every token that enters the pool raises the group's total by 0.6.
10.5.3Why free riding?
If P1's payoff is written in terms of the other three players' total contribution K,
u1 = 10 − k1 + 0.4 · (k1 + K) = 10 + 0.4K − 0.6 k1
results. If P1 gives one more token, 1 token leaves its pocket and 0.4 comes back from the pool: net −0.6. This value does not depend on K. Whatever the others do, every token P1 contributes costs P1 0.6.
If r/n < 1, then in the public goods game ki = 0 is a dominant strategy for every player, and the unique Nash equilibrium of the game is that everyone gives 0. If r > 1, this equilibrium is not Pareto optimal: everyone giving e yields more for every player.
Player i's payoff, with the others' total contribution K, is written ui = e + (r/n)K − (1 − r/n) ki. Since r/n < 1, the coefficient of ki, −(1 − r/n), is negative. So whatever K is, reducing ki raises the payoff, and the largest payoff is attained at ki = 0. This shows that giving 0 is a dominant strategy.
Since every player's dominant strategy is 0, the profile in which everyone gives 0 is a Nash equilibrium. There is no other equilibrium: if in some profile a player contributes a positive amount, that player strictly increases its payoff by lowering its contribution to 0.
At the equilibrium every player gets e. If everyone gives e, the pool becomes n · e · r and every player gets r · e. Since r > 1, r · e > e: everyone is better off. The equilibrium is not Pareto optimal. □
In the example, the only Nash equilibrium is that everyone gives 0, and the per-person payoff is 10. Yet if everyone gave 10, each would get 16. The equilibrium is not Pareto optimal. A player who benefits from the common good without contributing is called a free rider, and this behavior is called free riding.
Figure 10.18 draws the dilemma with two lines. The red line is P1's individual view: while the others give 10, u1 = 10 + 0.4 · 30 − 0.6k = 22 − 0.6k. Each token P1 gives lowers its payoff by 0.6; the best is not to give at all. The blue line is the group's view: if everyone gives k, u = 10 − k + 0.4 · 4k = 10 + 0.6k. Each token that everyone gives raises the per-person payoff by 0.6; the best is for everyone to give in full. The slopes of the two lines have opposite signs: the individual incentive (−0.6) and social welfare (+0.6) point in opposite directions. This is the n-person version of the Prisoner's Dilemma.
10.5.4When is there a dilemma?
The existence of the dilemma depends on two conditions. A contribution of one token returns r/n to the contributor and a total of r to the group.
- Individual condition: r/n < 1, that is, r < n. Contributing is individually harmful; not contributing is dominant.
- Social condition: r > 1, that is, r/n > 1/n. Each token raises the group's total by r − 1 > 0; contributing is socially beneficial.
The two conditions together, that is, 1 < r < n (equivalently 1/n < r/n < 1), form the dilemma. In the two cases outside the condition there is no dilemma.
Keep n = 4 and e = 10 fixed and vary r.
- r = 0.8 (r < 1). A contribution of one token returns 0.2 to the contributor (net −0.8) and changes the group's total by 0.8 − 1 = −0.2. Contributing harms both the individual and the group. Everyone giving 0 is both the equilibrium and the best for the group; there is no dilemma.
- r = 1.6 (1 < r < 4). The main example: individual −0.6, social +0.6. There is a dilemma.
- r = 4 (r = n). A contribution of one token returns exactly 1 to the contributor: net 0. The player's payoff does not change whether it contributes or not. Full contribution is weakly dominant: it is never worse. Socially, each token raises the group's total by 3.
- r = 6 (r > n). One token returns 6/4 = 1.5 to its giver: net +0.5. Full contribution is strictly dominant. The individual and social incentives point the same way; the dilemma disappears.
Example 10.14 gives a result that matters for design. One way to remove the dilemma is to raise the part of the contribution that returns to the individual above 1. Making the multiplier larger than the group size is often unrealistic for this purpose. But a reward tied to contribution (for example, priority for the contributor) creates the same effect: the contributor's personal return rises.
10.5.5Counterparts in multi-agent systems
The public goods game is not an abstract laboratory game; it has direct counterparts in multi-agent systems.
- File-sharing networks
- In a peer-to-peer (P2P) network, each peer downloads files and uploads files to others. Uploading uses bandwidth but benefits the network as a whole. A peer that only downloads without uploading is a free rider. If everyone behaves this way, no files remain in the network to be downloaded.
- Federated learning
- Many clients (phones, hospitals, companies) train a common machine learning model together (federated learning). Each client sends the update it has computed on its own data. Sending an update is costly in terms of processing, energy, and data privacy. A client that uses the common model without sending updates is a free rider.
- Shared computing and data pools
- A community builds a shared dataset or an open-source library. Many use it without contributing; the few who contribute carry the whole load.
The designers of these systems change the payoffs of the game in order to reduce free riding. Common ways are rewarding contribution (giving a peer that uploads a faster download right), excluding non-contributors (making the good partly excludable), or making the interaction repeated and keeping a reputation record. The common idea behind all of them is to turn the individual incentive in the same direction as social welfare by raising the individual return to contribution. This is the application of the incentive design principle of 10.2.6 to public goods.
10.5.6Common mistakes about public goods
Forgetting to multiply or to divide the pool. When everyone gives 10, the pool is 40 · 1.6 = 64 and it is divided by four: 16. Taking the whole pool (64) to be one player's payoff, or forgetting the multiplier and writing 40/4 = 10, are frequent mistakes.
Thinking the free rider gets no share of the pool. A public good is non-excludable. The free rider P1 also gets as much from the pool as the others (12); on top of that it keeps its 10 and reaches 22.
Thinking "if contributing is socially beneficial, individuals will contribute". The social return (+0.6) and the individual return (−0.6) are different. A rational individual looks only at its own return; this is the source of the dilemma.
Writing the dilemma condition wrongly. The dilemma exists when 1 < r < n. If r < 1, contributing harms the group as well; if r ≥ n, full contribution is (weakly) dominant. In both cases the individual and social incentives point the same way.
10.6Summary
- An agent is a system with autonomy, reactivity, pro-activeness, and social ability (Wooldridge and Jennings, 1995). A multi-agent system consists of several agents that perceive and act in the same environment; each agent's information is local. In game theory an agent is a rational player that maximizes its expected utility.
- The architecture (reactive, deliberative, BDI, learning, hybrid) describes the inside of the agent; game theory describes the interaction among agents.
- Systems can be cooperative (the problem is coordination), competitive (the problem is strategy), or mixed-motive. Three small games represent this spectrum: two equilibria in the coordination game, a single inefficient equilibrium in the Prisoner's Dilemma, and only the mixed equilibrium (½, ½) in Matching Pennies.
- Most real systems use hybrid control: agents decide autonomously, while a center sets the rules, prices, or tenders. A convention selects one equilibrium of a coordination game in advance; a common signal such as a traffic light yields a correlated equilibrium.
- The environment of learning agents is non-stationary; simultaneous best response can enter an endless cycle in the corridor game. Simple local rules produce emergent behavior (Schelling's segregation model).
- The contract net: announcement → bid → award. It is distributed and simple and needs O(n) messages per task, but it is greedy and sequential: in the example 18 min against an optimum of 13 min (38% more). The task order changes the result; re-tendering (swaps) reaches the optimum in two steps in the example.
- Trying all assignments takes n! work (3,628,800 at n = 10); the Hungarian algorithm is O(n3). If the winner is paid its own bid, the contractor inflates its cost; if the second-lowest bid is paid, an honest bid is best.
- The characteristic function v(S) gives the value of every coalition. In a superadditive game the grand coalition makes the total value largest; whether it stays together depends on the split. The number of coalition structures is the Bell number (5 for 3 agents, 15 for 4 agents, 115,975 for 10 agents).
- The Shapley value = the average marginal contribution; it is the only rule that satisfies the four axioms (efficiency, symmetry, dummy player, additivity). In the logistics example φ = (30, 40, 50). In the pairwise synergy model φi = stand-alone value + half of the synergies: (9, 6, 6) in the sample round of the game, with an equal-split error of 4.
- The core: imputations that no coalition wants to leave. In the logistics example it is a hexagon and contains the Shapley value (the game is convex). {A, B} blocks y = (10, 25, 85). In the majority game the core is empty; the least ε-core, with ε = 1/3, is (1/3, 1/3, 1/3).
- In weighted voting, power ≠ weight: in [51; 50, 49, 1] the Shapley–Shubik index is (2/3, 1/6, 1/6) and the Banzhaf index is (3/5, 1/5, 1/5). In the 1958 EEC Council, Luxembourg's power was 0.
- In the public goods game, if r/n < 1, not contributing is dominant: the equilibrium gives 10 per person, versus 16 if everyone contributes in full. The dilemma exists when 1 < r < n. A free rider (a peer that only downloads, a client that sends no updates) gains individually while the system loses.
| Concept | Description | Example |
|---|---|---|
| Coordination game | Several equally good equilibria; the problem is which one will be played | Corridor game; "everyone keeps right" |
| Contract net | Announcement, bid, award; greedy and sequential | 18 min; optimum 13 min |
| Shapley value | Average marginal contribution over all orders | (30, 40, 50); in the game (9, 6, 6) |
| Core | Imputations that no coalition blocks | hexagon; (10, 25, 85) outside |
| Empty core | No stable split | majority game |
| Power index | Share of pivotal orders or critical memberships | [51; 50, 49, 1]: (2/3, 1/6, 1/6) |
| Public goods game | If r/n < 1, not giving is dominant | equilibrium 10, optimum 16 |
10.7Key terms
- agent
- multi-agent system (MAS)
- autonomy
- reactivity
- pro-activeness
- social ability
- deliberative agent
- belief–desire–intention (BDI)
- mixed-motive
- coordination game
- convention / social law
- correlated equilibrium (CE)
- non-stationary
- fictitious play
- emergent behavior
- task allocation
- resource allocation
- Contract Net Protocol
- manager / contractor
- task announcement / bid / award
- greedy algorithm
- Hungarian algorithm
- re-tendering
- combinatorial auction
- coalition
- grand coalition
- coalition formation
- coalition structure
- Bell number
- characteristic function
- transferable-utility (TU) game
- superadditive
- imputation
- marginal contribution
- Shapley value
- efficiency axiom
- symmetry axiom
- dummy (null) player
- additivity
- core
- blocking coalition
- convex game
- balanced game
- Bondareva–Shapley theorem
- majority game
- ε-core
- nucleolus
- weighted voting game
- quota
- pivotal player
- critical (swing) member
- power index
- Shapley–Shubik index
- Banzhaf index
- public good
- public goods game
- marginal per-capita return (MPCR)
- free rider
- free riding
- tragedy of the commons
10.8Test Yourself
In a pure coordination game, (Right, Right) gives both players 2, (Left, Left) gives both 1, and different choices give 0. What are the pure Nash equilibria? In the mixed equilibrium, with what probability does each player choose Right, what is the expected payoff, and how does it compare with the payoffs of the pure equilibria?
Answer
The pure equilibria are (Right, Right) = (2, 2) and (Left, Left) = (1, 1); in both, a player who switches sides drops to 0. Mixed equilibrium: let Player 2 play Right with probability q. For Player 1, Right gives 2q and Left gives 1 − q; indifference 2q = 1 − q ⇒ q = 1/3. By symmetry p = 1/3. The expected payoff is 2 · (1/3)(1/3) + 1 · (2/3)(2/3) = 2/9 + 4/9 = 2/3. This is below both pure equilibria (2 and 1): the players often make mismatched choices. A convention ("everyone keeps right") raises the payoff to 2.
A manager puts tasks G1, G2, G3 out to tender in this order. Costs (min): for G1, R1 4, R2 5, R3 6; for G2, R1 2, R2 3, R3 6; for G3, R1 7, R2 4, R3 9. Each robot takes at most one task. What are the contract net's assignment and total? What is the centralized optimum, and by what percentage is the contract net above it?
Answer
G1: bids 4, 5, 6 → R1 (4). G2: R2 3, R3 6 → R2 (3). G3: only R3 remains → 9. Total 4 + 3 + 9 = 16 min. The six assignments: (R1, R2, R3) 16; (R1, R3, R2) 4 + 6 + 4 = 14; (R2, R1, R3) 5 + 2 + 9 = 16; (R2, R3, R1) 5 + 6 + 7 = 18; (R3, R1, R2) 6 + 2 + 4 = 12; (R3, R2, R1) 6 + 3 + 7 = 16. The optimum is 12 min: G1→R3, G2→R1, G3→R2. The contract net is (16 − 12)/12 ≈ 33% above it. The loss again comes from greediness: R1, which took G1, was the cheapest robot for G2 (2).
For one task, the robots' true costs are R1 5, R2 7, R3 9, and the lowest bid wins. (a) If the winner is paid its own bid, what is R1's gain with an honest bid, and what happens if R1 raises its bid to 6.5? (b) If the winner is paid the second-lowest bid, what does an honest R1 earn? (c) Under this rule, what happens if R2 bids 4 in order to get the job?
Answer
(a) With an honest bid R1 wins, receives 5, and its gain is 5 − 5 = 0. If it bids 6.5 (the others being honest), it is still the lowest bid; it wins and gains 6.5 − 5 = 1.5. Under this rule inflating pays. (b) R1 wins and receives the second-lowest bid, 7: gain 7 − 5 = 2. Any bid below 7 gives the same result. (c) R2 wins, but the payment is the second-lowest bid, R1's 5; since its cost is 7, its gain is 5 − 7 = −2. With an honest bid it loses and gets 0; honesty is better.
In a game with three agents, v(A) = 0, v(B) = 0, v(C) = 10, v(AB) = 30, v(AC) = 40, v(BC) = 40, v(ABC) = 60. What is the Shapley value computed over the six orders? Is the game superadditive? Is it convex?
Answer
Marginal contributions (A, B, C): A→B→C (0, 30, 30); A→C→B (0, 20, 40); B→A→C (30, 0, 30); B→C→A (20, 0, 40); C→A→B (30, 20, 10); C→B→A (20, 30, 10). Totals A 100, B 100, C 160; φ = (100/6, 100/6, 160/6) = (50/3, 50/3, 80/3) ≈ (16.67, 16.67, 26.67), total 60 ✓. It is superadditive: 30 ≥ 0, 40 ≥ 10, 40 ≥ 10, and every pair plus a singleton is at most 40 + 0 = 40 or 30 + 10 = 40, which does not exceed 60. It is not convex: A's contribution to {B} is 30, while its contribution to the larger {B, C} is 60 − 40 = 20; the contribution fell as the coalition grew.
In the game of Question 4, is the Shapley value in the core? Are the imputations (20, 20, 20) and (30, 10, 20) in the core? Which coalition blocks the one that falls outside?
Answer
Upper bounds xi ≤ v(N) − v(N ∖ {i}): xA ≤ 60 − 40 = 20, xB ≤ 20, xC ≤ 60 − 30 = 30; lower bounds 0, 0, 10. The Shapley value (16.67, 16.67, 26.67) is within all the bounds: it is in the core. Although the game is not convex, the Shapley value is in the core; convexity is a sufficient condition, not a necessary one. (20, 20, 20): within the bounds (A and B exactly at the upper bound), so it is in the core. (30, 10, 20): xA = 30 > 20; {B, C} get only 10 + 20 = 30 < 40 and would leave and share 40. {B, C} blocks.
The weighted voting game is [7; 4, 3, 2, 1] (A 4, B 3, C 2, D 1). What are the winning coalitions, the Banzhaf index, and the Shapley–Shubik index? How do the powers of C and D compare?
Answer
The total weight is 10. Winning coalitions: AB (7), ABC (9), ABD (8), ACD (7), ABCD (10). The best coalition without A is BCD = 6 < 7, so A is in every winning coalition. Critical memberships: in AB, A and B; in ABC, A and B (if C leaves, 7 remains); in ABD, A and B; in ACD, A, C, and D; in ABCD, A. The counts are A 5, B 3, C 1, D 1, total 10: Banzhaf (1/2, 3/10, 1/10, 1/10). Shapley–Shubik (24 orders): pivot counts A 14, B 6, C 2, D 2 ⇒ (7/12, 1/4, 1/12, 1/12). For example, C is pivotal only if exactly A and D come before it (total 5); this happens in 2! · 1! = 2 orders. C's weight is twice D's, but their powers are equal in both indices.
In a public goods game, n = 3, e = 20, r = 1.5. What are the payoffs if everyone gives 20, if nobody gives, and if P1 free rides while the others give 20? What are the marginal per-capita return and the individual and social net effects of one token? Is there a dilemma?
Answer
Everyone gives 20: the pool is 60 · 1.5 = 90, 30 per person; everyone gets 30. Nobody gives: everyone gets 20. P1 free rides: the pool is 40 · 1.5 = 60, 20 per person; P1 gets 20 + 20 = 40, the others get 0 + 20 = 20. MPCR r/n = 0.5: a contribution of one token has a net effect of −1 + 0.5 = −0.5 on the individual and −1 + 1.5 = +0.5 on the group. Since 1 < 1.5 < 3, there is a dilemma: not giving is dominant, and the equilibrium is 20 per person, versus 30 if everyone gives.
Four agents will share a prize of 1 unit; if at least three agents agree, they get the prize: v(S) = 1 if |S| ≥ 3, and 0 otherwise. Is the core empty? What is the Shapley value?
Answer
There are four triple constraints: the shares of every triple sum to at least 1. Each agent is in three of the four triples; adding the constraints gives 3(xA + xB + xC + xD) ≥ 4, that is, total ≥ 4/3. But the total must be 1: the core is empty. The four agents are symmetric; by symmetry and efficiency φ = (1/4, 1/4, 1/4, 1/4). Every triple gets only 3/4 under this split and would like to exclude the fourth and share the 1.
10.9Further reading
- M. Wooldridge, An Introduction to MultiAgent Systems (2nd edition, 2009): the standard textbook that presents the agent concept, agent architectures (reactive, BDI, hybrid), communication protocols such as the contract net, and coalition formation from a computer engineering viewpoint with little mathematics.
- G. Chalkiadakis, E. Elkind, and M. Wooldridge, Computational Aspects of Cooperative Game Theory (2011): a short, well-organized book that studies the characteristic function, the Shapley value, the core, the nucleolus, and weighted voting games from the viewpoint of computational complexity.
- A. R. Karlin and Y. Peres, Game Theory, Alive (2017), the chapter on coalitions and the Shapley value: gives the Shapley axioms and the uniqueness proof step by step with many examples.
- Y. Shoham and K. Leyton-Brown, Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations (2009), Chapter 12: presents the solution concepts of cooperative game theory (the core, the Shapley value, the nucleolus) and the Bondareva–Shapley theorem formally; the PDF of the book is published free of charge on the authors' website.
10.10References
- O. N. Bondareva, “Some applications of linear programming methods to the theory of cooperative games”, Problemy Kibernetiki 10, 1963.
- G. Chalkiadakis, E. Elkind, M. Wooldridge, Computational Aspects of Cooperative Game Theory, Morgan & Claypool, 2011.
- G. de Clippel, K. Rozen, “Fairness through the lens of cooperative game theory: An experimental approach”, American Economic Journal: Microeconomics 14(3), 2022.
- FIPA, Contract Net Interaction Protocol Specification (SC00029H), 2002.
- D. B. Gillies, “Solutions to general non-zero-sum games”, Contributions to the Theory of Games IV, Princeton, 1959.
- A. R. Karlin, Y. Peres, Game Theory, Alive, American Mathematical Society, 2017.
- N. Nisan, T. Roughgarden, É. Tardos, V. Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007 (Chapter 15: cost sharing, the core, and the Shapley value).
- C. W. Reynolds, “Flocks, herds and schools: A distributed behavioral model”, SIGGRAPH '87, 1987.
- T. Sandholm, K. Larson, M. Andersson, O. Shehory, F. Tohmé, “Coalition structure generation with worst case guarantees”, Artificial Intelligence 111, 1999.
- T. C. Schelling, “Dynamic models of segregation”, Journal of Mathematical Sociology 1(2), 1971.
- L. S. Shapley, “A value for n-person games”, Contributions to the Theory of Games II, Princeton, 1953.
- L. S. Shapley, “On balanced sets and cores”, Naval Research Logistics Quarterly 14(4), 1967.
- L. S. Shapley, “Cores of convex games”, International Journal of Game Theory 1, 1971.
- L. S. Shapley, M. Shubik, “A method for evaluating the distribution of power in a committee system”, American Political Science Review 48(3), 1954.
- Y. Shoham, K. Leyton-Brown, Multiagent Systems: Algorithmic, Game-Theoretic, and Logical Foundations, Cambridge University Press, 2009 (Chapter 12).
- R. G. Smith, “The contract net protocol: High-level communication and control in a distributed problem solver”, IEEE Transactions on Computers C-29(12), 1980.
- M. Wooldridge, An Introduction to MultiAgent Systems, 2nd edition, Wiley, 2009.
- M. Wooldridge, N. R. Jennings, “Intelligent agents: Theory and practice”, Knowledge Engineering Review 10(2), 1995.
Related pages: Chapter 10 slides · Course pages: N. Shah, CSC304 (Toronto) · A. Procaccia, 15-896 (CMU) · T. Roughgarden, CS364A (Stanford) · M. Hoefer, AGT (Frankfurt) · © Sercan Külcü. All rights reserved.