Algorithm Search⌘K

Modeladvanced

Security game

Also called Stackelberg security game.

A Stackelberg game in which a defender commits to a randomized allocation of resources over targets and an attacker picks a target to attack.

A security game is a two-player game between a defender and an attacker. The defender has kk identical resources, such as patrols or guards, and TT targets to protect. The defender first commits to a randomized way to place the resources. The attacker observes the coverage probabilities, not the random draw, and attacks one target. The solution concept is the Stackelberg equilibrium, and the general method for two-player games in normal form is the multiple LPs algorithm. This page is about the model: the payoffs depend only on the coverage of the attacked target, so the defender's exponentially many pure strategies reduce to TT coverage numbers. Stackelberg routing is a different use of the word, for a leader who controls part of the traffic in a network.

Notation: targets are t=1,…,Tt = 1, \ldots, T. Udc(t)>Udu(t)U_d^c(t) > U_d^u(t) are the defender's payoffs when tt is attacked while it is covered or uncovered, and Uac(t)<Uau(t)U_a^c(t) < U_a^u(t) are the attacker's. ctc_t is the probability that target tt is covered.

The machine

The defender's pure strategies are the sets of at most kk targets; each resource covers one target. In some versions every resource must be used, and the sets have exactly kk targets. A mixed strategy is a distribution over these sets, and its coverage vector is c=(c1,…,cT)c = (c_1, \ldots, c_T), with ctc_t the probability that tt is in the drawn set. The attacker's pure strategies are the targets. If the attacker hits tt, the expected payoffs are

Ud(c,t)=ctUdc(t)+(1−ct)Udu(t),Ua(c,t)=ctUac(t)+(1−ct)Uau(t).U_d(c, t) = c_t U_d^c(t) + (1 - c_t) U_d^u(t), \qquad U_a(c, t) = c_t U_a^c(t) + (1 - c_t) U_a^u(t).

They depend only on ctc_t, and not on the coverage of the other targets or on the correlation between them. The attacker plays a best response to cc, and ties are broken in the defender's favor. This is the strong Stackelberg equilibrium. Without that rule the defender's optimum may not be attained, as in any Stackelberg game.

Two facts make the coverage vector the right state:

  • Every feasible vector can be sampled. A vector cc with 0≤ct≤10 \le c_t \le 1 and ∑tct≤k\sum_t c_t \le k is the coverage of some distribution over sets of at most kk targets. Comb sampling gives one: lay the ctc_t end to end on the interval [0,∑tct)[0, \sum_t c_t), draw uu uniformly from [0,1)[0, 1), and cover the targets whose pieces contain u,u+1,u+2,…u, u + 1, u + 2, \ldots. Each piece has length at most 1, so no target is hit twice, and target tt is covered with probability exactly ctc_t. If ∑tct=k\sum_t c_t = k, exactly kk targets are covered every time.
  • Only the coverage matters. Two mixed strategies with the same cc give both players the same payoff on every target, so the defender can search over cc instead of over distributions.

What it counts

The input is 4T4T payoffs and the number kk. The normal form of the same game has (Tk)\binom{T}{k} rows (or more, with sets of all sizes up to kk), so a direct use of the multiple LPs algorithm on the bimatrix game is exponential in kk. In the coverage form, the cost is counted in linear programs with TT variables and O(T)O(T) constraints, and in the arithmetic to sample a set from cc, which is O(T)O(T) operations.

Relation to other models

  • Bimatrix Stackelberg games. A security game is a bimatrix game with one row for each set of targets and one column for each target. The coverage form is a compact way to write the same LPs.
  • Bayesian attackers. With several attacker types and a prior over them, the problem is NP-hard already in the bimatrix setting, and exact methods use a mixed integer program with binary variables for the attacked target of each type; see Bayesian games.
  • Zero-sum security games. If Udc(t)=−Uac(t)U_d^c(t) = -U_a^c(t) and Udu(t)=−Uau(t)U_d^u(t) = -U_a^u(t) for every tt, the defender's commitment value is the value of the zero-sum game, by the minimax theorem, and it can be found by one LP.
  • Schedules. If a resource can cover a set of targets (a schedule), the coverage vectors that can be sampled form a smaller polytope, and the problem can become hard.

Known results in the model

