Zero-Sum Games

Game Problem

Game solver of the game matrix designed for the row player

OperationsResearchModels.solveMethod
solve(p::GameProblem; verbose::Bool = false)::Vector{GameResult}

Solves a zero-sum game using the simplex method.

Arguments

  • p::GameProblem: The problem instance containing the decision matrix.
  • verbose: If true, prints the model information.

Returns

  • An array of GameResult objects containing the probabilities and value of the game.

Example

mat = [1 4 5; 5 6 2]

# 1 4 5
# 5 6 2
# The row player has 2 strategies, and the column player has 3 strategies.
# If the row player selects the first strategy and the column player selects the second strategy,
# the row player receives 4.

problem = GameProblem(mat)

result = solve(problem)

result1 = result[1]  # The result for the row player

println(result1.probabilities)
# 2-element Vector{Float64}:
#  0.42857142857142855
#  0.5714285714285714

println(result1.value)
# 3.285714285714285

result2 = result[2]  # The result for the column player

println(result2.probabilities)
# 3-element Vector{Float64}:
#   0.42857142857142855
#  -0.0
#   0.5714285714285714

println(result2.value)
# -3.285714285714285
source

GameResult

OperationsResearchModels.Game.GameResultType
GameResult

Description

A structure to hold the result of a game.

Fields

  • probabilities: Probabilities of the strategies
  • value: Value of the game
  • model::JuMP.Model: The JuMP model used to solve the game.
source