Algorithm Search⌘K

Algorithmadvanced

Lehmann-O'Callaghan-Shoham mechanism

Also called LOS mechanism, greedy mechanism for single-minded bidders.

A greedy mechanism for single-minded bidders: sort by value over the square root of bundle size, accept disjoint bundles, charge critical values. Truthful and a sqrt(m) approximation.

Time
O(n^2 m) worst
Space
O(n + m) extra
Where
m = the number of items; n = the number of bidders
Properties
not comparison baseddeterministiciterative
Origin
Daniel Lehmann, Liadan Ita O'Callaghan, Yoav Shoham, 2002

The Lehmann-O'Callaghan-Shoham mechanism (LOS) is a truthful combinatorial auction for single-minded bidders. Each such bidder wants one fixed bundle of items and values every set that contains it at the same amount, and every other set at 0. Even for these bidders, choosing the best allocation is the weighted set packing problem, which is NP-hard, so the VCG mechanism cannot run in polynomial time. LOS replaces the optimum with a greedy choice: rank the bids by value over the square root of the bundle size, and accept each bid whose bundle does not meet an accepted one. Each winner pays its critical value, the smallest bid that would still win. The result is DSIC, and the welfare is at least 1/m1/\sqrt{m} of the optimum, for mm items.

In plain words

Each bidder wants one particular group of items and says how much the group is worth to it. Groups that share an item cannot both be sold. The auction ranks the bids by worth per item, but measured gently: it divides by the square root of the group size, so that one big group does not beat many small ones too easily. Then it walks down the ranking and accepts every group that does not clash with groups it has already accepted. A winner does not pay its bid. It pays the lowest bid that would still have won, given the other bids. So bidding the truth is always best, and the result is never too far from the best possible.

The problem

There are mm items and nn bidders. Bidder ii is single-minded: it has a bundle SiS_i and a value vi≥0v_i \ge 0, and its value for a set XX is viv_i if Si⊆XS_i \subseteq X and 0 otherwise. Its utility is quasilinear. Each bidder reports a bundle and a value. The mechanism picks a set WW of winners whose bundles are pairwise disjoint, and a payment for each winner. The aims are: truthful reporting of both the bundle and the value is a dominant strategy, the mechanism runs in polynomial time, and the welfare ∑i∈Wvi\sum_{i \in W} v_i is close to the optimum.

The algorithm

  1. LOS((S_1, v_1), ..., (S_n, v_n))
  2. 1order the bidders by v_i / sqrt(|S_i|), highest first; ties go to the smaller index
  3. 2W ← GREEDY(order), where GREEDY keeps a set of used items and:
  4. 3for each bidder i in the order
  5. 4if S_i does not meet the used items: accept i and add S_i to the used items
  6. 5for each winner i in W
  7. 6run GREEDY on the order without i; let j be the first accepted bidder whose bundle meets S_i
  8. 7p_i ← v_j · sqrt(|S_i|) / sqrt(|S_j|) if j exists, else 0
  9. 8return W and the payments p

Losers pay 0. The payment of line L7 is the bid at which the key of ii equals the key of jj: pi/∣Si∣=vj/∣Sj∣p_i / \sqrt{|S_i|} = v_j / \sqrt{|S_j|}. It is usually irrational, so the code returns it exactly as crc\sqrt{r} with a rational cc and a square-free integer rr.

Example

Four bidders bid for the items {0,1,2,3}\{0, 1, 2, 3\}.

bidder bundle value key v/∣S∣v / \sqrt{\lvert S \rvert}
0 {0,1}\{0, 1\} 6 6/2≈4.246 / \sqrt 2 \approx 4.24
1 {1,2}\{1, 2\} 5 5/2≈3.545 / \sqrt 2 \approx 3.54
2 {2,3}\{2, 3\} 4 4/2≈2.834 / \sqrt 2 \approx 2.83
3 {0,1,2,3}\{0, 1, 2, 3\} 9 9/2=4.59 / 2 = 4.5