The optimal coverage comes from one LP for each target tt: among the coverage vectors under which tt is a best target for the attacker, find the one that is best for the defender.

  1. SECURITY-GAME-SSE(Ud_c, Ud_u, Ua_c, Ua_u, k)
  2. 1for each target t = 1..T:
  3. 2LP_t: maximize c_t (Ud_c[t] - Ud_u[t]) + Ud_u[t]
  4. subject to c_s (Ua_c[s] - Ua_u[s]) + Ua_u[s] ≤ c_t (Ua_c[t] - Ua_u[t]) + Ua_u[t] for every s ≠ t ▷ t is a best target
  5. 30 ≤ c_s ≤ 1 for every s, Σ_s c_s ≤ k ▷ Σ_s c_s = k if no resource may stay idle
  6. 4if LP_t is infeasible: skip t
  7. 5keep (value of LP_t, its solution c, t) if the value is the largest so far
  8. 6return the kept (value, c, t); sample the set of covered targets from c by comb sampling
  • Polynomial time. The algorithm solves TT LPs, each with TT variables, so the optimal commitment is found in time polynomial in TT and the bit length of the payoffs. The proof is the same as for the multiple LPs algorithm: every coverage vector makes some target a best target, so it is feasible for that LP, and the best LP optimum is attained with the tie rule. Kiekintveld and others (2009) gave compact formulations of this kind that scale to games with many targets.
  • Idle resources can help. If the defender wants the attacker to hit a target with a high payoff when covered, full coverage of that target pushes the attacker away. Take T=k=3T = k = 3 with Udc=(6,1,0)U_d^c = (6, 1, 0), Udu=(0,0,−4)U_d^u = (0, 0, -4), Uac=(−3,0,0)U_a^c = (-3, 0, 0) and Uau=(2,6,3)U_a^u = (2, 6, 3). If all three resources must be used, c=(1,1,1)c = (1, 1, 1), the attacker hits target 2 and the defender gets 1. With ∑tct≤3\sum_t c_t \le 3, the optimum is c=(2/5,1,1)c = (2/5, 1, 1): the attacker is indifferent between all three targets, hits target 1 by the tie rule, and the defender gets 12/512/5.
  • More resources never hurt when resources may stay idle, because the feasible sets of the LPs grow with kk. The example above shows that this is false when every resource must be used.
  • Indifference at the optimum. At an optimal cc, the attacker is usually indifferent between several targets, and the defender's coverage on each of them is set by the indifference principle.
  • Schedules. Korzhyk, Conitzer and Parr (2010) studied the complexity when resources cover schedules of targets: some cases have polynomial algorithms and others are NP-hard.
  • Stackelberg and Nash. Korzhyk and others (2011) showed that the Nash equilibria of a security game are interchangeable, and that under a natural restriction on the schedules, every Stackelberg strategy of the defender is also a Nash equilibrium strategy. So the defender can commit without knowing whether the attacker observes the coverage.

Example. Take three targets and one resource, with Udc=(1,1,0)U_d^c = (1, 1, 0), Udu=(−5,−3,−1)U_d^u = (-5, -3, -1), Uac=(−1,−1,−1)U_a^c = (-1, -1, -1) and Uau=(5,3,1)U_a^u = (5, 3, 1).

target LP feasible optimum of LP_t
1 yes c=(3/5,2/5,0)c = (3/5, 2/5, 0), value −7/5-7/5
2 yes value −7/5-7/5
3 no the attacker gets at least 7/5>17/5 > 1 elsewhere

At c=(3/5,2/5,0)c = (3/5, 2/5, 0) the attacker gets 7/57/5 on targets 1 and 2 and 11 on target 3, and the defender gets −7/5-7/5 on targets 1 and 2. Target 3 cannot be the attacker's best target: with one resource, the attacker's payoffs on targets 1 and 2 cannot both drop to 1 or less, because that needs c1≥2/3c_1 \ge 2/3 and c2≥1/2c_2 \ge 1/2. Comb sampling covers target 1 with probability 3/53/5 and target 2 with probability 2/52/5.

The Python code solves LP_t for every target with the shared exact simplex code, with an option to require ∑tct=k\sum_t c_t = k, and samples a set by comb sampling. The tests check the example, the idle resource example, monotonicity in kk, the comb sampling marginals, and, on 40 random games, the same value as the multiple LPs algorithm on the full normal form, in both versions.

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.

