# drvinceknight/Nashpy

A library for the computation of Nash equilibria in two player games
Switch branches/tags
Nothing to show
drvinceknight Fix dois. (#52)
`Closes #51`
Latest commit 1912eab Sep 10, 2018
 Failed to load latest commit information. docs Aug 20, 2018 src/nashpy Jul 17, 2018 tests/unit Jul 30, 2018 .gitignore Jun 17, 2017 .travis.yml May 29, 2018 CHANGES.md Jul 17, 2018 CITATION.md Nov 12, 2016 LICENSE Nov 3, 2016 README.md Sep 10, 2018 appveyor.yml Jan 31, 2018 environment.yml Jun 17, 2017 paper.bib Sep 10, 2018 paper.md Sep 10, 2018 readthedocs.yml Jun 17, 2017 requirements.txt Jun 13, 2017 setup.py May 29, 2018

# Nash: a python library for the computation of equilibria of 2 player strategic games.

This library implements the following algorithms for Nash equilibria on 2 player games:

• Support enumeration
• Best response polytope vertex enumeration
• Lemke Howson algorithm

Nashpy has a simple set of Python dependencies: it only requires `numpy` and `scipy` so is straightforward to install on all operating systems.

## Installation

By design Nashpy is easy to install: the easiest way to install is from pypi:

`\$ pip install nashpy`

## Usage

Create bi matrix games by passing two 2 dimensional arrays/lists:

```>>> import nashpy as nash
>>> A = [[1, 2], [3, 0]]
>>> B = [[0, 2], [3, 1]]
>>> game = nash.Game(A, B)
>>> for eq in game.support_enumeration():
...     print(eq)
(array([ 1.,  0.]), array([ 0.,  1.]))
(array([ 0.,  1.]), array([ 1.,  0.]))
(array([ 0.5,  0.5]), array([ 0.5,  0.5]))
>>> game[[0, 1], [1, 0]]
array([3, 3])
```

## Documentation

Full documentation is available here: http://nashpy.readthedocs.io/

## Other game theoretic software

• Gambit is a library with a python api and support for more algorithms and more than 2 player games.
• Game theory explorer a web interface to gambit useful for teaching.
• Axelrod a research library aimed at the study of the Iterated Prisoners dilemma

## Development

To install a development version of this library:

``````\$ python setup.py develop
``````

To run the full test suite:

``````\$ python setup.py test
``````

All contributions are welcome, although this is meant to be a simple library, for more detailed game theoretic contribution please see gambit.

## Code of conduct

In the interest of fostering an open and welcoming environment, all contributors, maintainers and users are expected to abide by the Python code of conduct: https://www.python.org/psf/codeofconduct/