The order is 3,0,1,23, 0, 1, 2. Bidder 3 takes all four items, and every other bundle meets it. Without bidder 3, the greedy run accepts bidder 0 first, and {0,1}\{0, 1\} meets {0,1,2,3}\{0, 1, 2, 3\}, so j=0j = 0 and p3=6⋅4/2=62≈8.49p_3 = 6 \cdot \sqrt 4 / \sqrt 2 = 6\sqrt 2 \approx 8.49. This is at most the bid 9, and bidder 3 would lose with any bid below 626\sqrt 2. The welfare is 9, while bidders 0 and 2 together give 10.

Correctness

The proof is in proofs/correctness.md. It shows these facts.

  • Feasibility. The accepted bundles are pairwise disjoint.
  • Approximation. Every bundle of an optimal solution meets the bundle of a winner that comes before it in the order, or is a winner itself. Charging each optimal bundle to such a winner and using the Cauchy-Schwarz inequality gives OPT≤m⋅∑i∈Wvi\mathrm{OPT} \le \sqrt{m} \cdot \sum_{i \in W} v_i.
  • Monotonicity. If ii wins with (Si,vi)(S_i, v_i), it also wins with a higher value or a smaller bundle, because both raise its key and can only remove bidders that come before it.
  • Critical value. For a fixed bundle, ii wins exactly when its value is at least the payment of line L7, with ties broken as in line L1.
  • Truthfulness. A monotone allocation rule with critical-value payments is truthful for single-minded bidders: lying about the value is handled as in Myerson's lemma, and asking for a larger bundle cannot lower the critical value, while a bundle that misses an item of SiS_i is worth 0. Truthful bidders never pay more than their value.
  • Tightness. One bidder that wants all mm items with value m+δ\sqrt m + \delta beats mm bidders that each want one item with value 1, so the ratio m\sqrt m cannot be improved for this order.
Proof: The greedy mechanism for single-minded bidders is feasible, truthful and a square root of m approximationfull

We use the pseudocode of the page. Bidder ii reports a nonempty bundle Si⊆MS_i \subseteq M and a value vi≥0v_i \ge 0, and m=∣M∣m = |M|. The key of a bid (S,v)(S, v) is v/∣S∣v / \sqrt{|S|}. Line L1 orders the bidders by key, highest first, with ties to the smaller index; the code compares vi2/∣Si∣v_i^2 / |S_i| exactly, which gives the same order. We say ii precedes jj if ii comes before jj in this order. The greedy run of lines L2 to L4 accepts a bidder when its bundle is disjoint from the bundles accepted before it. Let WW be the set of accepted bidders.

Claim 1 (feasibility). The bundles of the bidders in WW are pairwise disjoint.

Proof. Line L4 accepts a bidder only if its bundle is disjoint from the union of the bundles accepted before it. □\square

Claim 2 (the approximation). Let OO be a set of bidders with pairwise disjoint bundles. Then ∑j∈Ovj≤m∑i∈Wvi\sum_{j \in O} v_j \le \sqrt{m} \sum_{i \in W} v_i.

Proof. Take j∈Oj \in O. If j∈Wj \in W, put f(j)=jf(j) = j. Otherwise line L4 rejected jj, so some accepted bidder that precedes jj has a bundle that meets SjS_j; let f(j)f(j) be the first such bidder in the order. In both cases f(j)∈Wf(j) \in W, Sf(j)S_{f(j)} meets SjS_j, and f(j)f(j) precedes jj or equals it, so its key is at least the key of jj: vj≤vf(j)∣Sj∣/∣Sf(j)∣v_j \le v_{f(j)} \sqrt{|S_j|} / \sqrt{|S_{f(j)}|}.

For i∈Wi \in W, let Oi={j∈O:f(j)=i}O_i = \{j \in O : f(j) = i\}. The bundles SjS_j for j∈Oij \in O_i are disjoint and each meets SiS_i, so ∣Oi∣≤∣Si∣|O_i| \le |S_i|. They are also subsets of MM, so ∑j∈Oi∣Sj∣≤m\sum_{j \in O_i} |S_j| \le m. By the Cauchy-Schwarz inequality,