agtlp.pyI0RawGitHub
# SPDX-License-Identifier: MIT
# Shared helper of the algorithmic game theory pages of https://algorithm.tamnd.com/. The authors are listed in prov/.
"""Exact linear programming in Fraction, by the two-phase simplex method with Bland's rule.

lp_max(c, A_ub, b_ub, A_eq=None, b_eq=None) maximizes c x subject to A_ub x <= b_ub,
A_eq x = b_eq and x >= 0. lp_min does the same for minimization. Free variables must be
split by the caller (x = x+ - x-). Every input number is converted to Fraction, so the
result is exact: there is no tolerance anywhere.

Both functions return (status, x, value, dual). status is "optimal", "infeasible" or
"unbounded". When status is not "optimal", x, value and dual are None. dual has one entry
per constraint, the A_ub rows first and then the A_eq rows. It is the vector of shadow
prices: the value is sum_i b_i dual_i (strong duality). For lp_max, dual_i >= 0 on the
A_ub rows and A^T dual >= c. For lp_min, dual_i <= 0 on the A_ub rows and A^T dual <= c.
The entries for the A_eq rows have no sign condition.

Bland's rule (the smallest improving column enters, and among the rows with the smallest
ratio the one with the smallest basic variable leaves) makes the method finite on every
input, degenerate inputs included. There is no game algorithm in this module.
"""

from fractions import Fraction


def _frac(v):
    return v if isinstance(v, Fraction) else Fraction(v)


def _pivot(T, obj, basis, r, j):
    p = T[r][j]
    row = [v / p for v in T[r]]
    T[r] = row
    for k in range(len(T)):
        f = T[k][j]
        if k != r and f != 0:
            T[k] = [a - f * b for a, b in zip(T[k], row)]
    f = obj[j]
    if f != 0:
        obj[:] = [a - f * b for a, b in zip(obj, row)]
    basis[r] = j


def _simplex(T, obj, basis, ncols):
    """Maximize. obj[j] is the reduced cost of column j and obj[-1] is minus the value."""
    while True:
        enter = next((j for j in range(ncols) if obj[j] > 0), None)
        if enter is None:
            return "optimal"
        best = None
        for r, row in enumerate(T):
            a = row[enter]
            if a > 0:
                key = (row[-1] / a, basis[r])
                if best is None or key < best[0]:
                    best = (key, r)
        if best is None:
            return "unbounded"
        _pivot(T, obj, basis, best[1], enter)


def _objective_row(cost, T, basis):
    obj = list(cost) + [Fraction(0)]
    for r, j in enumerate(basis):
        f = obj[j]
        if f != 0:
            obj = [a - f * b for a, b in zip(obj, T[r])]
    return obj


def _any_solution(M, rhs, nvars):
    """Return one solution y of M y = rhs (a consistent system), with the free variables 0."""
    rows = [list(M[k]) + [rhs[k]] for k in range(len(M))]
    pivots = []
    r = 0
    for col in range(nvars):
        p = next((k for k in range(r, len(rows)) if rows[k][col] != 0), None)
        if p is None:
            continue
        rows[r], rows[p] = rows[p], rows[r]
        pv = rows[r][col]
        rows[r] = [v / pv for v in rows[r]]
        for k in range(len(rows)):
            f = rows[k][col]
            if k != r and f != 0:
                rows[k] = [a - f * b for a, b in zip(rows[k], rows[r])]
        pivots.append(col)
        r += 1
        if r == len(rows):
            break
    y = [Fraction(0)] * nvars
    for k, col in enumerate(pivots):
        y[col] = rows[k][-1]
    return y


def _matrix(A, width, name):
    A = [[_frac(v) for v in row] for row in (A or [])]
    if any(len(row) != width for row in A):
        raise ValueError(name + " must have one column per variable")
    return A


