Papers
Topics
Authors
Recent
Search
2000 character limit reached

GameTheory Package for Equilibrium Analysis

Updated 7 July 2026
  • GameTheory is a Macaulay2 package that uses algebraic, combinatorial, polyhedral, and algebraic-statistical methods to compute various equilibrium notions in finite normal-form games.
  • It encodes finite games as lists of payoff tensors, enabling precise analysis of Nash, correlated, dependency, and conditional independence equilibria.
  • The package supports symbolic perturbation, mixed-volume bounds, and CI model saturation, offering deep geometrical insights into equilibrium structures.

GameTheory is a package for Macaulay2 for computing equilibria in finite normal-form games. In version 1.0, available since Macaulay2 version 1.25.05, it organizes four equilibrium notions—Nash, correlated, dependency, and conditional independence equilibria—within a single framework that uses algebraic, combinatorial, polyhedral, and algebraic-statistical methods rather than a single numerical paradigm (Connelly et al., 22 Jul 2025). A finite game is encoded as a list of payoff tensors, and the package exposes different computational objects according to the equilibrium notion under study: polynomial rings and ideals for Nash equilibria, polyhedra for correlated equilibria, determinantal ideals and Konstanz matrices for dependency equilibria, and graphical-model conditional-independence ideals together with saturated intersections for conditional independence equilibria.

1. Scope, representation, and package entry points

The package works with finite normal-form games. An nn-player game is encoded by a list

X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})

of payoff tensors, each of format (d0,,dn1)(d_0,\dots,d_{n-1}), where did_i is the number of pure strategies for player ii. The entry Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}} is the payoff to player ii when player kk chooses strategy jkj_k. In this representation, a game is an ordered list of tensors; games can be constructed manually with zeroTensor {d_0,...,d_(n-1)} and explicit entry assignment, or generated with randomTensor and randomGame. The default coefficient ring is Q\mathbb Q, and it can be changed with CoefficientRing => R (Connelly et al., 22 Jul 2025).

The package is loaded by the standard Macaulay2 command:

1
2
3
4
needsPackage "GameTheory"
<span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mi>i</mi></mrow><annotation encoding="application/x-tex">i</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6595em;"></span><span class="mord mathnormal">i</span></span></span></span>4m2
R = nashEquilibriumRing Y;
J = nashEquilibriumIdeal(R, Y);

and the resulting ideal satisfies

X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})0

Its decomposition reveals a unique totally mixed Nash equilibrium at

X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})1

but as a double point of the equilibrium ideal (Connelly et al., 22 Jul 2025).

The package also supports symbolic perturbation. In the same example, after perturbing one payoff tensor over X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})2, the last generator of the decomposition is

X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})3

From this, the paper infers two totally mixed Nash equilibria for X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})4, one double equilibrium at X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})5, and none otherwise (Connelly et al., 22 Jul 2025).

For generic games, the package also addresses upper bounds for the number of isolated totally mixed Nash equilibria. By Bernstein’s theorem, the count is bounded by the mixed volume of Newton polytopes. The command deltaList constructs the relevant polytope list, numberTMNE {d_0,...,d_(n-1)} computes the mixed-volume count via a vector bundle/Chern class formula, and blockDerangements computes the corresponding combinatorial count. For a generic X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})6-game,

X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})7

The paper notes that for X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})8, numberTMNE and blockDerangements remain fast whereas direct mixedVolume(deltaList {3,3,3}) is impractically slow (Connelly et al., 22 Jul 2025).

3. Correlated equilibria as convex polyhedra

For correlated equilibria, the package replaces independent mixed strategies by a joint probability distribution. If the game has format X=(X(0),,X(n1))X=(X^{(0)},\dots,X^{(n-1)})9, then the variable

(d0,,dn1)(d_0,\dots,d_{n-1})0

represents the probability of the pure strategy profile (d0,,dn1)(d_0,\dots,d_{n-1})1. These variables lie in the simplex

(d0,,dn1)(d_0,\dots,d_{n-1})2

with nonnegativity and normalization constraints (Connelly et al., 22 Jul 2025).

