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

Not all Nash Equilibria are found by support_enumeration #222

Open
lolokoko28 opened this issue Nov 29, 2023 · 1 comment
Open

Not all Nash Equilibria are found by support_enumeration #222

lolokoko28 opened this issue Nov 29, 2023 · 1 comment

Comments

@lolokoko28
Copy link

Support Equilibria should "return all the equlibria" , so I would expect also the mixed equilibria. But it doesn't. The game from example has (p, 1) with p in <0, 2/7> but the function only returns (0,1).

I know that returning all the equlibria in case of infinite number of ne is not the possible. However, I would expect to get the "limit points", as this function is able to calculate mixed equlilibria as in case of Rock Paper Scissors game.

Code:

import nashpy
import numpy as np

n_game = nashpy.Game(np.array([[-3, 3], [-3, 5]]), np.array([[2, 7], [4, 2]]))

for ne in n_game.support_enumeration():
    print("Found Nash Equilibrium: ", ne)

mixed_nash_p1 = np.array([0.2857, 1 - 0.2857])
mixed_nash_p2 = np.array([1.0, 0.0])

print("Is (0.2857, 1.0) a best response? ", n_game.is_best_response(mixed_nash_p1, mixed_nash_p2))
print("Is (0.18, 1.0) a best response? ", n_game.is_best_response(np.array([0.18, 0.82]), np.array([1, 0])))

Output:

Found Nash Equilibrium:  (array([0., 1.]), array([1., 0.]))
Is (0.2857, 1.0) a best response?  (True, True)
Is (0.18, 1.0) a best response?  (True, True)
@drvinceknight
Copy link
Owner

Thanks for this, you're absolutely right that we should find a way to improve things here. The game is degenerate so the behaviour is somewhat expected but the usual warnings that pop up in some cases don't occur here.

We should essentially find a way to implement your implicit suggestion which is to get the limit points. I can open that up as a separate issue or discussion about implementation can occur here.

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

No branches or pull requests

2 participants