def lp_max(c, A_ub, b_ub, A_eq=None, b_eq=None):
    """Maximize c x subject to A_ub x <= b_ub, A_eq x = b_eq and x >= 0, exactly."""
    c = [_frac(v) for v in c]
    n = len(c)
    A_ub = _matrix(A_ub, n, "A_ub")
    A_eq = _matrix(A_eq, n, "A_eq")
    b_ub = [_frac(v) for v in (b_ub or [])]
    b_eq = [_frac(v) for v in (b_eq or [])]
    if len(b_ub) != len(A_ub) or len(b_eq) != len(A_eq):
        raise ValueError("b_ub and b_eq must have one entry per row")
    m1, m2 = len(A_ub), len(A_eq)
    m = m1 + m2
    width = n + m1
    # Rows in the original orientation, with a slack column for each A_ub row.
    orig = [A_ub[i] + [Fraction(int(k == i)) for k in range(m1)] for i in range(m1)]
    orig += [A_eq[i] + [Fraction(0)] * m1 for i in range(m2)]
    rhs = b_ub + b_eq
    # A row gets an artificial variable if it is an equation or if its right side is negative.
    need = [i >= m1 or rhs[i] < 0 for i in range(m)]
    nart = sum(need)
    T, basis = [], []
    a = 0
    for i in range(m):
        sign = -1 if rhs[i] < 0 else 1
        row = [sign * v for v in orig[i]] + [Fraction(0)] * nart + [sign * rhs[i]]
        if need[i]:
            row[width + a] = Fraction(1)
            basis.append(width + a)
            a += 1
        else:
            basis.append(n + i)
        T.append(row)
    if nart:
        # Phase 1: maximize minus the sum of the artificial variables.
        obj = _objective_row([Fraction(0)] * width + [Fraction(-1)] * nart, T, basis)
        _simplex(T, obj, basis, width + nart)
        if obj[-1] != 0:
            return "infeasible", None, None, None
        keep = []
        for r in range(m):
            if basis[r] >= width:
                j = next((j for j in range(width) if T[r][j] != 0), None)
                if j is None:
                    continue  # the row is a combination of the other rows
                _pivot(T, [Fraction(0)] * (width + nart + 1), basis, r, j)
            keep.append(r)
        T = [T[r][:width] + [T[r][-1]] for r in keep]
        basis = [basis[r] for r in keep]
    # Phase 2: the original objective, without the artificial columns.
    cost = c + [Fraction(0)] * m1
    obj = _objective_row(cost, T, basis)
    if _simplex(T, obj, basis, width) == "unbounded":
        return "unbounded", None, None, None
    x = [Fraction(0)] * n
    for r, j in enumerate(basis):
        if j < n:
            x[j] = T[r][-1]
    value = sum((ci * xi for ci, xi in zip(c, x)), Fraction(0))
    # The dual solves y^T A_B = c_B, where A_B holds the basic columns of the original rows.
    M = [[orig[i][j] for i in range(m)] for j in basis]
    dual = _any_solution(M, [cost[j] for j in basis], m)
    return "optimal", x, value, dual


def lp_min(c, A_ub, b_ub, A_eq=None, b_eq=None):
    """Minimize c x subject to A_ub x <= b_ub, A_eq x = b_eq and x >= 0, exactly."""
    status, x, value, dual = lp_max([-_frac(v) for v in c], A_ub, b_ub, A_eq, b_eq)
    if status != "optimal":
        return status, None, None, None
    return status, x, -value, [-v for v in dual]
security_game.py 105 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/security-game/. The authors are listed in prov/ZA3ZMX.jsonl.
"""Strong Stackelberg equilibria of security games by one compact LP per target, in Fraction.

A game has T targets and k identical defender resources; each resource covers one target.
For target t, dc[t] > du[t] are the defender's payoffs when t is attacked while covered or
uncovered, and ac[t] < au[t] are the attacker's. The defender commits to a coverage vector
c with 0 <= c[t] <= 1 and sum(c) <= k (or sum(c) = k if all resources must be used); the
attacker attacks a target with the highest expected payoff, breaking ties in the defender's
favor.
"""

from fractions import Fraction

from agtlp import lp_max


def utilities(game, c, t):
    """(defender, attacker) expected payoffs when target t is attacked under coverage c."""
    dc, du, ac, au = game
    ct = Fraction(c[t])
    return ct * dc[t] + (1 - ct) * du[t], ct * ac[t] + (1 - ct) * au[t]


def best_for_target(game, k, t, use_all=False):
    """Return (value, c) of the best coverage under which t is a best target to attack, or None.

    With use_all, the coverage must sum to exactly k (no resource stays idle), and k <= T.
    """
    dc, du, ac, au = game
    T = len(dc)
    if use_all and not 0 <= k <= T:
        raise ValueError("use_all needs 0 <= k <= T")
    obj = [Fraction(0)] * T
    obj[t] = Fraction(dc[t] - du[t])
    A_ub, b_ub = [], []
    for s in range(T):
        if s != t:
            # Attacker: c_s (ac_s - au_s) + au_s <= c_t (ac_t - au_t) + au_t.
            row = [Fraction(0)] * T
            row[s] = Fraction(ac[s] - au[s])
            row[t] = -Fraction(ac[t] - au[t])
            A_ub.append(row)
            b_ub.append(Fraction(au[t] - au[s]))  # @line L2
    for s in range(T):
        A_ub.append([Fraction(int(r == s)) for r in range(T)])
        b_ub.append(Fraction(1))
    if use_all:
        status, c, value, _ = lp_max(obj, A_ub, b_ub, [[Fraction(1)] * T], [Fraction(k)])
    else:
        A_ub.append([Fraction(1)] * T)
        b_ub.append(Fraction(k))  # @line L3
        status, c, value, _ = lp_max(obj, A_ub, b_ub)
    if status != "optimal":  # @line L4
        return None
    return value + du[t], c


