pygambit.nash.enummixed_solve#
- pygambit.nash.enummixed_solve(game: Game, rational: bool = True, lrsnash_path: Path | str | None = None, nash_callback: Callable[[MixedStrategyProfile], None] | None = None, cliques: bool = False) EnumMixedResult#
Compute all mixed-strategy Nash equilibria of a two-player game using the strategic representation.
- Parameters:
game (Game) – The game to compute equilibria in.
rational (bool, default True) – Compute using rational numbers. If False, using floating-point arithmetic. Using rationals is more precise, but slower.
lrsnash_path (pathlib.Path | str | None = None,) –
If specified, use lrsnash to solve the systems of equations. This argument specifies the path to the lrsnash executable.
Added in version 16.3.0.
nash_callback (Callable[[MixedStrategyProfile], None], optional) –
If specified, called with each equilibrium as it is found, before the method continues searching for any further equilibria. Not available when lrsnash_path is specified.
Added in version 17.0.0.
cliques (bool, default False) –
If specified and True, also compute the sets of extreme equilibria which are connected to one another, returned as res.cliques. Not available when lrsnash_path is specified.
Added in version 17.0.0.
- Returns:
res – The result represented as an
EnumMixedResultobject.- Return type:
- Raises:
RuntimeError – If game has more than two players.
ValueError – If both lrsnash_path and nash_callback are specified, or both lrsnash_path and cliques are specified.
Notes
lrsnash is part of lrslib, available at http://cgm.cs.mcgill.ca/~avis/C/lrs.html