∑j∈Oivj≤vi∣Si∣∑j∈Oi∣Sj∣≤vi∣Si∣∣Oi∣∑j∈Oi∣Sj∣≤vi∣Si∣∣Si∣m=m vi.\sum_{j \in O_i} v_j \le \frac{v_i}{\sqrt{|S_i|}} \sum_{j \in O_i} \sqrt{|S_j|} \le \frac{v_i}{\sqrt{|S_i|}} \sqrt{|O_i|} \sqrt{\sum_{j \in O_i} |S_j|} \le \frac{v_i}{\sqrt{|S_i|}} \sqrt{|S_i|} \sqrt{m} = \sqrt{m}\, v_i.

The sets OiO_i for i∈Wi \in W partition OO, so summing over i∈Wi \in W gives the claim. □\square

The bound uses only items that appear in some bundle, so mm can be the size of the union of the bundles.

Claim 3 (monotonicity). Fix the bids of all bidders except ii. If bidder ii wins with the bid (T,w)(T, w), it also wins with every bid (T′,w′)(T', w') with T′⊆TT' \subseteq T, T′≠∅T' \neq \emptyset and w′≥ww' \ge w.

Proof. The key of (T′,w′)(T', w') is at least the key of (T,w)(T, w), so bidder ii moves to the same place or earlier in the order, and the relative order of the other bidders does not change. Line L4 treats the bidders before ii in the same way in every run, because their treatment does not depend on bids that come later. So the set AA of bidders accepted before ii with the bid (T′,w′)(T', w') is the set of bidders accepted before ii in the run with (T,w)(T, w) that precede the new place of ii, a subset of the old set. The old set has no bundle that meets TT. So no bundle in AA meets T′⊆TT' \subseteq T, and ii is accepted. □\square

Claim 4 (the payment is the critical value). Fix the bids of the others and a bundle TT reported by bidder ii. Run the greedy algorithm without ii, and let jj be the first bidder accepted in this run whose bundle meets TT. Put θ(T)=vj∣T∣/∣Sj∣\theta(T) = v_j \sqrt{|T| / |S_j|}, and θ(T)=0\theta(T) = 0 if no such jj exists. Then bidder ii wins with (T,w)(T, w) if w>θ(T)w > \theta(T) and loses if w<θ(T)w < \theta(T). Lines L6 and L7 charge a winner exactly θ(T)\theta(T).

Proof. As in Claim 3, the bidders that precede ii are treated the same as in the run without ii. So bidder ii is accepted if and only if no bidder accepted before it in the run without ii has a bundle that meets TT, that is, if and only if ii precedes jj (or jj does not exist). Bidder ii precedes jj when w/∣T∣>vj/∣Sj∣w / \sqrt{|T|} > v_j / \sqrt{|S_j|}, that is, w>θ(T)w > \theta(T), and does not precede jj when w<θ(T)w < \theta(T). At w=θ(T)w = \theta(T) the tie rule decides. Line L6 finds this jj for the reported bundle, and line L7 charges θ(T)\theta(T). □\square

Claim 5 (truthful bidding is a dominant strategy, and it is individually rational). A single-minded bidder ii with the true bundle SS and value vv gets value vv from every bundle that contains SS and 0 from all others. For every report (T,w)(T, w) of bidder ii and every report of the others, the utility of (S,v)(S, v) is at least the utility of (T,w)(T, w) and at least 0.

Proof. By Claim 4, the truthful report gives v−θ(S)v - \theta(S) when it wins, which happens if v>θ(S)v > \theta(S) and fails if v<θ(S)v < \theta(S). So its utility is max⁡(0,v−θ(S))\max(0, v - \theta(S)), or 0 when v=θ(S)v = \theta(S). In every case it is max⁡(0,v−θ(S))\max(0, v - \theta(S)), which is at least 0.

