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

Vertex enumeration #155

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

samwycherley
Copy link

Adds the vertex enumeration algorithm from B. von Stengel, Chapter 3 in Nisan et al (eds.) Algorithmic Game Theory (2007), using Polyhedra.jl. Still not quite as fast as support_enumeration (but close).

@oyamad
Copy link
Member

oyamad commented Jun 4, 2022

@samwycherley Thank you for the PR!

First of all, will you add your test file to runtests.jl by

include("test_vertex_enumeration.jl")

@samwycherley
Copy link
Author

@oyamad Sorry, should be fixed now

@oyamad
Copy link
Member

oyamad commented Jun 4, 2022

Thanks.
A few general comments first:

  • For readability, could you reduce the length of each line? I limit to 80 characters per line myself, while it seems standard to be 92 characters in Julia?

  • Could you delete the parts of the code that are commented out?

  • Is possible to return NEs with Rational entries if the input game has Rational payoffs?
    support_enumeration supports this:

    julia> g = NormalFormGame(Player([3//1 3; 2 5; 0 6]),
                              Player([3//1 2 3; 2 6 1]))
    3×2 NormalFormGame{2, Rational{Int64}}
    
    julia> support_enumeration(g)
    3-element Vector{Tuple{Vector{Rational{Int64}}, Vector{Rational{Int64}}}}:
     ([1//1, 0//1, 0//1], [1//1, 0//1])
     ([4//5, 1//5, 0//1], [2//3, 1//3])
     ([0//1, 1//3, 2//3], [1//3, 2//3])

src/vertex_enumeration.jl Outdated Show resolved Hide resolved
@oyamad
Copy link
Member

oyamad commented Jun 4, 2022

  • Please allow the user to pass a Polyhedra package to Polyhedra.polyhedron. As an example, see the plib option in outerapproximation.

@samwycherley
Copy link
Author

Thanks for the suggestions! It should now work that inputting rational payoffs returns a vector of rational Nash equilibria, and I have also implemented the other suggestions.

@oyamad
Copy link
Member

oyamad commented Jun 4, 2022

Great!

  • Could you add a test with a Rational input (see this for an example)?

@samwycherley
Copy link
Author

Added. I've also moved NEs_approx_equal from test_support_enumeration.jl to runtests.jl since I changed the vertex enumeration tests to use it

@samwycherley samwycherley requested a review from oyamad June 17, 2022 21:22
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.

2 participants