lrsnash

jlgametheory.lrsnash(g)[source]

Compute in exact arithmetic all extreme mixed-action Nash equilibria of a 2-player normal form game with integer payoffs, with the lexicographic reverse search vertex enumeration algorithm.

This function calls the Nash equilibrium computation routine of Avis, Rosenberg, Savani, and von Stengel [1] implemented in lrslib (through its Julia wrapper LRSLib.jl).

Parameters

gNormalFormGame

2-player NormalFormGame instance with integer payoffs.

Returns

NEslist(tuple(ndarray(object, ndim=1)))

List containing tuples of Nash equilibrium mixed actions, where the values are represented by fractions.Fraction.

Examples

A degenerate game example:

>>> import quantecon.game_theory as gt
>>> import jlgametheory as jgt
>>> from pprint import pprint
>>> bimatrix = [[(3, 3), (3, 3)],
...             [(2, 2), (5, 6)],
...             [(0, 3), (6, 1)]]
>>> g = gt.NormalFormGame(bimatrix)
>>> NEs = jgt.lrsnash(g)
>>> pprint(NEs)
[(array([Fraction(1, 1), Fraction(0, 1), Fraction(0, 1)], dtype=object),
  array([Fraction(1, 1), Fraction(0, 1)], dtype=object)),
 (array([Fraction(1, 1), Fraction(0, 1), Fraction(0, 1)], dtype=object),
  array([Fraction(2, 3), Fraction(1, 3)], dtype=object)),
 (array([Fraction(0, 1), Fraction(1, 3), Fraction(2, 3)], dtype=object),
  array([Fraction(1, 3), Fraction(2, 3)], dtype=object))]

The set of Nash equilibria of this degenerate game consists of an isolated equilibrium, the third output, and a non-singleton equilibrium component, the extreme points of which are given by the first two outputs.

References