The correlated equilibrium inequalities are linear: (d0,,dn1)(d_0,\dots,d_{n-1})3 for all players (d0,,dn1)(d_0,\dots,d_{n-1})4 and pure strategies (d0,,dn1)(d_0,\dots,d_{n-1})5. Together with simplex constraints, these define the correlated equilibrium polytope (d0,,dn1)(d_0,\dots,d_{n-1})6 (Connelly et al., 22 Jul 2025).

The package uses probabilityRing Di to construct the ring of joint-probability variables and correlatedEquilibria X to return a Polyhedron object through Polyhedra.m2. In the Bach or Stravinsky example, the paper identifies three Nash equilibria inside the correlated equilibrium set: two pure equilibria,

(d0,,dn1)(d_0,\dots,d_{n-1})7

and one totally mixed equilibrium,

(d0,,dn1)(d_0,\dots,d_{n-1})8

A mediator that recommends (d0,,dn1)(d_0,\dots,d_{n-1})9 on heads and did_i0 on tails yields a Pareto-optimal correlated equilibrium. The computed polytope did_i1 is 3-dimensional with five vertices, and the paper interprets it geometrically as a double pyramid over a triangle associated with the Nash equilibria (Connelly et al., 22 Jul 2025).

4. Dependency equilibria and the Spohn variety

Dependency equilibria are defined on joint distributions but impose a different optimality condition from correlated equilibria. For player did_i2, conditioned on choosing pure strategy did_i3,

did_i4

For did_i5 in the interior of the simplex, did_i6 is a dependency equilibrium if

did_i7

Because all pairwise inequalities hold, one obtains

did_i8

This condition is encoded algebraically by the Spohn variety did_i9, defined by the vanishing of the ii0 minors of the Spohn matrices ii1 (Connelly et al., 22 Jul 2025).

The corresponding commands are spohnMatrices(PR,X) and spohnIdeal(PR,X). For generic payoff tensors, the paper recalls a theorem stating that the Spohn variety is irreducible of codimension

ii2

and degree

ii3

and that its intersection with the Segre variety inside the open simplex is exactly the set of totally mixed Nash equilibria. For a random ii4-game, the package verifies

ii5

as predicted by the generic theory (Connelly et al., 22 Jul 2025).

An alternative representation uses the Konstanz matrix ii6, characterized by

ii7

The package provides konstanzMatrix(PR,X) for this representation. In Bach or Stravinsky, the Spohn variety is reducible, and the paper verifies computationally that if ii8 is the vectorization of the probability tensor ii9, then

Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}0

matching the theoretical definition (Connelly et al., 22 Jul 2025).

5. Conditional independence equilibria and graphical-model structure

The final equilibrium notion combines dependency equilibria with conditional independence constraints from algebraic statistics. A conditional independence statement has the form

Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}1

for disjoint sets Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}2 of players, and is encoded by the standard Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}3-minor equations

Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}4

Given a set Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}5 of such statements, the corresponding CI model Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}6 is the variety cut out by those equations (Connelly et al., 22 Jul 2025).

The package computes these ideals through GraphicalModels.m2. The command ciIdeal(PR, Stmts) accepts CI statements encoded as {A,B,C}, while ciIdeal(PR, G) uses the global Markov property of an undirected graph. Interoperability utilities include toMarkovRing, mapToMarkovRing, and mapToProbabilityRing. In a Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}7-game, the line graph on three vertices yields the same CI ideal as the statement that player 1 is independent of player 3 given player 2 (Connelly et al., 22 Jul 2025).

The equilibrium object is the Spohn CI variety

Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}8

where Xj0jn1(i)X^{(i)}_{j_0\cdots j_{n-1}}9 is the union of coordinate and marginal hyperplanes removed before closure. The main command is spohnCI(PR, X, Stmts) or spohnCI(PR, X, G). Internally, the method computes spohnIdeal(PR,X), intersects it with the CI model using intersectWithCImodel, and saturates by the hyperplanes

ii0

The paper notes that this saturation can be expensive. The implementation uses the Bayer strategy for saturation, and Verbose => true prints progress messages such as “Completed step 1 of saturating CI ideal” (Connelly et al., 22 Jul 2025).