def strong_stackelberg(game, k, use_all=False):
    """Return (value, c, t): the defender's optimal coverage, its value and the attacked target."""
    best = None
    for t in range(len(game[0])):  # @line L1
        res = best_for_target(game, k, t, use_all)
        if res is not None and (best is None or res[0] > best[0]):  # @line L5
            best = (res[0], res[1], t)
    return best  # @line L6


def attacker_response(game, c):
    """The attacker's best target under c, with ties broken in the defender's favor."""
    T = len(game[0])
    pay = [utilities(game, c, t) for t in range(T)]
    top = max(a for _, a in pay)
    return max((t for t in range(T) if pay[t][1] == top), key=lambda t: (pay[t][0], -t))


def comb_mixture(c):
    """Write coverage c (entries in [0, 1]) as a distribution over sets of at most ceil(sum c) targets.

    Lay the c[t] end to end on [0, sum c]. For an offset u in [0, 1), cover the targets whose
    intervals contain u, u + 1, u + 2, ... . Each target is covered for a set of offsets of
    measure c[t], and no target twice, since its interval is at most 1 long. Return a list of
    (probability, sorted tuple of targets), one entry for each interval of offsets.
    """
    c = [Fraction(v) for v in c]
    ends, total = [], Fraction(0)
    for v in c:
        total += v
        ends.append(total)
    cuts = sorted({Fraction(0), Fraction(1)} | {e - int(e) for e in ends if 0 < e - int(e)})
    out = []
    for lo, hi in zip(cuts, cuts[1:]):
        u = (lo + hi) / 2
        cover, start = [], Fraction(0)
        for t, e in enumerate(ends):
            # Target t holds the points in [start, e); find a point u + r in it.
            r = 0
            while u + r < e:
                if u + r >= start:
                    cover.append(t)
                    break
                r += 1
            start = e
        out.append((hi - lo, tuple(cover)))
    return out
test_security_game.py 120 lines
# SPDX-License-Identifier: MIT
# Part of https://algorithm.tamnd.com/security-game/. The authors are listed in prov/ZA3ZMX.jsonl.

import random
from fractions import Fraction
from itertools import combinations

from agtlp import lp_max
from security_game import attacker_response, best_for_target, comb_mixture, strong_stackelberg, utilities

F = Fraction

# Three targets, one resource. Defender: covered / uncovered; attacker: covered / uncovered.
PAGE_GAME = ([1, 1, 0], [-5, -3, -1], [-1, -1, -1], [5, 3, 1])


def normal_form_commitment(game, k, use_all=False):
    """The optimal commitment over all sets of at most k targets (exactly k with use_all),
    by one LP per attacked target on the normal form."""
    dc, du, ac, au = game
    T = len(dc)
    sizes = [k] if use_all else range(k + 1)
    subsets = [S for r in sizes for S in combinations(range(T), r)]
    A = [[dc[t] if t in S else du[t] for t in range(T)] for S in subsets]
    B = [[ac[t] if t in S else au[t] for t in range(T)] for S in subsets]
    m = len(subsets)
    best = None
    for j in range(T):
        A_ub = [[B[i][s] - B[i][j] for i in range(m)] for s in range(T) if s != j]
        status, _, value, _ = lp_max([A[i][j] for i in range(m)], A_ub, [0] * len(A_ub), [[1] * m], [1])
        if status == "optimal" and (best is None or value > best):
            best = value
    return best


def random_game(rng, T):
    dc = [rng.randint(0, 6) for _ in range(T)]
    du = [v - rng.randint(1, 8) for v in dc]
    ac = [rng.randint(-6, 0) for _ in range(T)]
    au = [v + rng.randint(1, 8) for v in ac]
    return dc, du, ac, au


def check(game, k, value, c, t, use_all=False):
    T = len(game[0])
    assert all(0 <= v <= 1 for v in c) and (sum(c) == k if use_all else sum(c) <= k)
    att = [utilities(game, c, s)[1] for s in range(T)]
    assert att[t] == max(att)
    assert utilities(game, c, t)[0] == value
    assert utilities(game, c, attacker_response(game, c))[0] == value


