Algorithm Search⌘K

Techniqueadvanced

Maximal-in-range mechanism

Also called MIR mechanism.

Fix a range of outcomes without looking at the bids, maximize reported welfare exactly over that range, and charge VCG payments on it. The result is deterministic and DSIC.

A maximal-in-range (MIR) mechanism fixes a set of outcomes, the range, before seeing any bids, finds the outcome of largest reported welfare inside the range exactly, and charges VCG payments computed on the range. Because it is VCG on a smaller outcome set, it is deterministic and DSIC, and the designer only has to pick a range that is easy to optimize over and always contains a good outcome. Its close page, truthful in expectation, is a weaker notion for randomized mechanisms. The randomized version of this technique, maximal in distributional range, optimizes over a fixed set of lotteries and gives mechanisms that are truthful in expectation but not DSIC in the deterministic sense. An MIR mechanism is the affine maximizer with weights 1 and no constants.

In plain words

Finding the best way to split goods among bidders is often too slow to compute. A fast but inexact method usually breaks honesty, because a bidder may gain by lying to steer the method. The fix is to limit the choices in advance. Pick a list of allowed outcomes, chosen before anyone bids, so that the best outcome on the list is fast to find and never much worse than the true best. Then always choose the best outcome on the list, and charge each bidder the harm it does to the others, measured on the same list. This is the usual welfare-maximizing auction played on a smaller menu, so honesty is still the best plan for every bidder.

When it applies

  • The goal is social welfare, the sum of the agents' values, or something close to it.
  • Agents have rich, multi-parameter valuations, so that by Roberts' theorem weighted welfare maximization is close to the only option for a deterministic DSIC rule.
  • Exact welfare maximization over all outcomes is too hard, as for the winner determination problem of a combinatorial auction.
  • There is a range RR that depends only on public data, such as the numbers of agents and items, over which the maximum can be found exactly in polynomial time, and which contains an outcome within a factor α\alpha of the optimum for every valuation profile.

It does not fit objectives that are not sums of values, such as the makespan in truthful scheduling.

The template

Let OO be the set of all outcomes and R⊆OR \subseteq O a nonempty range fixed in advance. On reports b1,…,bnb_1, \dots, b_n:

  1. MAXIMAL-IN-RANGE(R, b_1, ..., b_n)
  2. 1for each o in R: T(o) ← b_1(o) + ... + b_n(o)
  3. 2x ← the first o in R with the largest T(o)
  4. 3for i ← 1 to n:
  5. 4W_-i ← max over o in R of (T(o) - b_i(o)) ▷ best welfare of the others, on the range
  6. 5p_i ← W_-i - (T(x) - b_i(x))
  7. 6return x, (p_1, ..., p_n)

In practice lines L1, L2 and L4 are not loops over RR, which is usually exponentially large, but calls to a fast exact optimizer for the range, so the mechanism makes n+1n + 1 optimizer calls.

Truthfulness. Agent ii with true valuation viv_i has utility vi(x)+∑j≠ibj(x)−W−iv_i(x) + \sum_{j \ne i} b_j(x) - W_{-i}. The term W−iW_{-i} does not depend on bib_i, and the truthful report makes xx maximize the first two terms over RR. So truth telling is a dominant strategy. With nonnegative valuations the payments are nonnegative and truthful agents get nonnegative utility, as for VCG.

Approximation. The welfare of the outcome is max⁡o∈R∑ivi(o)\max_{o \in R} \sum_i v_i(o), so the approximation ratio is

α=sup⁡vmax⁡o∈O∑ivi(o)max⁡o∈R∑ivi(o),\alpha = \sup_{v} \frac{\max_{o \in O} \sum_i v_i(o)}{\max_{o \in R} \sum_i v_i(o)},

a property of the range alone. The design problem is to choose RR with a small α\alpha and a fast exact optimizer.

Classic examples

Grand bundle or one item each, worked by hand. In a combinatorial auction with mm items, let RR contain the nn allocations that give all items to one bidder, and all allocations that give each bidder at most one item. The best grand bundle needs nn value queries, and the best one-item-each allocation is a maximum-weight bipartite matching between bidders and items with weights bi({j})b_i(\{j\}). So the mechanism runs in polynomial time.

