Skip to content

Commit 90b1c7a

Browse files
Merge branch 'master' into catalog/758
2 parents aae1504 + 2bc73d5 commit 90b1c7a

51 files changed

Lines changed: 779 additions & 1088 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/lint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
steps:
1212
- uses: actions/checkout@v6
1313
- name: Run clang-format style check for C/C++
14-
uses: jidicula/clang-format-action@v4.17.0
14+
uses: jidicula/clang-format-action@v4.18.0
1515
with:
1616
clang-format-version: '17'
1717
check-path: 'src'

ChangeLog

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
# Changelog
22

3-
## [16.6.0] - unreleased
3+
## [16.6.0] - 2026-03-24
44

55
### Changed
6+
- Gambit has a refreshed branding and logo which is reflected in this release!
67
- `Game.comment` has been renamed to `Game.description`
8+
- With behaviour profiles that reach some information sets with probability zero, beliefs, action
9+
values, and infoset values are not well-defined. These functions now return a
10+
`std::optional` in C++ and type or `None` in Python, where nulls indicate these quantities
11+
are not defined. (#446)
712

813
### Added
914
- Implement linear-time algorithm to find all root nodes of proper subgames, using an adaptation of
@@ -20,10 +25,6 @@
2025
root node is a member of an absent-minded infoset. (#584)
2126
- Removed spurious warning in graphical interface when loading file as a command-line argument
2227
(or also by clicking on a file in MSW, as that uses the command-line mechanism). (#801)
23-
24-
## [16.5.1] - unreleased
25-
26-
### Fixed
2728
- `Game.reveal` raised a null pointer access exception or dumped core in some cases (#749)
2829

2930
## [16.5.0] - 2026-01-05

MANIFEST.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
recursive-include src/core *.cc *.h *.imp
1+
recursive-include src/core *.cc *.h
22
recursive-include src/games *.cc *.h *.imp
3-
recursive-include src/solvers *.c *.cc *.h *.imp
3+
recursive-include src/solvers *.cc *.h *.imp
44
recursive-include catalog *
55
include src/gambit.h
66
include src/pygambit/*.pxd

Makefile.am

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,6 @@ gambit_enumpoly_SOURCES = \
406406
src/solvers/enumpoly/polypartial.imp \
407407
src/solvers/enumpoly/polysolver.cc \
408408
src/solvers/enumpoly/polysolver.h \
409-
src/solvers/enumpoly/polyfeasible.h \
410-
src/solvers/enumpoly/behavextend.cc \
411-
src/solvers/enumpoly/behavextend.h \
412409
src/solvers/enumpoly/efgpoly.cc \
413410
src/solvers/enumpoly/nfgpoly.cc \
414411
src/solvers/enumpoly/enumpoly.h \

build_support/GAMBIT_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16.5.0
1+
16.6.0

doc/algorithms.rst

Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
.. _algorithms:
2+
3+
Equilibrium computation
4+
=======================
5+
6+
The table below summarizes the available PyGambit functions and corresponding Gambit CLI programs
7+
for algorithms for computing Nash equilibria.
8+
9+
================ =========================================================================== ======================================== ==========================================
10+
Algorithm Description PyGambit function CLI command
11+
================ =========================================================================== ======================================== ==========================================
12+
:ref:`enumpure` Enumerate pure-strategy equilibria of a game :py:func:`pygambit.nash.enumpure_solve` :ref:`gambit-enumpure <gambit-enumpure>`
13+
:ref:`enummixed` Enumerate equilibria in a two-player game :py:func:`pygambit.nash.enummixed_solve` :ref:`gambit-enummixed <gambit-enummixed>`
14+
:ref:`enumpoly` Compute equilibria of a game using polynomial systems of equations :py:func:`pygambit.nash.enumpoly_solve` :ref:`gambit-enumpoly <gambit-enumpoly>`
15+
:ref:`lp` Compute equilibria in a two-player constant-sum game via linear programming :py:func:`pygambit.nash.lp_solve` :ref:`gambit-lp <gambit-lp>`
16+
:ref:`lcp` Compute equilibria in a two-player game via linear complementarity :py:func:`pygambit.nash.lcp_solve` :ref:`gambit-lcp <gambit-lcp>`
17+
:ref:`liap` Compute equilibria using function minimization :py:func:`pygambit.nash.liap_solve` :ref:`gambit-liap <gambit-liap>`
18+
:ref:`logit` Compute quantal response equilibria :py:func:`pygambit.nash.logit_solve` :ref:`gambit-logit <gambit-logit>`
19+
:ref:`simpdiv` Compute equilibria via simplicial subdivision :py:func:`pygambit.nash.simpdiv_solve` :ref:`gambit-simpdiv <gambit-simpdiv>`
20+
:ref:`ipa` Compute equilibria using iterated polymatrix approximation :py:func:`pygambit.nash.ipa_solve` :ref:`gambit-ipa <gambit-ipa>`
21+
:ref:`gnm` Compute equilibria using a global Newton method :py:func:`pygambit.nash.gnm_solve` :ref:`gambit-gnm <gambit-gnm>`
22+
================ =========================================================================== ======================================== ==========================================
23+
24+
.. _enumpure:
25+
26+
enumpure
27+
--------
28+
29+
Searches for pure-strategy Nash or agent Nash equilibria.
30+
31+
.. _enummixed:
32+
33+
enummixed
34+
---------
35+
36+
Computes Nash equilibria using extreme point enumeration.
37+
38+
In a two-player strategic game, the set of Nash equilibria can be expressed as the union of convex sets.
39+
This program generates all the extreme points of those convex sets. (Mangasarian [Man64]_)
40+
This is a superset of the points generated by the path-following procedure of Lemke and Howson (see :ref:`lcp`).
41+
It was shown by Shapley [Sha74]_ that there are equilibria not accessible via the method in :ref:`lcp`, whereas the output of
42+
:program:`enummixed` is guaranteed to return all the extreme points.
43+
44+
.. _enumpoly:
45+
46+
enumpoly
47+
--------
48+
49+
Computes Nash equilibria by solving systems of polynomial equations
50+
and inequalities.
51+
52+
This program searches for all Nash equilibria in a strategic game
53+
using a support enumeration approach. This approach computes all the
54+
supports which could, in principle, be the support of a Nash
55+
equilibrium. For each candidate support, it attempts to compute
56+
totally mixed equilibria on that support by successively subdividing
57+
the space of mixed strategy profiles or mixed behavior profiles (as appropriate).
58+
By using the fact that the equilibrium conditions imply a collection
59+
of equations and inequalities which can be expressed as multilinear
60+
polynomials, the subdivision constructed is such that each cell
61+
contains either no equilibria or exactly one equilibrium.
62+
63+
For strategic games, the program searches supports in the order proposed
64+
by Porter, Nudelman, and Shoham [PNS04]_. For two-player games, this
65+
prioritises supports for which both players have the same number of
66+
strategies. For games with three or more players, this prioritises
67+
supports which have the fewest strategies in total. For many classes
68+
of games, this will tend to lower the average time until finding one equilibrium,
69+
as well as finding the second equilibrium (if one exists).
70+
71+
For extensive games, a support of actions equates to allowing positive
72+
probabilities over a subset of terminal nodes. The indifference conditions
73+
used are those for the sequence form defined on the projection of the game
74+
to that support of actions. A solution to these equations implies a probability
75+
distribution over terminal nodes. The algorithm then searches for
76+
a profile that is a Nash equilibrium that implements that probability
77+
distribution. If there exists at least one such profile, a sample one is returned.
78+
Note that for probability distributions which assign zero probability to some terminal
79+
nodes, it is generally the case that there are (infinitely) many such profiles.
80+
Subsequent analysis of unreached information sets can yield alternative
81+
profiles that specify different choices at unreached information sets
82+
while still satisfying the Nash equilibrium conditions.
83+
84+
.. _lp:
85+
86+
lp
87+
---
88+
89+
Computes a Nash equilibrium in a two-player game by solving a linear program.
90+
For extensive games, the
91+
program uses the sequence form formulation of Koller, Megiddo, and von
92+
Stengel [KolMegSte94]_.
93+
94+
While the set of equilibria in a two-player constant-sum strategic
95+
game is convex, this method will only identify one of the extreme
96+
points of that set.
97+
98+
.. _lcp:
99+
100+
lcp
101+
---
102+
103+
Computes Nash equilibria of a two-player game by finding solutions to a linear
104+
complementarity problem. For extensive games, the program uses the
105+
sequence form representation of the extensive game, as defined by
106+
Koller, Megiddo, and von Stengel [KolMegSte94]_, and applies the
107+
algorithm developed by Lemke.
108+
109+
For strategic games, the program uses the method of Lemke and Howson
110+
[LemHow64]_. In this case, the method will find all "accessible"
111+
equilibria, i.e., those that can be found as concatenations of Lemke-Howson
112+
paths that start at the artificial equilibrium.
113+
There exist strategic-form games for which some equilibria cannot be found
114+
by this method, i.e., some equilibria are inaccessible; see Shapley [Sha74]_.
115+
116+
In a two-player strategic game, the set of Nash equilibria can be expressed
117+
as the union of convex sets. This program will find extreme points
118+
of those convex sets. See :ref:`enummixed` for a method
119+
which is guaranteed to find all the extreme points for a strategic
120+
game.
121+
122+
.. _liap:
123+
124+
liap
125+
----
126+
127+
Computes approximate Nash equilibria using a function minimization approach.
128+
129+
This procedure searches for equilibria by generating random starting
130+
points and using conjugate gradient descent to minimize the Lyapunov
131+
function of the game. This is a nonnegative function which is
132+
zero exactly at strategy profiles which are Nash equilibria.
133+
134+
Note that this procedure is not globally convergent. That is, it is
135+
not guaranteed to find all, or even any, Nash equilibria.
136+
137+
.. _logit:
138+
139+
logit
140+
-----
141+
142+
Computes the
143+
principal branch of the (logit) quantal response correspondence.
144+
145+
The method is based on the procedure described in Turocy [Tur05]_ for
146+
strategic games and Turocy [Tur10]_ for extensive games.
147+
It uses standard path-following methods (as
148+
described in Allgower and Georg's "Numerical Continuation Methods") to
149+
adaptively trace the principal branch of the correspondence
150+
efficiently and securely.
151+
152+
The method used is a predictor-corrector method, which first generates
153+
a prediction using the differential equations describing the branch of
154+
the correspondence, followed by a corrector step which refines the
155+
prediction using Newton's method for finding a zero of a function. Two
156+
parameters control the operation of this tracing.
157+
158+
The algorithm accepts an initial step size for the predictor phase of the tracing. This
159+
step size is then dynamically adjusted based on the rate of
160+
convergence of Newton's method in the corrector step. If the
161+
convergence is fast, the step size is adjusted upward (accelerated);
162+
if it is slow, the step size is decreased (decelerated). The
163+
maximum acceleration (or deceleration) can be set as an argument. As described in
164+
Turocy [Tur05]_, this acceleration helps to
165+
efficiently trace the correspondence when it reaches its asymptotic
166+
phase for large values of the precision parameter lambda.
167+
168+
In extensive games, logit quantal response equilibria are not well-defined
169+
if an information set is not reached due to being the successor of chance
170+
moves with zero probability. In such games, the implementation treats
171+
the beliefs at such information sets as being uniform across all member nodes.
172+
173+
.. _simpdiv:
174+
175+
simpdiv
176+
--------
177+
178+
Computes approximations to Nash equilibria using a simplicial subdivision
179+
approach.
180+
181+
This program implements the algorithm of van der Laan, Talman, and van
182+
Der Heyden [VTH87]_. The algorithm proceeds by constructing a triangulated grid
183+
over the space of mixed strategy profiles, and uses a path-following
184+
method to compute an approximate fixed point. This approximate fixed
185+
point can then be used as a starting point on a refinement of the
186+
grid. The program continues this process with finer and finer grids
187+
until locating a mixed strategy profile at which the maximum regret is
188+
small.
189+
190+
.. _ipa:
191+
192+
ipa
193+
---
194+
195+
Computes Nash
196+
equilibria using an iterated polymatrix approximation approach
197+
developed by Govindan and Wilson [GovWil04]_.
198+
This program is based on the
199+
`Gametracer 0.2 <http://dags.stanford.edu/Games/gametracer.html>`_
200+
implementation by Ben Blum and Christian Shelton.
201+
202+
The algorithm takes as a parameter a mixed strategy profile. This profile is
203+
interpreted as defining a ray in the space of games. The profile must have
204+
the property that, for each player, the most frequently played strategy must
205+
be unique.
206+
207+
.. _gnm:
208+
209+
gnm
210+
---
211+
212+
Computes Nash
213+
equilibria using a global Newton method approach developed by Govindan
214+
and Wilson [GovWil03]_. This program is based on the
215+
`Gametracer 0.2 <http://dags.stanford.edu/Games/gametracer.html>`_
216+
implementation by Ben Blum and Christian Shelton.
217+
218+
The algorithm takes as a parameter a mixed strategy profile. This profile is
219+
interpreted as defining a ray in the space of games. The profile must have
220+
the property that, for each player, the most frequently played strategy must
221+
be unique.

doc/index.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ construction and analysis of finite extensive and strategic games.
3434
:expand:
3535

3636

37-
.. grid-item-card:: 🖥️ Command-line tools
37+
.. grid-item-card:: 🧮 Analysing games
3838
:columns: 4
3939

40-
Quickly compute equilibria with the Gambit command-line tools.
40+
Compute equilibria and run econometric estimations.
4141

42-
.. button-ref:: command-line
42+
.. button-ref:: algorithms
4343
:ref-type: ref
4444
:click-parent:
4545
:color: secondary
@@ -84,6 +84,7 @@ construction and analysis of finite extensive and strategic games.
8484
:maxdepth: 1
8585

8686
install
87+
algorithms
8788
pygambit
8889
tools
8990
gui

doc/pygambit.rst

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -56,26 +56,6 @@ These tutorials assume you have read the new user tutorials and are familiar wit
5656

5757
tutorials/interoperability_tutorials/openspiel
5858

59-
Algorithms for computing Nash equilibria
60-
----------------------------------------
61-
62-
Interfaces to algorithms for computing Nash equilibria are provided in :py:mod:`pygambit.nash`.
63-
The table below summarizes the available PyGambit functions and the corresponding Gambit CLI commands.
64-
65-
========================================== ========================================
66-
CLI command PyGambit function
67-
========================================== ========================================
68-
:ref:`gambit-enumpure <gambit-enumpure>` :py:func:`pygambit.nash.enumpure_solve`
69-
:ref:`gambit-enummixed <gambit-enummixed>` :py:func:`pygambit.nash.enummixed_solve`
70-
:ref:`gambit-lp <gambit-lp>` :py:func:`pygambit.nash.lp_solve`
71-
:ref:`gambit-lcp <gambit-lcp>` :py:func:`pygambit.nash.lcp_solve`
72-
:ref:`gambit-liap <gambit-liap>` :py:func:`pygambit.nash.liap_solve`
73-
:ref:`gambit-logit <gambit-logit>` :py:func:`pygambit.nash.logit_solve`
74-
:ref:`gambit-simpdiv <gambit-simpdiv>` :py:func:`pygambit.nash.simpdiv_solve`
75-
:ref:`gambit-ipa <gambit-ipa>` :py:func:`pygambit.nash.ipa_solve`
76-
:ref:`gambit-gnm <gambit-gnm>` :py:func:`pygambit.nash.gnm_solve`
77-
========================================== ========================================
78-
7959
API documentation
8060
----------------
8161

doc/tools.convert.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
:program:`gambit-convert`: Convert games among various representations
2-
======================================================================
1+
:program:`gambit-convert`
2+
=========================
33

44
:program:`gambit-convert` reads a game on standard input in any supported format
55
and converts it to another text representation. Currently, this tool supports

doc/tools.enummixed.rst

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,10 @@
11
.. _gambit-enummixed:
22

3-
:program:`gambit-enummixed`: Enumerate equilibria in a two-player game
4-
======================================================================
5-
6-
:program:`gambit-enummixed` reads a two-player game on standard input and
7-
computes Nash equilibria using extreme point enumeration.
8-
9-
In a two-player strategic game, the set of Nash equilibria can be expressed
10-
as the union of convex sets. This program generates all the extreme
11-
points of those convex sets. (Mangasarian [Man64]_)
12-
This is a superset of the points generated by the path-following
13-
procedure of Lemke and Howson (see :ref:`gambit-lcp`). It was
14-
shown by Shapley [Sha74]_ that there are equilibria not accessible via
15-
the method in :ref:`gambit-lcp`, whereas the output of
16-
:program:`gambit-enummixed` is guaranteed to return all the extreme
17-
points.
3+
:program:`gambit-enummixed`
4+
===========================
5+
6+
Enumerate equilibria in a two-player game.
7+
See the :ref:`algorithm description <enummixed>` for full details.
188

199
.. program:: gambit-enummixed
2010

0 commit comments

Comments
 (0)