def check_mixture(c, k):
    mix = comb_mixture(c)
    assert sum(p for p, _ in mix) == 1 and all(p > 0 for p, _ in mix)
    for _, S in mix:
        assert len(S) == len(set(S)) and len(S) <= k
    for t in range(len(c)):
        assert sum(p for p, S in mix if t in S) == c[t]


def test_page_example():
    value, c, t = strong_stackelberg(PAGE_GAME, 1)
    assert (value, c, t) == (F(-7, 5), [F(3, 5), F(2, 5), F(0)], 0)
    check(PAGE_GAME, 1, value, c, t)
    assert [utilities(PAGE_GAME, c, s)[1] for s in range(3)] == [F(7, 5), F(7, 5), 1]
    assert [utilities(PAGE_GAME, c, s)[0] for s in range(3)] == [F(-7, 5), F(-7, 5), -1]
    assert best_for_target(PAGE_GAME, 1, 2) is None
    assert normal_form_commitment(PAGE_GAME, 1) == value == normal_form_commitment(PAGE_GAME, 1, True)
    assert comb_mixture(c) == [(F(3, 5), (0,)), (F(2, 5), (1,))]


def test_random_games_against_normal_form():
    rng = random.Random(1123)
    for _ in range(40):
        T = rng.randint(1, 4)
        k = rng.randint(1, T)
        game = random_game(rng, T)
        for use_all in (False, True):
            value, c, t = strong_stackelberg(game, k, use_all)
            check(game, k, value, c, t, use_all)
            check_mixture(c, k)
            assert value == normal_form_commitment(game, k, use_all)


def test_idle_resources_can_help():
    # With 3 resources on 3 targets, using all of them forces the attacker to target 1,
    # while leaving target 0 partly open draws the attack there.
    game = ([6, 1, 0], [0, 0, -4], [-3, 0, 0], [2, 6, 3])
    assert strong_stackelberg(game, 3, use_all=True)[0] == 1
    value, c, t = strong_stackelberg(game, 3)
    assert value == F(12, 5) and t == 0 and c[0] < 1


def test_more_resources_never_hurt():
    rng = random.Random(8)
    for _ in range(30):
        T = rng.randint(2, 5)
        game = random_game(rng, T)
        values = [strong_stackelberg(game, k)[0] for k in range(0, T + 1)]
        assert all(a <= b for a, b in zip(values, values[1:]))


def test_comb_mixture_examples():
    check_mixture([F(1, 2), F(1, 2), F(1, 2), F(1, 2)], 2)
    assert comb_mixture([F(1, 2), F(1, 2), F(1, 2), F(1, 2)]) == [(F(1, 2), (0, 2)), (F(1, 2), (1, 3))]
    check_mixture([F(1), F(1, 3), F(2, 3)], 2)
    rng = random.Random(3)
    for _ in range(200):
        T = rng.randint(1, 6)
        c = [F(rng.randint(0, 6), 6) for _ in range(T)]
        k = -(-sum(c) // 1)
        check_mixture(c, max(k, 0))


def test_no_resources():
    game = ([1, 2], [-4, -1], [-1, -1], [3, 2])
    value, c, t = strong_stackelberg(game, 0)
    assert (value, c, t) == (-4, [0, 0], 0)
    assert best_for_target(game, 0, 1) is None

References

  1. Security and Game Theory, the security game model, coverage vectors, strong Stackelberg equilibria and the deployed systems
  2. Christopher Kiekintveld, Manish Jain, Jason Tsai, James Pita, Fernando Ordonez and Milind Tambe, Computing optimal randomized resource allocations for massive security games, Proceedings of AAMAS 2009, pp. 689 to 696 (compact formulations in terms of the coverage of each target, for games with many targets)
  3. Dmytro Korzhyk, Vincent Conitzer and Ronald Parr, Complexity of computing optimal Stackelberg strategies in security resource allocation games, Proceedings of AAAI 2010, the complexity of the optimal commitment when resources cover schedules of targets
  4. Dmytro Korzhyk, Zhengyu Yin, Christopher Kiekintveld, Vincent Conitzer and Milind Tambe, Stackelberg vs. Nash in security games: an extended investigation of interchangeability, equivalence, and uniqueness, Journal of Artificial Intelligence Research 41, 2011, pp. 297 to 327 (Nash equilibria are interchangeable, and under a natural restriction every Stackelberg strategy is a Nash strategy)

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)
WritingW4 complete
  • a review of the text: no review record reviews/ZA3ZMX/text.yaml