Take m=4m = 4 items and two bidders with additive values: bidder 1 values each item at 3, and bidder 2 values item 1 at 5 and the others at 1. The optimum gives item 1 to bidder 2 and the rest to bidder 1, with welfare 5+9=145 + 9 = 14. On the range, the grand bundles give 1212 and 88, and the best matching gives 5+3=85 + 3 = 8. The mechanism gives all items to bidder 1, with welfare 12. Bidder 1 pays W−1−0=max⁡(8,5)−0=8W_{-1} - 0 = \max(8, 5) - 0 = 8, where 88 is bidder 2's grand bundle and 55 is its best single item, and has utility 12−8=412 - 8 = 4. Bidder 2 pays 12−12=012 - 12 = 0.

For subadditive valuations, v(S∪T)≤v(S)+v(T)v(S \cup T) \le v(S) + v(T), this range has ratio at most 2m2\sqrt{m}. Let S1,…,SnS_1, \dots, S_n be an optimal allocation. At most m\sqrt{m} bidders get more than m\sqrt{m} items, and each of them has value at most the best grand bundle, so together they have at most m\sqrt{m} times the best grand bundle. A bidder with ∣Si∣≤m|S_i| \le \sqrt{m} has, by subadditivity, vi(Si)≤mmax⁡j∈Sivi({j})v_i(S_i) \le \sqrt{m} \max_{j \in S_i} v_i(\{j\}). Giving each such bidder its best item in SiS_i is a matching, because the sets SiS_i are disjoint, so these bidders together have at most m\sqrt{m} times the best matching. Adding, the optimum is at most 2m2\sqrt{m} times the better of the two parts of the range.

Multi-unit auctions. Dobzinski and Nisan (2007 conference, 2010 journal) studied mm identical units and nn bidders with general valuations for numbers of units. Their range splits the units into about n2n^2 equal blocks and allocates whole blocks only. The best allocation of blocks can be found by dynamic programming in time polynomial in nn and log⁡m\log m, and the range always contains an allocation with at least half the optimal welfare. This gives a deterministic DSIC 2-approximation.

VCG with an approximation algorithm. Nisan and Ronen (2007) asked what happens when the exact optimizer inside VCG is replaced by an approximation algorithm. They showed that such a VCG-based mechanism is truthful only if the algorithm is maximal in its range. So the technique is the only way to keep VCG payments while giving up exact optimization.

VCG itself is the case R=OR = O.

Variations

  • Maximal in distributional range (MIDR). The range is a fixed set of probability distributions over outcomes, and the mechanism picks the one with the largest expected reported welfare. With VCG payments in expectation, the mechanism is truthful in expectation. Dobzinski and Dughmi (2009) used this to get an FPTAS for multi-unit auctions that is truthful in expectation, compared with the deterministic ratio 2 above.
  • Scaled LP ranges. Lavi and Swamy (2005 conference, 2011 journal) take as range the fractional solutions of an LP relaxation scaled down by the integrality gap. Each scaled fractional solution is a lottery over integral solutions, so the mechanism is MIDR and truthful in expectation, with the ratio of the integrality gap.
  • Affine maximizers in range. Adding weights and outcome constants keeps truthfulness by the same argument; see affine maximizer.
  • Single-parameter alternatives. When agents have one-number types, a designer can use any monotone allocation rule instead, which is a much larger family; see single-minded bidder mechanism.

Pitfalls

  • The range must not depend on the bids. Taking the better of two algorithms, where one of them is not optimal over a fixed range, gives a range that changes with the reports, and truthfulness fails in general.
  • The optimization over the range must be exact. A near-optimal outcome inside the range is not enough: an agent can gain by lying to push the algorithm toward a better outcome for itself, the same failure as for VCG with an approximation algorithm.
  • Tie-breaking must be fixed. Ties inside the range must be broken in a way that does not depend on the reports, for example by a fixed order of RR.
  • The ratio is the worst case over all valuations. A range that is good for typical inputs can still be very bad for some inputs, and the guarantee is only the worst case. For valuations with complements, the grand-bundle-or-one-item range above can lose a factor of about m/2m/2.
  • Payments need n+1n + 1 optimizations. Each payment uses the best outcome in the range without one agent, so the running time is about n+1n + 1 times that of the optimizer.

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.

maximal_in_range_mechanism.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/maximal-in-range-mechanism/. The authors are listed in prov/HD9BNP.jsonl.