A practical caveat is indexing. GraphicalModels.m2 uses one-based vertex labels, whereas GameTheory uses zero-based player and strategy indices. The package therefore permits relabeling graph vertices, including symbolic names such as Alice, Bob, and Claire, or explicit relabeling to {0,1,2} (Connelly et al., 22 Jul 2025).

6. Computational style, interoperability, and limitations

GameTheory does not force a single algorithmic paradigm. Nash and dependency equilibria are treated symbolically via rings, ideals, dimensions, degrees, decompositions, and determinantal structure; correlated equilibria are treated polyhedrally through linear inequalities and convex geometry; conditional independence equilibria add graphical-model ideals and saturation procedures (Connelly et al., 22 Jul 2025). This division of labor is also reflected in dependencies: the package explicitly relies on Polyhedra.m2 for correlated equilibria and GraphicalModels.m2 for conditional independence models.

Several limitations are stated directly. Direct mixed-volume computation can be too slow for larger formats, as illustrated by mixedVolume(deltaList {3,3,3}). Saturation in spohnCI and intersectWithCImodel can be computationally expensive. The package also focuses on algebraic and combinatorial formulations rather than classical numerical equilibrium algorithms such as Lemke–Howson (Connelly et al., 22 Jul 2025). A plausible implication is that its natural use case is structural analysis of finite normal-form games inside the Macaulay2 ecosystem, rather than large-scale numerical equilibrium computation.

This specialization distinguishes GameTheory from other game-theoretic software lines. “Game Theory Explorer” is a browser-based tool for creating extensive-form and strategic-form games and computing all Nash equilibria of two-player games (Savani et al., 2014). GPGame is an R package on CRAN for finding pure Nash equilibria in expensive black-box games by Bayesian optimization (Picheny et al., 2016). ZERO is an open-source C++ library for Reciprocally Bilinear Games and related mathematical-programming games (Dragotto et al., 2021). Arena is a prototype programmable framework for tournaments of heterogeneous games played by agents across multiple rounds and game types (Lawlor et al., 2018). Against that background, GameTheory occupies a distinct niche: finite normal-form games studied through algebraic geometry, polyhedral computation, and algebraic statistics rather than browser interaction, black-box optimization, mathematical-programming equilibrium search, or agent-based simulation.

7. Mathematical profile and place within equilibrium computation

The package’s defining feature is the coexistence of four equilibrium notions under one formal representation of a finite normal-form game. Nash equilibria appear as solutions of multilinear polynomial systems; correlated equilibria as points of a convex polytope; dependency equilibria as points on the Spohn variety cut out by ii1 minors; and conditional independence equilibria as saturated intersections of dependency-equilibrium structure with CI models from graphical models (Connelly et al., 22 Jul 2025). This architecture places equilibrium computation inside Macaulay2’s native strengths: ideal theory, decomposition, dimension and degree calculations, polyhedral geometry, and symbolic perturbation.

The examples in the paper show that the package is designed not only to return equilibria but to expose their geometry. In the McLennan ii2-game, the unique totally mixed Nash equilibrium appears as a double point of the equilibrium ideal. In Bach or Stravinsky, the correlated equilibrium set becomes a 3-dimensional polyhedron with five vertices, while the dependency-equilibrium variety is reducible in the nongeneric case and becomes prime after perturbation. In random ii3-games, generic codimension and degree predictions for the Spohn ideal are verified computationally (Connelly et al., 22 Jul 2025). These examples indicate that the package is aimed at analysis of equilibrium structure as much as at equilibrium detection itself.

In that sense, GameTheory is best understood as a Macaulay2 package for the geometry and combinatorics of equilibria in finite normal-form games. Its contribution is not to replace general-purpose numerical solvers, but to provide a unified symbolic and polyhedral environment in which Nash, correlated, dependency, and conditional independence equilibria can be represented, computed, perturbed, decomposed, and compared within a common algebraic framework (Connelly et al., 22 Jul 2025).

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to GameTheory package.