Now take a report (T,w)(T, w). If it loses, its utility is 0. If it wins and T⊉ST \not\supseteq S, the bidder gets value 0 and pays θ(T)≥0\theta(T) \ge 0, so its utility is at most 0. If it wins and T⊇ST \supseteq S, its utility is v−θ(T)v - \theta(T). By Claim 3, every w′>θ(T)w' > \theta(T) makes (S,w′)(S, w') win, so by Claim 4 θ(S)≤θ(T)\theta(S) \le \theta(T). Hence v−θ(T)≤v−θ(S)≤max⁡(0,v−θ(S))v - \theta(T) \le v - \theta(S) \le \max(0, v - \theta(S)). □\square

Claim 6 (the bound of Claim 2 is tight for this algorithm). Let m=q2m = q^2, with one bidder for all of MM with value q+ϵq + \epsilon, and mm bidders for the single items with value 1. The first bidder has key (q+ϵ)/q>1(q + \epsilon)/q > 1, so it is accepted first and blocks all the others. The welfare is q+ϵq + \epsilon, while the single items give m=q2m = q^2. The ratio q2/(q+ϵ)q^2/(q + \epsilon) tends to m\sqrt{m} as ϵ→0\epsilon \to 0. □\square

Complexity

Line L1 takes O(nlog⁡n)O(n \log n) time. One greedy run with a table of used items takes O(∑i∣Si∣)=O(nm)O(\sum_i |S_i|) = O(nm) time, and lines L5 to L7 make one run per winner. So the total time is O(n2m)O(n^2 m) and the extra space is O(n+m)O(n + m). With mm large and bundles small, the bound is O(n∑i∣Si∣)O(n \sum_i |S_i|).

Properties

  • DSIC and individually rational for single-minded bidders, for misreports of both the value and the bundle.
  • A m\sqrt{m} approximation of the optimal welfare. For general single-minded bids, no polynomial algorithm does better than m1/2−ϵm^{1/2 - \epsilon} unless P=NP\mathrm{P} = \mathrm{NP}, by the hardness of independent set, so the bound is close to the best possible.
  • Deterministic and polynomial.
  • Not VCG payments. Its truthfulness comes from a monotone allocation with critical prices, not from the VCG payment rule, which is a different route from maximal-in-range mechanisms.

Variants and improvements

  • Other ranking keys. Any key that increases in the value and decreases in the bundle size gives a truthful mechanism with critical payments. Ranking by viv_i gives an mm approximation, and ranking by vi/∣Si∣v_i / |S_i| also gives mm; the square root balances the two failure modes.
  • Known single-minded bidders. If the bundles are public, only the values are private. This is a single-parameter environment, and any monotone algorithm with threshold payments is truthful.
  • Small bundles. If every bundle has at most dd items, greedy by value gives a dd approximation.
  • Multi-unit and general bidders. For bidders with general valuations, truthful polynomial mechanisms use maximal-in-range or randomized (truthful in expectation) designs, and the best known ratios are weaker.

When to use it

Use it for a combinatorial auction where each bidder wants one specific package, the instance is too large for exact winner determination, and the bidders must not need to strategize. If exact winner determination is feasible, VCG gives the optimal welfare and is also truthful.

Pitfalls

  • Payments with a greedy rule that is not monotone. Critical-value payments are only truthful when the allocation is monotone. Adding a local improvement step after the greedy pass can break monotonicity.
  • VCG payments with greedy allocation. Charging VCG-style payments computed with the greedy allocation is not truthful.
  • Exact arithmetic. The keys and payments involve square roots. Floating point can change the order at ties and break truthfulness, so compare keys by vi2/∣Si∣v_i^2 / |S_i| in exact arithmetic.
  • Bidders who are not single-minded. If a bidder values two different bundles, the mechanism cannot express it, and truthfulness may fail.

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.

single_minded_bidder_mechanism.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/single-minded-bidder-mechanism/. The authors are listed in prov/Z6TN8C.jsonl.

from fractions import Fraction
from typing import Sequence, Union

Number = Union[int, Fraction]
Bid = tuple[frozenset, Number]
# A payment c * sqrt(r) is stored as the pair (c, r), with c a Fraction and r
# a square-free positive integer, so that every payment is exact.
Payment = tuple[Fraction, int]