"""A maximal-in-range mechanism for small combinatorial auctions.

An allocation is a tuple owner, where owner[j] is the bidder who gets item j, or None.
A valuation is a dict from frozenset of items to a number. The mechanism maximizes the
reported welfare exactly over a fixed range of allocations, which does not depend on the
bids, and charges VCG payments computed over the same range. The range used here gives all
items to one bidder, or gives each bidder at most one item. All arithmetic is exact.
"""

from fractions import Fraction
from itertools import product
from typing import Mapping, Sequence

Allocation = tuple


def bundle(owner: Allocation, i: int) -> frozenset:
    """The set of items that the allocation gives to bidder i."""
    return frozenset(j for j, o in enumerate(owner) if o == i)


def value(valuation: Mapping, owner: Allocation, i: int) -> Fraction:
    """Value of bidder i for its bundle under the allocation."""
    return Fraction(valuation[bundle(owner, i)])


def grand_or_single_range(n: int, m: int) -> list:
    """All grand-bundle allocations, then all allocations with at most one item per bidder."""
    rng = [tuple([i] * m) for i in range(n)]
    for owner in product([None] + list(range(n)), repeat=m):
        taken = [o for o in owner if o is not None]
        if len(taken) == len(set(taken)) and owner not in rng:
            rng.append(owner)
    return rng


def all_allocations(n: int, m: int) -> list:
    """Every allocation of m items to n bidders, some items possibly unassigned."""
    return list(product([None] + list(range(n)), repeat=m))


def maximal_in_range(rng: Sequence[Allocation], bids: Sequence[Mapping]):
    """Run the mechanism on the fixed range rng. Return (x, payments)."""
    if not rng:
        raise ValueError("the range must not be empty")
    n = len(bids)
    total = {o: sum((value(bids[i], o, i) for i in range(n)), Fraction(0)) for o in rng}  # @line L1
    x = rng[0]
    for o in rng:  # @line L2
        if total[o] > total[x]:
            x = o
    payments = []
    for i in range(n):  # @line L3
        best_without = max(total[o] - value(bids[i], o, i) for o in rng)  # @line L4
        payments.append(best_without - (total[x] - value(bids[i], x, i)))  # @line L5
    return x, payments  # @line L6


def welfare(valuations: Sequence[Mapping], owner: Allocation) -> Fraction:
    """True welfare of an allocation."""
    return sum((value(v, owner, i) for i, v in enumerate(valuations)), Fraction(0))
test_maximal_in_range_mechanism.py 101 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/maximal-in-range-mechanism/. The authors are listed in prov/HD9BNP.jsonl.

import random
from fractions import Fraction
from itertools import combinations

from maximal_in_range_mechanism import (
    all_allocations,
    grand_or_single_range,
    maximal_in_range,
    value,
    welfare,
)

F = Fraction


def subsets(m):
    return [frozenset(c) for k in range(m + 1) for c in combinations(range(m), k)]


def additive(item_values):
    m = len(item_values)
    return {s: sum((F(item_values[j]) for j in s), F(0)) for s in subsets(m)}


def random_xos(rng, m, clauses=3, hi=6):
    """Maximum of a few additive functions. Such valuations are subadditive."""
    parts = [[rng.randint(0, hi) for _ in range(m)] for _ in range(clauses)]
    return {s: max(sum((F(p[j]) for j in s), F(0)) for p in parts) for s in subsets(m)}


def test_worked_example():
    bids = [additive([3, 3, 3, 3]), additive([5, 1, 1, 1])]
    rng = grand_or_single_range(2, 4)
    x, p = maximal_in_range(rng, bids)
    assert x == (0, 0, 0, 0)
    assert welfare(bids, x) == 12
    assert p == [F(8), F(0)]
    opt = max(welfare(bids, o) for o in all_allocations(2, 4))
    assert opt == 14


def test_full_range_is_vcg():
    gen = random.Random(1)
    for _ in range(30):
        n, m = gen.randint(1, 3), gen.randint(1, 3)
        bids = [random_xos(gen, m) for _ in range(n)]
        rng = all_allocations(n, m)
        x, p = maximal_in_range(rng, bids)
        assert welfare(bids, x) == max(welfare(bids, o) for o in rng)
        for i in range(n):
            assert p[i] >= 0
            assert value(bids[i], x, i) - p[i] >= 0


