pygambit.nash.liap_solve#

pygambit.nash.liap_solve(start: MixedStrategyProfile, maxregret: float = 0.0001, maxiter: int = 1000, nash_callback: Callable[[MixedStrategyProfileDouble], None] | None = None, event_callback: Callable[[LiapStartEvent | LiapEndEvent], None] | None = None) LiapResult#

Compute an approximate Nash equilibrium of a game using Lyapunov function minimization.

Changed in version 16.2.0: Method now takes a starting point (as a mixed strategy or mixed behavior profile) instead of a game. Implemented maxregret to specify acceptance criterion for approximation.

Changed in version 16.5.0: Computing agent Nash equilibria in the extensive game moved to liap_agent_solve for clarity.

Changed in version 17.0.0: start may now also be a MixedStrategyProfileRational; it is converted to floating-point via ~MixedStrategyProfile.as_float before minimization.

Parameters:
  • start (MixedStrategyProfile) – The starting profile for function minimization. Up to one equilibrium will be found from any starting profile, and the equilibrium found may (and generally will) depend on the initial profile chosen. If a MixedStrategyProfileRational is given, it is converted to floating-point precision first.

  • maxregret (float, default 1e-4) –

    The acceptance criterion for approximate Nash equilibrium; the maximum regret of any player must be no more than maxregret times the difference of the maximum and minimum payoffs of the game

    Added in version 16.2.0.

  • maxiter (int, default 1000) –

    Maximum number of iterations in function minimization.

    Added in version 16.2.0.

  • nash_callback (Callable[[MixedStrategyProfileDouble], None], optional) –

    If specified, called with the equilibrium found, if any.

    Added in version 17.0.0.

  • event_callback (Callable[[LiapStartEvent | LiapEndEvent], None], optional) –

    If specified, called at the start of minimization (LiapStartEvent) and, once, with the point and regret reached at its end (LiapEndEvent).

    Added in version 17.0.0.

Returns:

res – The result represented as a LiapResult object.

Return type:

LiapResult