Algorithmadvanced
Moulin mechanism
Also called Moulin-Shenker mechanism.
Drops every player whose bid is below its cross-monotonic cost share and repeats until all can pay. It is group strategyproof and budget balanced.
- Time
- O(n (n + t)) worst
- Space
- O(n) extra
- Where
- n = the number of players; t = the time to compute the shares of one set
- Model
- Word RAM
- Properties
- deterministicexactofflineiterative
- Evidence
- Proof sketchCode in 1 languages
- Origin
- Herve Moulin, Scott Shenker, 1999
The Moulin mechanism decides which players to serve and what to charge them when a shared service has a cost and each player has a private value for it. It takes a cost-sharing method that says what each player of a set would pay if exactly that set were served. Starting with all players, it removes every player whose bid is below its share, recomputes the shares for the smaller set, and repeats until every remaining player can pay. If the method is cross-monotonic, so that no share goes up when the set grows, then the mechanism is group strategyproof: no group of players can lie in a way that helps one member and hurts none. If the method covers the cost exactly, the mechanism is also budget balanced. Moulin defined it in 1999.
In plain words
A group must decide who gets a shared service, such as a road or a data stream, and how to split its cost. Each person says how much the service is worth to them. The organizer proposes a price for each person, based on who is still in. Anyone who said less than their price is out. With fewer people, the prices may go up, so the organizer checks again and removes more people. This stops when everyone left accepts their price. The people left are served and pay their final prices. If prices never go down when someone leaves, nobody can gain by lying, not even a group of friends who agree on what to say. The payments cover the cost of serving the people who stay.
The problem
There is a set of players and a cost function with , where is the cost of serving the set . Player has a private value for being served. A cost-sharing mechanism collects bids , chooses a set to serve and charges payments . The utility of player is if and otherwise, which is quasilinear. The goals are:
- Group strategyproofness. For every coalition and every way the members of change their bids, if no member of is worse off, then no member is better off.
- Budget balance. The payments cover the cost, , with for exact budget balance. This page uses this form of -budget balance; some papers divide by instead and write .
- Participation. No positive transfers (), voluntary participation (a truthful player has utility at least 0), and consumer sovereignty (a high enough bid guarantees service).
The mechanism uses a cost-sharing method , which gives a share to each for each nonempty set . The method is cross-monotonic if for , and -budget balanced if for every .
The algorithm
MOULIN(A, b, ξ)- 1
S ← A - 2
repeat: - 3
D ← {i ∈ S : b_i < ξ(i, S)} - 4
S ← S \ D - 5
until D = ∅ - 6
p_i ← ξ(i, S) for i ∈ S; p_i ← 0 for i ∉ S - 7
return S, p
Line L1 starts with all players. Each round computes the shares of the current set once, and line L3 finds the players who bid less than their share. Line L4 removes them. Removing players can raise the shares of the others, so the loop runs again until a round removes nobody (line L5). Line L6 charges each served player its share in the final set, and the others pay nothing.
With a cross-monotonic method, a player who can afford its share in some set can afford its share in every larger set. So a player who belongs to an affordable set is never removed, and the loop ends at the largest set in which every member can pay its share. This set is unique, and the order of removals does not change it. Removing all short bidders at once, as in line L3, or one at a time gives the same result.
Example
Three planes share a runway. Plane needs length , with , and , and the cost of a set is the longest length it needs, . This is an airport game. The method is the Shapley value of the game restricted to : each segment of the runway is split equally among the planes of that need it. This method is cross-monotonic, because each segment is shared by more planes when the set grows, and it is budget balanced.
The bids are .
| round | shares | removed | |
|---|---|---|---|
| 1 | {1, 2, 3} | , , | 2, since |
| 2 | {1, 3} | , | none |
Planes 1 and 3 are served and pay 1 and 5, and the payments sum to . The removal of plane 2 raised both other shares, from to 1 and from to 5, but both planes could still pay. If plane 2 bids 2 instead, nobody is removed in round 1, all three planes are served, and plane 2 pays .
The removed plane cannot gain by a higher bid: to be served it must pay at least , which is more than its value if it bid truthfully. Planes 1 and 3 cannot lower their payments by bidding less, because their payments depend only on the served set, and a lower bid can only remove players and raise the shares.
Correctness
The file proofs/correctness.md gives the full proof. Call a set affordable if for every . By cross-monotonicity, the union of two affordable sets is affordable, so there is a unique largest affordable set . The loop never removes a member of , since its share in any superset of is at most its share in , and the final set is affordable. So the mechanism serves exactly (Nisan et al. 2007, Proposition 15.15).
For group strategyproofness, let a coalition change its bids from the true values to , and let and . Assume no member of loses. A member of served under then has value at least its share in , and a player outside bids truthfully. So every player of can pay its share in at the true values, and is affordable for . Hence . By cross-monotonicity, every share in is at least the share in , so no member of gains. This is Theorem 15.16 of Nisan et al. (2007).
Budget balance holds because the payments are the shares of the served set. Voluntary participation holds because the served set is affordable, and consumer sovereignty holds because a player who bids at least its share in can join any affordable set.
Proof: The Moulin mechanism serves the unique largest affordable set and is group strategyprooffull
Setting. is a finite set of players and is a cost function with . A cost-sharing method gives each nonempty and each a share . It is cross-monotonic if whenever . It is -budget balanced if for every nonempty ; is exact budget balance. Player has a private value for being served and reports a bid . If the mechanism serves the set and charges , the utility of player is if and otherwise.
The mechanism (lines L1 to L7) starts with , removes every with , repeats until nobody is removed, serves the final , charges for and for . Assume from here that is cross-monotonic.
Definition. For bids , a set is affordable if for every . The empty set is affordable.
Lemma 1. The union of two affordable sets is affordable. So there is a unique largest affordable set , the union of all affordable sets.
Proof. Let and be affordable and , say . By cross-monotonicity, .
Lemma 2. The mechanism stops after at most rounds and serves exactly .
Proof. Each round other than the last removes at least one player, so there are at most rounds. We show that holds before every round. It holds at the start, since . Assume and let . Cross-monotonicity gives , so line L3 does not remove , and holds after line L4. In the last round nobody is removed, so every has , and is affordable. Then , so .
Lemma 2 also shows that the order of removals does not matter: removing one player at a time, or all at once, gives the same set.
Lemma 3 (participation and budget).
- No positive transfers: for all .
- Voluntary participation: a served player pays at most its bid, and an unserved player pays 0. So a truthful player has .
- Consumer sovereignty: a player who bids is served, whatever the other bids are.
- Budget balance: the payments sum to , which is between and for a -budget balanced method.
Proof. Items 1 and 4 hold because the payments are shares of the served set. For item 2, the served set is affordable by Lemma 2. For item 3, let . Every has , and , both by cross-monotonicity. So is affordable, and by Lemma 1.
Theorem (group strategyproofness). Let be the true values and let be a coalition. Let agree with outside . Let be the utility of when everyone bids truthfully, and the utility of under . If for every , then for every . So no coalition can misreport in a way that helps one of its members and hurts none.
Proof. Let be the served set under the true values and the served set under . Assume for all .
Step 1: . We show that is affordable for the bids . Let .
- If , then , because is affordable for .
- If , then , because is affordable for .
- If , then by Lemma 3, item 2. So .
In each case the second inequality is cross-monotonicity. So is affordable for , and by Lemma 1. Hence .
Step 2: no member gains. Let .
- If , then by Step 1, and by cross-monotonicity, since . So .
- If and , then , by Lemma 3, item 2.
- If and , then .
So for every . Together with the assumption, .
With the theorem says that truthful bidding is a dominant strategy, so the mechanism is also dominant-strategy incentive compatible.
Cost. By Lemma 2 there are at most rounds. Each round computes the shares of one set once and compares bids. If one call of the method takes time , the total time is .
Remark. The tests in impl/python/test_moulin_mechanism.py compare the served set with the union of all affordable sets found by brute force on 500 random coverage cost functions with Shapley shares, check items 1 to 4 of Lemma 3, and check the theorem by brute force over every coalition and every misreport on a grid of 5 bids for an airport game with 3 players, including the bids equal to the shares. They also check that a method that is not cross-monotonic (Bird's rule on a small spanning tree game) gives a profitable lie.
Complexity
Each round except the last removes at least one player, so there are at most rounds. A round computes the shares of one set and compares at most bids. If one call of the method takes time , the total time is , with extra space for the current set and the payments. The cost of the method dominates for many problems. For the airport game the shares take time; for a Steiner tree method such as Jain-Vazirani cost sharing each call runs a primal-dual algorithm. For a general cost function given by an oracle, the Shapley value needs the costs of exponentially many sets.
Properties
- Group strategyproof if the method is cross-monotonic. In particular, truthful bidding is a dominant strategy, so the mechanism is dominant-strategy incentive compatible.
- -budget balanced if the method is. The payments are exactly the shares of the served set.
- No positive transfers, voluntary participation and consumer sovereignty, for every cross-monotonic method with nonnegative shares.
- Not efficient. The served set need not maximize total value minus cost. Let for every nonempty , with equal shares, and let the values be . In round 1 the shares are , so players 2 and 3 leave. Then player 1 alone has share 1 and leaves too. Nobody is served, although serving all three gives a surplus of . This loss is not a defect of the method: by the Green-Laffont theorem, no strategyproof mechanism is both efficient and budget balanced in general.
- Bounded efficiency loss for submodular costs. For a submodular cost, the Shapley value is cross-monotonic and budget balanced. Roughgarden and Sundararajan (2009) showed that the Shapley value mechanism then has social cost (the cost of the served set plus the values of the excluded players) at most times the optimum, where is the th harmonic number.
Variants and improvements
- Shapley value mechanism. For submodular costs, the method is the Shapley value of the cost function restricted to the current set. Moulin and Shenker (2001) compared it with the marginal cost mechanism, which is efficient but not budget balanced.
- Approximate budget balance. For hard problems, the exact cost is not available, and the method is only -budget balanced for some , relative to the optimal cost. For Steiner tree, Jain-Vazirani cost sharing gives a cross-monotonic 2-budget balanced method. Roughgarden and Sundararajan (2009) showed that its Moulin mechanism has social cost within of the optimum for players, and that no Moulin mechanism with constant budget balance for Steiner tree does better than .
- Limits of cross-monotonicity. For some problems, every cross-monotonic method recovers only a small fraction of the cost, and group strategyproof mechanisms that are not Moulin mechanisms exist when the cost is not submodular (Immorlica, Mahdian and Mirrokni 2008).
- Strategyproof but not group strategyproof. The VCG mechanism with the Clarke pivot rule chooses the efficient set, but it can run a deficit and is not group strategyproof.
When to use it
Use the Moulin mechanism when a service with a shared cost is offered to players with private values, the payments must cover the cost, and collusion among players is a concern. It needs a cross-monotonic cost-sharing method for the problem. Such methods exist for submodular costs (the Shapley value), for the airport game, for public goods with a fixed cost (equal split), and with approximate budget balance for Steiner trees and facility location. Do not use it when efficiency matters more than budget balance, or when no cross-monotonic method with a useful budget balance factor is known for the problem.
Pitfalls
- A method that is not cross-monotonic. The proof needs cross-monotonicity at every step. With Bird's rule on a spanning tree game whose shares are , and on , and , and on , a player 2 with value 2 is not served when it bids truthfully against bids 8 and 0. If it bids 4, it is served at price 1 and gains 1.
- Inexact arithmetic. Line L3 compares a bid with a share. With floating point shares, a player whose bid equals its share can be removed by a rounding error, which changes the outcome. Use exact rationals, as the code does.
- Ties. The mechanism serves a player whose bid equals its share. Any fixed rule for ties keeps the proof, but the bid grid in a test must include the share values to check this case.
- Payments from the wrong set. Each served player pays its share in the final set, not in the set of an earlier round. The shares of earlier rounds are smaller, and using them breaks budget balance.
- Group strategyproofness is not efficiency. A group strategyproof, budget balanced mechanism can serve nobody when serving everyone is better, as in the example under Properties.
Implementations
Each implementation follows the pseudocode above. A comment @line links a line of code to a line of the pseudocode. Point at a line of the pseudocode to see the matching code. The build runs the native tests of each language.
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/moulin-mechanism/. The authors are listed in prov/ZZQA5X.jsonl.
"""The Moulin mechanism (Moulin 1999, Moulin and Shenker 2001).
The input is a set of players, their bids, and a cost-sharing method xi. The method maps a
set S of players to the share xi(i, S) of each i in S. The mechanism starts with all players,
drops every player whose bid is below its share, and repeats with the smaller set until all
remaining players can pay. It serves the final set S and charges xi(i, S). If xi is
cross-monotonic (no share rises when the set grows), the mechanism is group strategyproof.
The method is given as a function from a frozenset S to a dict {i: xi(i, S)}. Shares and bids
should be Fraction or int, so that the comparison b_i < xi(i, S) is exact.
Three cross-monotonic methods are included as examples: equal split of a fixed cost, the
Shapley value of an airport game, and the Shapley value of a weighted coverage cost.
"""
from fractions import Fraction
def moulin(players, bids, xi):
"""Return (served, payments): the served set as a frozenset and a dict of payments."""
players = list(players)
served = frozenset(players) # @line L1
while True: # @line L2
shares = xi(served)
drop = {i for i in served if bids[i] < shares[i]} # @line L3
served = served - drop # @line L4
if not drop: # @line L5
break
payments = {i: (shares[i] if i in served else Fraction(0)) for i in players} # @line L6
return served, payments # @line L7
def equal_split(total):
"""Equal split of a fixed cost: C(S) = total for nonempty S, xi(i, S) = total / |S|."""
total = Fraction(total)
def xi(S):
return {i: total / len(S) for i in S}
return xi
def airport_shapley(lengths):
"""The Shapley value of the airport game C(S) = max of lengths[i] over i in S.
Each segment of the runway is split equally among the players of S that need it."""
lengths = {i: Fraction(r) for i, r in lengths.items()}
def xi(S):
order = sorted(S, key=lambda i: (lengths[i], i))
out, acc, prev = {}, Fraction(0), Fraction(0)
for k, i in enumerate(order):
acc += (lengths[i] - prev) / (len(order) - k)
prev = lengths[i]
out[i] = acc
return out
return xi
def coverage_shapley(covers, weights):
"""The Shapley value of the coverage cost C(S) = total weight of the elements covered by S.
covers[i] is the set of elements that player i needs; each element's weight is split
equally among the players of S that need it."""
weights = {e: Fraction(w) for e, w in weights.items()}
def xi(S):
count = {}
for i in S:
for e in covers[i]:
count[e] = count.get(e, 0) + 1
return {i: sum((weights[e] / count[e] for e in covers[i]), Fraction(0)) for i in S}
return xi
def coverage_cost(covers, weights, S):
"""C(S) for the coverage cost."""
needed = set()
for i in S:
needed |= set(covers[i])
return sum((Fraction(weights[e]) for e in needed), Fraction(0))
test_moulin_mechanism.py 179 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/moulin-mechanism/. The authors are listed in prov/ZZQA5X.jsonl.
"""Tests for moulin_mechanism: the worked example, the unique maximal feasible set,
budget balance, the participation properties, and group strategyproofness by brute force."""
import itertools
import random
import unittest
from fractions import Fraction as F
from moulin_mechanism import (airport_shapley, coverage_cost, coverage_shapley, equal_split,
moulin)
def subsets(players):
players = list(players)
for r in range(len(players) + 1):
for T in itertools.combinations(players, r):
yield frozenset(T)
def maximal_feasible(players, bids, xi):
"""Brute force: the union of all sets T with bids[i] >= xi(i, T) for every i in T."""
union = frozenset()
feasible = []
for T in subsets(players):
if not T:
continue
sh = xi(T)
if all(bids[i] >= sh[i] for i in T):
feasible.append(T)
union |= T
return union, feasible
def is_cross_monotonic(players, xi):
for T in subsets(players):
if not T:
continue
tt = xi(T)
for S in subsets(T):
if S:
ss = xi(S)
if any(ss[i] < tt[i] for i in S):
return False
return True
def utility(values, served, pay, i):
return (values[i] if i in served else 0) - pay[i]
def gsp_violation(players, values, xi, grid, coalitions_misreports):
"""Return a profitable group deviation, or None."""
served, pay = moulin(players, values, xi)
for C, lies in coalitions_misreports:
for lie in lies:
bids = dict(values)
bids.update(zip(C, lie))
s2, p2 = moulin(players, bids, xi)
gain = [utility(values, s2, p2, i) - utility(values, served, pay, i) for i in C]
if all(g >= 0 for g in gain) and any(g > 0 for g in gain):
return C, lie
return None
def random_coverage(rng, n):
elems = list(range(5))
covers = {i: set(e for e in elems if rng.random() < 0.5) or {rng.choice(elems)} for i in range(n)}
weights = {e: rng.randint(1, 6) for e in elems}
return covers, weights
class TestMoulin(unittest.TestCase):
def test_worked_example(self):
xi = airport_shapley({1: 2, 2: 4, 3: 6})
self.assertEqual(xi(frozenset({1, 2, 3})), {1: F(2, 3), 2: F(5, 3), 3: F(11, 3)})
served, pay = moulin([1, 2, 3], {1: F(1), 2: F(3, 2), 3: F(5)}, xi)
self.assertEqual(served, frozenset({1, 3}))
self.assertEqual(pay, {1: 1, 2: 0, 3: 5})
served, pay = moulin([1, 2, 3], {1: F(1), 2: F(2), 3: F(5)}, xi)
self.assertEqual(served, frozenset({1, 2, 3}))
self.assertEqual(pay[2], F(5, 3))
def test_public_good(self):
xi = equal_split(1)
served, pay = moulin([1, 2, 3], {1: F(6, 10), 2: F(4, 10), 3: F(3, 10)}, xi)
self.assertEqual(served, frozenset())
self.assertEqual(set(pay.values()), {0})
served, pay = moulin([1, 2, 3], {1: F(6, 10), 2: F(1, 2), 3: F(3, 10)}, xi)
self.assertEqual(served, frozenset({1, 2}))
self.assertEqual(pay, {1: F(1, 2), 2: F(1, 2), 3: 0})
def test_edge_cases(self):
self.assertEqual(moulin([], {}, equal_split(1)), (frozenset(), {}))
served, pay = moulin([7], {7: F(1)}, equal_split(1))
self.assertEqual((served, pay), (frozenset({7}), {7: 1}))
served, _ = moulin([7], {7: F(99, 100)}, equal_split(1))
self.assertEqual(served, frozenset())
def test_maximal_set_and_budget_balance(self):
rng = random.Random(11)
for _ in range(500):
n = rng.randint(1, 5)
covers, weights = random_coverage(rng, n)
xi = coverage_shapley(covers, weights)
players = list(range(n))
self.assertTrue(is_cross_monotonic(players, xi))
bids = {i: F(rng.randint(0, 24), 4) for i in players}
served, pay = moulin(players, bids, xi)
union, feasible = maximal_feasible(players, bids, xi)
self.assertEqual(served, union)
if served:
self.assertIn(served, feasible)
self.assertEqual(sum(pay.values()), coverage_cost(covers, weights, served))
for i in players:
self.assertGreaterEqual(pay[i], 0)
if i in served:
self.assertLessEqual(pay[i], bids[i])
else:
self.assertEqual(pay[i], 0)
big = max(xi(frozenset({i}))[i] for i in players)
for i in players:
b2 = dict(bids)
b2[i] = big
self.assertIn(i, moulin(players, b2, xi)[0])
def test_group_strategyproof_exhaustive(self):
players = [1, 2, 3]
xi = airport_shapley({1: 2, 2: 4, 3: 6})
grid = [F(0), F(2, 3), F(5, 3), F(4), F(6)]
plan = []
for r in (1, 2, 3):
for C in itertools.combinations(players, r):
plan.append((C, list(itertools.product(grid, repeat=r))))
for vals in itertools.product(grid, repeat=3):
values = dict(zip(players, vals))
self.assertIsNone(gsp_violation(players, values, xi, grid, plan))
def test_group_strategyproof_random(self):
rng = random.Random(5)
players = [0, 1, 2]
grid = [F(k, 2) for k in range(9)]
for _ in range(8):
covers, weights = random_coverage(rng, 3)
xi = coverage_shapley(covers, weights)
plan = []
for r in (1, 2, 3):
for C in itertools.combinations(players, r):
lies = list(itertools.product(grid, repeat=r))
if r == 3:
lies = rng.sample(lies, 60)
plan.append((C, lies))
for _ in range(4):
values = {i: rng.choice(grid) for i in players}
self.assertIsNone(gsp_violation(players, values, xi, grid, plan))
def test_not_cross_monotonic_breaks_truthfulness(self):
table = {
frozenset({1}): {1: F(8)}, frozenset({2}): {2: F(9)}, frozenset({3}): {3: F(7)},
frozenset({1, 2}): {1: F(8), 2: F(1)}, frozenset({1, 3}): {1: F(8), 3: F(7)},
frozenset({2, 3}): {2: F(4), 3: F(7)}, frozenset({1, 2, 3}): {1: F(1), 2: F(4), 3: F(7)},
frozenset(): {},
}
xi = table.__getitem__
self.assertFalse(is_cross_monotonic([1, 2, 3], xi))
values = {1: F(8), 2: F(2), 3: F(0)}
served, pay = moulin([1, 2, 3], values, xi)
self.assertEqual(served, frozenset({1}))
lie = dict(values)
lie[2] = F(4)
served2, pay2 = moulin([1, 2, 3], lie, xi)
self.assertEqual(served2, frozenset({1, 2}))
self.assertEqual(utility(values, served2, pay2, 2), 1)
self.assertEqual(utility(values, served, pay, 2), 0)
if __name__ == "__main__":
unittest.main()
History
Moulin (1999) introduced the mechanism for a cross-monotonic cost-sharing method and proved that it is coalition strategyproof. For submodular costs he showed that these mechanisms are the budget balanced, group strategyproof mechanisms that satisfy the participation conditions. Moulin and Shenker (2001) studied the trade-off between budget balance and efficiency for submodular costs and compared the Shapley value mechanism with the marginal cost mechanism. Computer scientists then applied the mechanism to multicast and network design. Jain and Vazirani (2001) gave a cross-monotonic method for Steiner trees, and later work found methods for facility location and other problems and measured their efficiency loss (Roughgarden and Sundararajan 2009).
References
- Incremental cost sharing: characterization by coalition strategy-proofness, the mechanism defined by a cross-monotonic cost-sharing method, its coalition strategyproofness, and the characterization for submodular costs
- Strategyproof sharing of submodular costs: budget balance versus efficiency, the Shapley value mechanism for submodular costs, compared with the marginal cost mechanism, and its efficiency loss
- Noam Nisan, Tim Roughgarden, Eva Tardos and Vijay V. Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007, Chapter 15 (Kamal Jain and Mohammad Mahdian, Cost Sharing), Section 15.3, Proposition 15.15 and Theorem 15.16
- Quantifying inefficiency in cost-sharing mechanisms, Tim Roughgarden and Mukund Sundararajan, Journal of the ACM 56(4), Article 23, 2009, the social cost approximation of the Shapley value mechanism for submodular costs and the bounds for Steiner tree mechanisms
Where this leads
About this page
The build computes these levels from the evidence in the repository. Each row says what the next level needs. Read what the levels mean.
| Ladder | Level | What the next level needs |
|---|---|---|
| Human proof | H1 sketch |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W2 basic |
|
Tag ZZQA5X Edit this page History Report an error Markdown