def _order(bids: Sequence[Bid]) -> list[int]:
    """Bidders by v / sqrt(|S|), highest first, compared exactly as v^2 / |S|."""
    for bundle, value in bids:
        if not bundle:
            raise ValueError("every bundle must be nonempty")
        if value < 0:
            raise ValueError("values must be nonnegative")
    return sorted(range(len(bids)), key=lambda i: (-Fraction(bids[i][1]) ** 2 / len(bids[i][0]), i))


def _greedy(bids: Sequence[Bid], order: Sequence[int], skip: int = -1) -> list[int]:
    winners: list[int] = []
    used: set = set()
    for i in order:  # @line L3
        if i == skip:
            continue
        if used.isdisjoint(bids[i][0]):  # @line L4
            winners.append(i)  # @line L4
            used |= bids[i][0]  # @line L4
    return winners


def _surd(c: Fraction, r: int) -> Payment:
    """Write c * sqrt(r) with a square-free radicand."""
    f = 1
    d = 2
    while d * d <= r:
        while r % (d * d) == 0:
            r //= d * d
            f *= d
        d += 1
    return Fraction(c) * f, r


def single_minded_mechanism(bids: Sequence[Bid]) -> tuple[list[int], list[Payment]]:
    """The truthful greedy mechanism of Lehmann, O'Callaghan and Shoham.

    bids[i] = (S_i, v_i): bidder i asks for the nonempty bundle S_i (a
    frozenset of items) and reports the value v_i. Bidders are taken in the
    order of v_i / sqrt(|S_i|), highest first, ties to the smaller index, and
    a bidder wins if its bundle is disjoint from the bundles already won.
    A winner i pays v_j * sqrt(|S_i| / |S_j|), where j is the first bidder
    that wins in the same greedy run without i and whose bundle meets S_i,
    and 0 if there is no such j. Return (winners in greedy order, payments),
    with payments[i] = (c, r) meaning c * sqrt(r); losers pay (0, 1).
    """
    order = _order(bids)  # @line L1
    winners = _greedy(bids, order)  # @line L2
    payments: list[Payment] = [(Fraction(0), 1)] * len(bids)
    for i in winners:  # @line L5
        bundle = bids[i][0]
        blocker = None
        for j in _greedy(bids, order, skip=i):  # @line L6
            if not bundle.isdisjoint(bids[j][0]):  # @line L6
                blocker = j  # @line L6
                break
        if blocker is not None:  # @line L7
            size_j = len(bids[blocker][0])
            payments[i] = _surd(Fraction(bids[blocker][1]) / size_j, len(bundle) * size_j)  # @line L7
    return winners, payments  # @line L8


def payment_float(p: Payment) -> float:
    """The payment c * sqrt(r) as a float, for display only."""
    return float(p[0]) * p[1] ** 0.5


def sign_surd(a: Number, b: Number = 0, x: int = 0, c: Number = 0, y: int = 0) -> int:
    """Exact sign of a + b * sqrt(x) + c * sqrt(y) for rationals a, b, c and x, y >= 0."""

    def sgn(t) -> int:
        return (t > 0) - (t < 0)

    def two(a, b, x) -> int:
        # sign of a + b * sqrt(x)
        sa, sb = sgn(a), sgn(b) if x else 0
        if sb == 0 or sa == sb:
            return sa or sb
        if sa == 0:
            return sb
        d = sgn(a * a - b * b * x)
        return sa if d > 0 else (sb if d < 0 else 0)

    first = two(a, b, x)
    sc = sgn(c) if y else 0
    if sc == 0 or first == sc:
        return first or sc
    if first == 0:
        return sc
    # Signs differ: compare (a + b sqrt x)^2 with c^2 y.
    d = two(a * a + b * b * x - c * c * y, 2 * a * b, x)
    return first if d > 0 else (sc if d < 0 else 0)
test_single_minded_bidder_mechanism.py 168 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/single-minded-bidder-mechanism/. The authors are listed in prov/Z6TN8C.jsonl.

