Definitionadvanced
Affine maximizer
Also called weighted VCG mechanism.
A mechanism that maximizes a weighted sum of reported values, with positive weights per agent, plus a constant per outcome over a fixed range. Weighted VCG payments make it DSIC.
An affine maximizer chooses, from a fixed range of outcomes, one that maximizes a weighted sum of the agents' reported values plus a fixed bonus for each outcome. The weights are positive and the bonuses do not depend on the reports, so payments in the style of VCG make it DSIC. VCG itself is the affine maximizer with all weights 1, no bonuses and the full range, and a maximal-in-range mechanism is the case with weights 1 and a restricted range. Roberts' theorem says that on the unrestricted domain with at least three outcomes in the range, affine maximizers are the only deterministic DSIC rules.
Definition
Let be a finite set of outcomes and let there be agents with quasilinear utilities, each reporting a valuation . Fix
- a nonempty range ,
- a weight for each agent ,
- a constant for each .
The affine maximizer with these parameters picks
with a fixed tie-breaking order on . Its payments are
where is any function that does not depend on . The Clarke-style choice is , the best score that the others and the constants can reach alone.
Why it is DSIC. An agent with true valuation who reports gets the utility
The term does not depend on the report, and . The bracket is the objective of the mechanism evaluated with in place of , at the outcome . The truthful report makes maximize exactly this bracket over , so no report does better.
With the Clarke-style and nonnegative valuations, every payment is nonnegative and every truthful agent has utility at least 0. The utility of agent is times the best total score minus the best score without , which is at least 0.
The procedure, with the Clarke-style payments:
AFFINE-MAXIMIZER(R, w, c, b_1, ..., b_n)- 1
for each o in R: S(o) ← c(o) + w_1 b_1(o) + ... + w_n b_n(o) - 2
x ← the first o in R with the largest S(o) - 3
for i ← 1 to n: - 4
H_i ← max over o in R of (S(o) - w_i b_i(o)) ▷ best score without agent i - 5
p_i ← (H_i - (S(x) - w_i b_i(x))) / w_i - 6
return x, (p_1, ..., p_n)
With the valuations given as tables over , the procedure takes arithmetic operations. Roberts' theorem allows some weights to be 0, as long as not all are. An agent with weight 0 has no influence on the outcome, and its payment must then be a function alone.
Examples and non-examples
A small example. One item, two bidders with values and , weights , no constants. The outcomes are "bidder 1 wins", "bidder 2 wins" and "nobody wins". The scores are , and , so bidder 2 wins. Its payment is . Check: bidder 2 wins exactly when , so its threshold bid is , which is the payment that Myerson's lemma gives. Bidder 2 has utility , and bidder 1 pays nothing.
More affine maximizers:
- VCG. All , all , .
- Vickrey auction with an anonymous reserve. One item, outcomes "bidder wins" for each and "nobody", with and otherwise, and all weights 1. The item goes to the highest bidder if its bid is at least , and the winner pays . See reserve price.
- Bidder-specific reserves, in affine form. With and , the item goes to the bidder with the largest , if that is positive. This is not the same rule as "highest bidder among those above their own reserve". With reserves and bids , the affine scores are and , so bidder 1 wins. The other rule gives the item to bidder 2, the highest bidder, since both bids are above their reserves.
- Maximal-in-range mechanisms. Weights 1, constants 0, and a range that is smaller than so that the maximization is fast. See maximal-in-range mechanism.
- Weighted welfare. Weights that express the priority of agents, for example in a public decision where some agents represent more people.
Non-examples:
- The optimal auction for different value distributions. Myerson's optimal auction with bidders of different distributions gives the item to the bidder with the largest virtual value, which is not an affine function of the bids. It is DSIC because the domain is single-parameter, which is far from unrestricted, so Roberts' theorem does not apply to it.
- The greedy knapsack rule. The rule on the page monotone allocation rule is DSIC in its single-parameter domain, but it does not maximize any fixed affine function over a fixed range.
- Makespan minimization. A scheduling rule that minimizes the largest load is a min-max rule, not the maximization of a weighted sum. This is why VCG, the natural affine maximizer for scheduling, only gets ratio ; see truthful scheduling on unrelated machines.
- Weights that depend on the bids. If changes with , the argument above fails, and the rule is not DSIC in general.
Related definitions
- Groves mechanisms. The payments of an affine maximizer are the Groves payments for the weighted objective, divided by . With weights 1 and constants 0, they are exactly the Groves payments.
- Roberts' theorem. On the unrestricted domain with a range of at least three outcomes, every deterministic DSIC rule is an affine maximizer, with weights not all 0.
- Green-Laffont theorem. For the efficient rule, the payments are fixed up to . Roberts' theorem fixes the rule, and Green-Laffont fixes the payments.
- Maximal-in-range mechanism. The special case used to build truthful approximation mechanisms. Maximal-in-distributional-range mechanisms are the randomized version, which is truthful in expectation.
- Cycle monotonicity. Affine maximizers satisfy it, as every DSIC rule must.
Code
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/affine-maximizer/. The authors are listed in prov/P44K0N.jsonl.
"""An affine maximizer with Clarke-style payments.
The range is a finite list of outcomes. A bid is a dict from outcome to a number (int or
Fraction). The mechanism picks the first outcome of the range with the largest affine score
c(o) + w_1 b_1(o) + ... + w_n b_n(o), and charges agent i the amount
(H_i - (S(x) - w_i b_i(x))) / w_i, where H_i is the best score of the others alone.
A positive payment is paid by the agent. All arithmetic is exact.
"""
from fractions import Fraction
from typing import Hashable, Mapping, Sequence
Outcome = Hashable
def affine_score(o: Outcome, bids: Sequence[Mapping], weights: Sequence, constants: Mapping, skip: int | None = None) -> Fraction:
"""Return c(o) plus the sum of w_j b_j(o) over the agents j other than skip."""
s = Fraction(constants.get(o, 0))
for j, (w, b) in enumerate(zip(weights, bids)):
if j != skip:
s += Fraction(w) * Fraction(b[o])
return s
def affine_maximizer(outcomes: Sequence[Outcome], bids: Sequence[Mapping], weights: Sequence, constants: Mapping | None = None):
"""Run the affine maximizer with positive weights. Return (x, payments)."""
if not outcomes:
raise ValueError("the range must not be empty")
if len(weights) != len(bids) or any(Fraction(w) <= 0 for w in weights):
raise ValueError("need one positive weight per agent")
constants = constants or {}
score = {o: affine_score(o, bids, weights, constants) for o in outcomes} # @line L1
x = outcomes[0]
for o in outcomes: # @line L2
if score[o] > score[x]:
x = o
payments = []
for i, (w, b) in enumerate(zip(weights, bids)): # @line L3
h_i = max(score[o] - Fraction(w) * Fraction(b[o]) for o in outcomes) # @line L4
payments.append((h_i - (score[x] - Fraction(w) * Fraction(b[x]))) / Fraction(w)) # @line L5
return x, payments # @line L6
def utility(value: Mapping, x: Outcome, payment) -> Fraction:
"""Quasilinear utility of an agent with valuation value for outcome x and payment."""
return Fraction(value[x]) - Fraction(payment)
test_affine_maximizer.py 117 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/affine-maximizer/. The authors are listed in prov/P44K0N.jsonl.
import random
from fractions import Fraction
from itertools import product
from affine_maximizer import affine_maximizer, utility
F = Fraction
def single_item(values, nobody="none"):
"""Bids for one item: outcome k means bidder k wins."""
n = len(values)
outcomes = list(range(n)) + [nobody]
bids = [{o: (F(values[k]) if o == k else F(0)) for o in outcomes} for k in range(n)]
return outcomes, bids
def test_weighted_example():
outcomes, bids = single_item([10, 7])
x, p = affine_maximizer(outcomes, bids, [1, 2])
assert x == 1
assert p == [F(0), F(5)]
def test_vickrey_with_reserve():
rng = random.Random(1)
for _ in range(200):
n = rng.randint(1, 4)
values = [rng.randint(0, 20) for _ in range(n)]
r = rng.randint(0, 20)
outcomes, bids = single_item(values)
x, p = affine_maximizer(outcomes, bids, [1] * n, {"none": r})
top = max(values)
if top >= r:
w = values.index(top)
assert x == w
second = max([v for k, v in enumerate(values) if k != w], default=0)
assert p[w] == max(second, r)
assert all(p[k] == 0 for k in range(n) if k != w)
else:
assert x == "none"
assert p == [0] * n
def test_unit_weights_give_clarke_payments():
rng = random.Random(2)
outcomes = ["a", "b", "c", "d"]
for _ in range(100):
n = rng.randint(1, 4)
bids = [{o: F(rng.randint(0, 9)) for o in outcomes} for _ in range(n)]
x, p = affine_maximizer(outcomes, bids, [1] * n)
total = {o: sum(b[o] for b in bids) for o in outcomes}
assert total[x] == max(total.values())
for i in range(n):
others_best = max(total[o] - bids[i][o] for o in outcomes)
assert p[i] == others_best - (total[x] - bids[i][x])
def test_dsic_by_brute_force():
rng = random.Random(3)
outcomes = ["a", "b", "c"]
grid = [dict(zip(outcomes, t)) for t in product([0, 1, 2], repeat=3)]
for _ in range(25):
n = rng.randint(2, 3)
k = rng.randint(1, 3)
rng_range = rng.sample(outcomes, k)
weights = [F(rng.randint(1, 3), rng.randint(1, 2)) for _ in range(n)]
constants = {o: F(rng.randint(-2, 2)) for o in outcomes}
others = [rng.choice(grid) for _ in range(n)]
for i in range(n):
results = []
for report in grid:
bids = list(others)
bids[i] = report
x, p = affine_maximizer(rng_range, bids, weights, constants)
results.append((x, p[i]))
for t_index, true in enumerate(grid):
honest = utility(true, *results[t_index])
for x, pay in results:
assert honest >= utility(true, x, pay)
def test_individual_rationality_and_nonnegative_payments():
rng = random.Random(4)
outcomes = ["a", "b", "c", "d"]
for _ in range(200):
n = rng.randint(1, 4)
k = rng.randint(1, 4)
rng_range = rng.sample(outcomes, k)
bids = [{o: F(rng.randint(0, 9)) for o in outcomes} for _ in range(n)]
weights = [F(rng.randint(1, 4)) for _ in range(n)]
constants = {o: F(rng.randint(-5, 5)) for o in outcomes}
x, p = affine_maximizer(rng_range, bids, weights, constants)
assert x in rng_range
for i in range(n):
assert p[i] >= 0
assert utility(bids[i], x, p[i]) >= 0
def test_rejects_bad_input():
outcomes, bids = single_item([3, 4])
for weights in ([1, 0], [1, -1], [1]):
try:
affine_maximizer(outcomes, bids, weights)
except ValueError:
pass
else:
raise AssertionError("expected ValueError")
try:
affine_maximizer([], bids, [1, 1])
except ValueError:
pass
else:
raise AssertionError("expected ValueError")
References
- Kevin Roberts, The characterization of implementable choice rules, in Jean-Jacques Laffont (ed.), Aggregation and Revelation of Preferences, North-Holland, 1979, 321-348, affine maximizers as the only dominant-strategy implementable rules on unrestricted domains with at least three outcomes
- Ron Lavi, Ahuva Mu'alem and Noam Nisan, Two simplified proofs for Roberts' theorem, Social Choice and Welfare 32(3) (2009), 407-423, the definition of affine maximizers and their weighted VCG payments
- Noam Nisan, Tim Roughgarden, Eva Tardos and Vijay V. Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007, Chapter 9, Noam Nisan, Introduction to mechanism design (for computer scientists), the part on affine maximizers and Roberts' theorem; Chapter 12, Ron Lavi, Computationally efficient approximation mechanisms
- Noam Nisan and Amir Ronen, Computationally feasible VCG mechanisms, Journal of Artificial Intelligence Research 29 (2007), 19-47, VCG-based mechanisms and the result that truthful VCG-based allocation rules are maximal in range
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 | H0 no proof |
|
| Lean | L0 no Lean part |
|
| Code (python) | I0 not checked yet |
|
| Visual | V0 none |
|
| Writing | W4 complete |
|
Tag P44K0N Edit this page History Report an error Markdown