Evolutionary game theory describes frequency-dependent selection for fixed, heritable strategies in a population of competing individuals using a payoff matrix, typically described using well-mixed assumptions (replicator dynamics). IsoMaTrix is an open-source package which computes the isoclines (lines of zero growth) of matrix games, and facilitates direct comparison of well-mixed dynamics to structured populations in two or three dimensions. IsoMaTrix is coupled with a Hybrid Automata Library module to simulate structured matrix games on-lattice. IsoMaTrix can also compute fixed points, phase flow, trajectories, velocities (and subvelocities), delineated "region plots" of positive/negative strategy velocity, and uncertainty quantification for stochastic effects in structured matrix games. We describe a result obtained via IsoMaTrix's spatial games functionality, which shows that the timing of competitive release in a cancer model (under continuous treatment) critically depends on the initial spatial configuration of the tumor.
Availability and implementation:The code is available at: https://github.com/mathonco/isomatrix.EGT describes frequency-dependent selection for fixed, heritable strategies in a population of competing individuals. Competition is governed by a "payoff matrix," defining the Darwinian fitness of an individual based upon interactions with other individuals within the population. EGT is increasingly and broadly used to model cancer as an evolutionary process 4, 5 . For example, EGT models have shown success in modeling tumor growth 6 , competitive release in cancer treatment 7, 8 , optimal cancer treatment 9, 10 , glioma progression 11 , tumor acidity 12 , tumor-stroma interactions 13 , growth factor production as a public good 14 , and characterization of intercellular competition in vitro 15 .Herein, we develop a package to systematically analyze three-player matrix games. The package allows for easy comparison between analysis of the non-spatial, well-mixed assumption (i.e. replicator equation) to spatially-explicit formulations of matrix games in two-or three-dimensions. The package places a special focus on boundaries between the positive and negative growth regions of each strategy, known as isoclines. Thus, the name of this package, IsoMaTrix, is a blend of "isocline" and "matrix" games, to describe this key functionality. The name provides a near-homonym to "isometric," which is defined as "of or having equal dimensions." This fits the definition of linear matrix games displayed on a triangle with equal side dimensions (hence the capital 'T' for Tri).
Distinguishing features of IsomatrixIn recent years, several groups have released similar packages that compute evolutionary game dynamics of 3-or 4-strategy games (including replicator dynamics). Two packages were released in Mathematica (Dynamo 16, 17 , EvoDyn-3s 18 ). A more recent package in Python (EGTplot) allows for static or animated images of dynamics 19 . Most recently, an extension to model multiplayer games with collective in...