import itertools
import random
from fractions import Fraction
from math import isqrt

from single_minded_bidder_mechanism import sign_surd, single_minded_mechanism


def fs(*items):
    return frozenset(items)


ALL_BUNDLES = [frozenset(c) for r in (1, 2, 3) for c in itertools.combinations(range(3), r)]


def optimum(bids):
    best = 0
    for r in range(len(bids) + 1):
        for chosen in itertools.combinations(range(len(bids)), r):
            items = [x for i in chosen for x in bids[i][0]]
            if len(items) == len(set(items)):
                best = max(best, sum(bids[i][1] for i in chosen))
    return best


def welfare(bids, winners):
    return sum(bids[i][1] for i in winners)


def random_bids(rng, n, m, top):
    out = []
    for _ in range(n):
        size = rng.randrange(1, m + 1)
        out.append((frozenset(rng.sample(range(m), size)), rng.randrange(0, top)))
    return out


def test_example() -> None:
    bids = [(fs(0, 1), 6), (fs(1, 2), 5), (fs(2, 3), 4), (fs(0, 1, 2, 3), 9)]
    winners, pay = single_minded_mechanism(bids)
    assert winners == [3]
    # Without bidder 3, bidder 0 wins first and meets {0, 1, 2, 3}: 6 sqrt(4 / 2).
    assert pay[3] == (Fraction(6), 2)
    assert pay[0] == pay[1] == pay[2] == (0, 1)
    assert optimum(bids) == 10
    bids = [(fs(0), 3), (fs(0, 1), 4), (fs(1), 1)]
    winners, pay = single_minded_mechanism(bids)
    assert winners == [0, 2]
    # Bidder 0 is blocked by bidder 1 without it: 4 sqrt(1 / 2) = 2 sqrt(2).
    assert pay[0] == (Fraction(2), 2)
    # Without bidder 2, bidder 0 wins first and blocks bidder 1, so no winner
    # meets item 1 and bidder 2 pays 0.
    assert pay[2] == (0, 1)


def test_edges() -> None:
    assert single_minded_mechanism([]) == ([], [])
    assert single_minded_mechanism([(fs(0), 5)]) == ([0], [(0, 1)])
    # Equal keys: the smaller index wins and pays exactly its own value.
    assert single_minded_mechanism([(fs(0), 2), (fs(0), 2)]) == ([0], [(Fraction(2), 1), (0, 1)])
    # Keys 1 and 9/4: the big bundle wins and pays 1 * sqrt(4 / 1) = 2.
    winners, pay = single_minded_mechanism([(fs(0), 1), (fs(0, 1, 2, 3), 3)])
    assert winners == [1] and pay[1] == (Fraction(2), 1)
    for bad in ([(fs(), 1)], [(fs(0), -1)]):
        try:
            single_minded_mechanism(bad)
        except ValueError:
            pass
        else:
            raise AssertionError("bad input must be rejected")


def test_feasible_and_sqrt_m_approximation() -> None:
    rng = random.Random(1)
    for _ in range(1500):
        n, m = rng.randrange(1, 7), rng.randrange(1, 6)
        bids = random_bids(rng, n, m, 10)
        winners, pay = single_minded_mechanism(bids)
        items = [x for i in winners for x in bids[i][0]]
        assert len(items) == len(set(items))
        opt, w = optimum(bids), welfare(bids, winners)
        used = len(set().union(*[b[0] for b in bids]))
        assert opt * opt <= used * w * w
        for i in range(n):
            if i not in winners:
                assert pay[i] == (0, 1)
            else:
                # Individual rationality: v_i - c sqrt(r) >= 0.
                assert sign_surd(bids[i][1], -pay[i][0], pay[i][1]) >= 0


def test_tight_example() -> None:
    for m in (4, 9, 16):
        k = isqrt(m)
        big = k + Fraction(1, 100)
        bids = [(frozenset(range(m)), big)] + [(fs(j), 1) for j in range(m)]
        winners, _ = single_minded_mechanism(bids)
        assert winners == [0]
        if m <= 9:
            assert optimum(bids) == m
        # The ratio m / (sqrt(m) + 1/100) of the optimum to the greedy welfare.
        assert m / big > k - Fraction(1, 10)


