Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add brute force method for finding pure nash equilibria. #276

Merged
merged 1 commit into from
Nov 25, 2016

Conversation

shizejin
Copy link
Member

@shizejin shizejin commented Nov 25, 2016

Based on #266.

Add a function pure_nash_brute to find all pure nash equilibria of a normal form game using brute force method.

For example, consider the Prisoners' Dilemma game.

>>> PD_bimatrix = [[(1, 1), (-2, 3)],
...                [(3, -2), (0, 0)]]
>>> g_PD = NormalFormGame(PD_bimatrix)
>>> pure_nash_brute(g_PD)
[(1, 1)]

Mainly referred to Tools for Game Theory. @oyamad

@coveralls
Copy link

Coverage Status

Coverage increased (+0.04%) to 83.405% when pulling 1d709ab on shizejin:brute_force_pure_nash into 72f9034 on QuantEcon:master.

@oyamad
Copy link
Member

oyamad commented Nov 25, 2016

I have reviewed this, and it looks good to me.

@jstac
Copy link
Contributor

jstac commented Nov 25, 2016

It's a simple algorithm but a useful addition and very nicely written.

@shizejin Many thanks for your contribution.
@mmcky This looks good to me.

@mmcky
Copy link
Contributor

mmcky commented Nov 25, 2016

thanks @shizejin @oyamad @jstac. I will merge this now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants