{"id":19645025,"url":"https://github.com/quantecon/gametheory.jl","last_synced_at":"2025-02-26T23:43:06.748Z","repository":{"id":38440777,"uuid":"51787870","full_name":"QuantEcon/GameTheory.jl","owner":"QuantEcon","description":"Algorithms and data structures for game theory in Julia","archived":false,"fork":false,"pushed_at":"2023-06-04T00:13:06.000Z","size":1287,"stargazers_count":123,"open_issues_count":24,"forks_count":24,"subscribers_count":14,"default_branch":"main","last_synced_at":"2024-10-30T04:29:58.231Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/QuantEcon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null},"funding":{"github":"numfocus","custom":"https://numfocus.org/donate-to-quantecon"}},"created_at":"2016-02-15T21:43:56.000Z","updated_at":"2024-09-10T01:24:25.000Z","dependencies_parsed_at":"2023-02-16T07:45:51.619Z","dependency_job_id":"852c27ff-5b09-4c22-bb8c-bfc27c684208","html_url":"https://github.com/QuantEcon/GameTheory.jl","commit_stats":{"total_commits":335,"total_committers":14,"mean_commits":"23.928571428571427","dds":0.408955223880597,"last_synced_commit":"2de99a6127996954fa073678322a9a4f91967414"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2FGameTheory.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2FGameTheory.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2FGameTheory.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/QuantEcon%2FGameTheory.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/QuantEcon","download_url":"https://codeload.github.com/QuantEcon/GameTheory.jl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240952958,"owners_count":19884019,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T14:31:40.766Z","updated_at":"2025-02-26T23:43:06.724Z","avatar_url":"https://github.com/QuantEcon.png","language":"Julia","funding_links":["https://github.com/sponsors/numfocus","https://numfocus.org/donate-to-quantecon"],"categories":[],"sub_categories":[],"readme":"# GameTheory.jl\n\n[![Build Status](https://github.com/QuantEcon/GameTheory.jl/workflows/CI/badge.svg)](https://github.com/QuantEcon/GameTheory.jl/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/QuantEcon/GameTheory.jl/branch/main/graph/badge.svg)](https://codecov.io/gh/QuantEcon/GameTheory.jl)\n[![](https://img.shields.io/badge/docs-stable-blue.svg)](https://QuantEcon.github.io/GameTheory.jl/stable)\n[![](https://img.shields.io/badge/docs-latest-blue.svg)](https://QuantEcon.github.io/GameTheory.jl/latest)\n\nAlgorithms and data structures for game theory in Julia\n\n## Example usage\n\nCreate a `NormalFormGame`:\n\n```julia\nusing GameTheory\nplayer1 = Player([3 3; 2 5; 0 6])\nplayer2 = Player([3 2 3; 2 6 1])\ng = NormalFormGame(player1, player2)\nprintln(g)\n```\n```\n3×2 NormalFormGame{2, Int64}:\n [3, 3]  [3, 2]\n [2, 2]  [5, 6]\n [0, 3]  [6, 1]\n```\n\n`lrsnash` calls the Nash equilibrium computation routine in [lrslib](http://cgm.cs.mcgill.ca/~avis/C/lrs.html)\n(through its Julia wrapper [LRSLib.jl](https://github.com/JuliaPolyhedra/LRSLib.jl)):\n\n```julia\nlrsnash(g)\n```\n```\n3-element Vector{Tuple{Vector{Rational{BigInt}}, Vector{Rational{BigInt}}}}:\n ([4//5, 1//5, 0//1], [2//3, 1//3])\n ([0//1, 1//3, 2//3], [1//3, 2//3])\n ([1//1, 0//1, 0//1], [1//1, 0//1])\n```\n\nA 2x2x2 `NormalFormGame`:\n\n```julia\ng = NormalFormGame((2, 2, 2))\ng[1, 1, 1] = [9, 8, 12]\ng[2, 2, 1] = [9, 8, 2]\ng[1, 2, 2] = [3, 4, 6]\ng[2, 1, 2] = [3, 4, 4]\nprintln(g)\n```\n```\n2×2×2 NormalFormGame{3, Float64}:\n[:, :, 1] =\n [9.0, 8.0, 12.0]  [0.0, 0.0, 0.0]\n [0.0, 0.0, 0.0]   [9.0, 8.0, 2.0]\n\n[:, :, 2] =\n [0.0, 0.0, 0.0]  [3.0, 4.0, 6.0]\n [3.0, 4.0, 4.0]  [0.0, 0.0, 0.0]\n```\n\n`hc_solve` computes all isolated Nash equilibria of an N-player game by using\n[HomotopyContinuation.jl](https://github.com/JuliaHomotopyContinuation/HomotopyContinuation.jl):\n\n```julia\nNEs = hc_solve(g)\n```\n```\n9-element Vector{Tuple{Vector{Float64}, Vector{Float64}, Vector{Float64}}}:\n ([2.63311e-36, 1.0], [0.333333, 0.666667], [0.333333, 0.666667])\n ([0.25, 0.75], [1.0, 0.0], [0.25, 0.75])\n ([0.0, 1.0], [0.0, 1.0], [1.0, 0.0])\n ([0.25, 0.75], [0.5, 0.5], [0.333333, 0.666667])\n ([0.5, 0.5], [0.5, 0.5], [1.0, 1.37753e-40])\n ([1.0, 0.0], [0.0, 1.0], [0.0, 1.0])\n ([0.5, 0.5], [0.333333, 0.666667], [0.25, 0.75])\n ([1.0, 0.0], [1.0, 9.40395e-38], [1.0, -9.40395e-38])\n ([0.0, 1.0], [1.0, 0.0], [0.0, 1.0])\n```\n\nSee the tutorials for further examples.\n\n## Implemented algorithms\n\n### Nash equilibrium computation\n\n* [`pure_nash`](https://quantecon.github.io/GameTheory.jl/stable/lib/computing_nash_equilibria.html#GameTheory.pure_nash-Tuple{NormalFormGame}):\n  Find all pure-action Nash equilibria of an N-player game (if any)\n* [`support_enumeration`](https://quantecon.github.io/GameTheory.jl/stable/lib/computing_nash_equilibria.html#GameTheory.support_enumeration-Union{Tuple{NormalFormGame{2,%20T}},%20Tuple{T}}%20where%20T):\n  Find all mixed-action Nash equilibria of a two-player nondegenerate game\n* [`lrsnash`](https://quantecon.github.io/GameTheory.jl/stable/lib/computing_nash_equilibria.html#GameTheory.lrsnash-Tuple{NormalFormGame{2,%20%3C:Union{Int64,%20Rational}}}):\n  Find all mixed-action Nash equilibria (or equilibrium components) of a two-player game\n* [`hc_solve`](https://quantecon.github.io/GameTheory.jl/stable/lib/computing_nash_equilibria.html#GameTheory.hc_solve-Union{Tuple{NormalFormGame{N}},%20Tuple{N}}%20where%20N):\n  Find all isolated mixed-action Nash equilibria of an N-player game\n\n### Learning/evolutionary dynamics\n\n* [`BRD`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.BRD):\n  Best response dynamics\n* [`KMR`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.KMR):\n  Best response with mutations dynamics of Kandori-Mailath-Rob\n* [`SamplingBRD`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.SamplingBRD):\n  Sampling best response dynamics\n* [`FictitiousPlay`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.FictitiousPlay):\n  Fictitious play\n* [`StochasticFictitiousPlay`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.StochasticFictitiousPlay):\n  Stochastic fictitious play\n* [`LocalInteraction`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.LocalInteraction):\n  Local interaction dynamics\n* [`LogitDynamics`](https://quantecon.github.io/GameTheory.jl/stable/lib/learning_algorithms.html#GameTheory.LogitDynamics):\n  Logit dynamics\n\n### Repeated games\n\n* [`outerapproximation`](https://quantecon.github.io/GameTheory.jl/stable/lib/repeated_games.html#GameTheory.outerapproximation-Tuple{RepeatedGame{2}}):\n  Equilibrium payoff computation algorithm by Judd-Yeltekin-Conklin\n\n## Tutorials\n\n* [Tools for Game Theory in GameTheory.jl](https://nbviewer.org/github/QuantEcon/game-theory-notebooks/blob/main/game_theory_jl.ipynb)\n* [A Recursive Formulation of Repeated Games](https://nbviewer.org/github/QuantEcon/QuantEcon.notebooks/blob/master/recursive_repeated_games.ipynb)\n\nSee also the [`game_theory`](https://quanteconpy.readthedocs.io/en/latest/game_theory.html) submodule of\n[`QuantEcon.py`](https://github.com/QuantEcon/QuantEcon.py),\nthe Python counterpart of this package.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantecon%2Fgametheory.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fquantecon%2Fgametheory.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fquantecon%2Fgametheory.jl/lists"}