def wins(bids, i, value):
    trial = list(bids)
    trial[i] = (bids[i][0], value)
    return i in single_minded_mechanism(trial)[0]


def test_payment_is_critical_value() -> None:
    rng = random.Random(2)
    scale = 10 ** 6
    for _ in range(400):
        bids = random_bids(rng, rng.randrange(1, 6), rng.randrange(1, 6), 10)
        winners, pay = single_minded_mechanism(bids)
        for i in winners:
            c, r = pay[i]
            # lo <= c sqrt(r) <= hi, with hi - lo = 1 / scale.
            lo = Fraction(isqrt(int(c * c * r * scale * scale)), scale)
            hi = lo + Fraction(1, scale)
            assert sign_surd(hi, -c, r) > 0
            assert wins(bids, i, hi)
            if sign_surd(lo, -c, r) < 0:
                assert not wins(bids, i, lo)


def utility(true_bundle, true_value, bids, i):
    winners, pay = single_minded_mechanism(bids)
    if i not in winners:
        return 0, 0, 1
    gain = true_value if true_bundle <= bids[i][0] else 0
    return gain, pay[i][0], pay[i][1]


def test_truthful_is_dominant() -> None:
    rng = random.Random(3)
    for _ in range(80):
        bids = random_bids(rng, 3, 3, 5)
        for i in range(3):
            bundle, value = bids[i]
            a, c, r = utility(bundle, value, bids, i)
            for lie_bundle in ALL_BUNDLES:
                for lie_value in range(0, 6):
                    trial = list(bids)
                    trial[i] = (lie_bundle, lie_value)
                    a2, c2, r2 = utility(bundle, value, trial, i)
                    # (a - c sqrt r) - (a2 - c2 sqrt r2) >= 0
                    assert sign_surd(a - a2, -c, r, c2, r2) >= 0


def test_sign_surd() -> None:
    rng = random.Random(4)
    for _ in range(3000):
        a, b, c = (Fraction(rng.randrange(-20, 21), rng.randrange(1, 5)) for _ in range(3))
        x, y = rng.randrange(0, 30), rng.randrange(0, 30)
        approx = float(a) + float(b) * x ** 0.5 + float(c) * y ** 0.5
        s = sign_surd(a, b, x, c, y)
        if abs(approx) > 1e-9:
            assert s == (1 if approx > 0 else -1)
    assert sign_surd(0, 1, 2, -1, 2) == 0
    assert sign_surd(3, -1, 9) == 0
    assert sign_surd(-5, 1, 2, 1, 8) == -1
    assert sign_surd(Fraction(-3), 1, 2, 1, 2) == -1
    assert sign_surd(Fraction(-3), 1, 3, 1, 3) == 1

History

Lehmann, O'Callaghan and Shoham presented the mechanism at the ACM Conference on Electronic Commerce in 1999, and the journal version appeared in 2002. They identified the conditions under which a greedy allocation with critical payments is truthful for single-minded bidders, and they proved the m\sqrt m bound for the square root key. Their work was one of the first to combine a polynomial approximation algorithm with dominant-strategy incentives for a hard allocation problem.

References

  1. Daniel Lehmann, Liadan Ita O'Callaghan and Yoav Shoham, Truth revelation in approximately efficient combinatorial auctions, Journal of the ACM 49(5) (2002), 577-602, the greedy mechanism for single-minded bidders, the sufficient conditions for truthfulness (exactness and monotonicity with critical payments), and the sqrt(m) approximation bound
  2. Noam Nisan, Tim Roughgarden, Éva Tardos and Vijay V. Vazirani (eds.), Algorithmic Game Theory, Cambridge University Press, 2007, Chapter 11 (Blumrosen and Nisan, Combinatorial auctions), Section 11.2 (single-minded bidders)

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 proofH1 sketch
  • a full proof of time.worst
  • a full proof of space.extra
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
  • at least three sources
  • a scene preset for the example