def test_dsic_by_brute_force():
    gen = random.Random(2)
    for _ in range(12):
        n, m = gen.randint(2, 3), gen.randint(2, 3)
        rng = grand_or_single_range(n, m)
        others = [random_xos(gen, m) for _ in range(n)]
        types = [random_xos(gen, m) for _ in range(8)]
        for i in range(n):
            results = []
            for report in types:
                bids = list(others)
                bids[i] = report
                x, p = maximal_in_range(rng, bids)
                results.append((x, p[i]))
            for t, true in enumerate(types):
                x0, p0 = results[t]
                honest = value(true, x0, i) - p0
                for x, pay in results:
                    assert honest >= value(true, x, i) - pay


def test_ratio_at_most_two_sqrt_m():
    gen = random.Random(3)
    for _ in range(40):
        n, m = gen.randint(1, 3), gen.randint(1, 4)
        vals = [random_xos(gen, m) for _ in range(n)]
        x, _ = maximal_in_range(grand_or_single_range(n, m), vals)
        got = welfare(vals, x)
        opt = max(welfare(vals, o) for o in all_allocations(n, m))
        assert got <= opt
        assert opt * opt <= 4 * m * got * got


def test_range_does_not_depend_on_bids():
    rng = grand_or_single_range(2, 2)
    assert len(rng) == len(set(rng))
    assert (0, 0) in rng and (1, 1) in rng and (0, 1) in rng and (None, None) in rng
    assert (0, 0, 1) not in grand_or_single_range(2, 3)
    try:
        maximal_in_range([], [additive([1])])
    except ValueError:
        pass
    else:
        raise AssertionError("expected ValueError")

Exercises

  1. Show that the best one-item-each allocation in the worked example is a maximum-weight bipartite matching, and compute it for the two bidders above.
  2. Give m/2m/2 bidders, each of whom wants a different pair of items with value 1 and values every set without its pair at 0. Show that the grand-bundle-or-one-item range gets welfare 1 while the optimum is m/2m/2.
  3. Show that the Vickrey auction with an anonymous reserve price is an affine maximizer but not an MIR mechanism with constants 0 over the outcomes "bidder ii wins" and "nobody wins".
  4. Assume valuations are monotone: a larger bundle is worth at least as much. Show that every MIR mechanism whose range contains the nn grand-bundle allocations gets at least a 1/n1/n fraction of the optimal welfare.
  5. Prove that the ratio of an MIR mechanism is exactly the worst case of the optimum over the best welfare in the range, as in the formula for α\alpha.

References

  1. Noam Nisan and Amir Ronen, Computationally feasible VCG mechanisms, Journal of Artificial Intelligence Research 29 (2007), 19-47, VCG-based mechanisms with approximate allocation algorithms, and the result that they are truthful only when the algorithm is maximal in its range
  2. Shahar Dobzinski and Noam Nisan, Mechanisms for multi-unit auctions, Journal of Artificial Intelligence Research 37 (2010), 85-98 (conference version in EC 2007), the maximal-in-range 2-approximation for multi-unit auctions that bundles the units into equal blocks and optimizes over blocks by dynamic programming
  3. Shahar Dobzinski and Shaddin Dughmi, On the power of randomization in algorithmic mechanism design, Proceedings of the 50th IEEE Symposium on Foundations of Computer Science (FOCS 2009), maximal-in-distributional-range mechanisms and a truthful-in-expectation FPTAS for multi-unit auctions
  4. Ron Lavi and Chaitanya Swamy, Truthful and near-optimal mechanism design via linear programming, Journal of the ACM 58(6) (2011), Article 25 (conference version in FOCS 2005), truthful-in-expectation mechanisms whose range is a scaled-down copy of the fractional relaxation
  5. Noam Nisan, Tim Roughgarden, Eva Tardos and Vijay V. Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007, Chapter 12, Ron Lavi, Computationally efficient approximation mechanisms

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.

LadderLevelWhat the next level needs
Human proofH0 no proof
  • add a proof in proofs/ (06.5)
LeanL0 no Lean part
  • name a Lean module in the lean field (07)
Code (python)I0 not checked yet
  • the tests did not run in this build
VisualV0 none
  • add viz/scene.ts or a figure (10)
WritingW2 basic
  • three classic examples