Nash Equilibrium of generalized Rock-Paper-Scissors games?
I am but a humble programmer who is interested in calculating the Nash equilibrium for games for symmetric zero-sum games similar to Rock Paper Scissors. The context, if you're curious, is that I was thinking about TCG metagames, where you have several relevant decks that have strong and weak matchups against each other. Specifically, I'm thinking about games of the following form: Two players pick (simultaneously) from one of N pure strategies. Both players have the same set of choices. The payoff is defined by a matrix A such that 0 <= A[i,j] <= 1 and A[i,j] = 1 - A[j,i]. A[i,j] can be interpreted as the probability that strategy i beats strategy j. Equivalently, by letting B[i,j] = A[i,j] - 1/2 then -1/2 <= B[i,j] <= 1/2 and B[i,j] = -B[j,i] so the game is zero sum. Such a game is usually going to have a mixed Nash equilibrium (except in the trivial case where one strategy dominates all other). I believe it will also usually be unique, though I'm not positive on this? I did some reading on computing Nash equilibriums, and it sounds like it is in general a difficult problem (no polynomial time algorithm). However I'm hoping that with these constraints it is much easier? Given two mixed strategies u and v (represented as row vectors) such that sum( u [i]) = sum( v [i]) = 1, we can compute the expected payout for u as P( u , v ) = sum( u [i] v [j]A[i,j]) = u A v T. This is a polynomial equation of degree 2 in 2n-variables. By applying the constraint that sum( v [i]) = 1 we can reduce this to 2n-2 variables. By the symmetry of the problem, P( u , u ) = 1/2. Let some u be fixed. If u is a Nash equilibrium then any small change in v should not change P. Therefore ∇P/∇ v = 0 (gradient of P with respect to v , I don't know a notation for this?). Since every term in P is of the form k u [i] v [j], the ∇P/∇ v will be a first order polynomial in u, and this gradient equation yields a family of n-1 linear equations in n-1 variables, which should (ignoring edge cases that I have not thought sufficiently about) have a unique solution. This solution must necessarily be the Nash equilibrium, since we know at that at least one (probably mixed) Nash equilibrium must exist and satisfy ∇P/∇ v = 0. This solution can be found using Gaussian elimination in O(n3), which is satisfactory since for the problems I'm considering n < 20. Is my analysis correct? There are steps that I'm uncertain about and I've gone through a few iterations already. The solution I finally reach above is also simpler than I initially expected, which makes me worry that I've missed something or made an assumption that was too strong somewhere. I'm also worried about edge cases. If the algorithm above produces a solution but at least one u [i] < 0 or u [i] > 1 then I believe that means that the Nash equilibrium must lie somewhere on the constraint boundary. But I'm not sure what the best way to find it in this case would be. And what about cases where there are no solutions, or infinite solutions? I believe that infinite solutions implies that two pure strategies u [i] and u [j] are functionally identical, and therefore any mixed strategy satisfying some constraint u [i] + u [j] = k is a Nash equilibrium. But I'm not sure what no solutions would imply. I'm not even sure if it's possible given the problem constraints.