egtplot : A Python Package for Three-Strategy Evolutionary Games

In the study of evolutionary game theory (EGT), there exists a need for open source software for the visualization of the dynamics of games. The Python package egtplot represents an attempt to make simple, visual analysis of a particular class of evolutionary games–those with three players and which can be represented by a payoff matrix. Using egtplot, these games can be visualized as static images or as animations with a variety of parameters to control what information is presented in the graphic.


License
Authors of papers retain copyright and release the work under a Creative Commons Attribution 4.0 International License (CC-BY).

Summary
In the study of evolutionary game theory (EGT), there exists a need for open source software for the visualization of the dynamics of games.The Python package egtplot represents an attempt to make simple, visual analysis of a particular class of evolutionary games-those with three players and which can be represented by a payoff matrix.Using egtplot, these games can be visualized as static images or as animations with a variety of parameters to control what information is presented in the graphic.
EGT is a reformulation of classical game theory wherein the players of the game are members of a population.These members do not choose a strategy, but instead are born with their strategy ingrained, i.e., they cannot change strategy during the game.In biological terms, the strategies might represent discrete species or genotypes, hawks and doves being a classic example.Payoffs the players gain or lose based on their interactions with other players increase or decrease their fitness, thereby influencing the number or proportion of members playing that strategy in the next generation.As such, the populations of strategies can wax and wane as they outcompete or are outcompeted by other strategies.
As a very general model of cooperation and competition, EGT is well-suited for quantitative investigations of the dynamics of interactions between populations.EGT has been used to model phenomena from disparate areas of study, from poker (Javarone 2016) to hawks and doves (Smith and Price 1973) to host-parasite coevolution (Schenk, Traulsen, and Gokhale 2017).

Example Usage in Research
While there are many use cases for this software, our group's particular focus is on the mathematical modeling of cancer and cancer therapies through evolutionary game theory (Kaznatcheev, Vander Velde, et al. 2017, Kaznatcheev, Scott, andBasanta (2015), Kaznatcheev, Peacock, et al. (2017)).For details on analytical treatments of evolutionary games, please see Artem Kaznatcheev's blog at Theory, Evolution, and Games Group.
We demonstrate the features of egtplot via an example drawn from work modelling the interactions between cancer and healthy cells.Consider the following game from (Basanta et al. 2012) which describes the evolutionary game between three strategies of cells, labeled "S" (Stroma), "D" (micronenvironmentally dependent), and "I" (microenvironmentally independent): where α is the benefit derived from the cooperation between a S cell and a D cell, γ is the cost of being microenvironmentally independent, β is the cost of extracting resources from the microenvironment, and ρ is the benefit derived by a D cell from paracrine growth factors produced by I cells.This paper studies how the healthy cells that make up the majority of the prostate can cooperate and compete with mutant protate cells to produce a clinically-detectable prostate cancer.
Using our package, we can quickly and easily analyze this game numerically and visually.
To start, let us choose some simple values for each parameter: α = 1, β = 1, γ = 1, and ρ = 1. Figure 1 illustrates the output of the static visualization with the default parameters.This simplex depicts stable equilibria within the S-D and D-I edges, unstable equilibria at each vertex, and shows that every initial condition on the S-I edge is a stable equilibria.

Altering Plot Outputs
By altering the default values for the plotting function, a variety of different plotting styles can be achieved as demonstrated in Figure 2.  Finally, egtplot also has functionality to display animated versions of these plots.For further information on the use of the software and how these plots were created, please see the documentation and example notebook.

Figure 2 :
Figure 2: Left Background of the simplex is colored by the speed at which the points would travel along their trajectories.Right Displaying the paths taken by each initial condition.