Zero-sum games and Karush-Kun-Takker conditions

In this article, I deal with the problem of finding balanced mixed strategies using antagonistic games as an example.


Let there be two players, A and B, who repeatedly play a certain game. Each player in each draw adheres to one of several strategies - for simplicity, we assume that the number of strategies for both players coincides and equalsn. When choosingistrategy first player and jstrategy of the second player, the first player will receive a win aijand the second player will get the same loss - this is how the antagonistic games are arranged. These wins can be written as a square matrixA:


A=aij,1i,jn


Players play the game repeatedly and can use different strategies in different sweepstakes. A mixed strategy is a vector of probabilities associated with each of the player ’s pure strategies. Each player chooses one of the strategies in the next draw in accordance with the probability defined for her by his mixed strategy. If denoted byp and qmixed strategies of players, then the mathematical expectation of winning the first player will be


f(p,q)=(Ap,q)=i=1nj=1npiqjaij


A pair of mixed strategies is called equilibrium if no player can increase their winnings by changing their strategy. In other words, for any other pair of strategiesp, qperformed:


(Ap,q)(Ap,q)(Ap,q)


Here we are now looking for such equilibria.


1. Equilibrium


So, a pair of mixed strategies forms an equilibrium if changing a mixed strategy for the first player cannot increase his winnings, and changing a mixed strategy for the second player cannot reduce his loss.


For example, consider such a payoff matrix:


A=(2341)


. , , . : (2 3). , , : (4 1). , , : (1 4). , . , , .


. , (1/2,1/2), (1/2,1/2). 2.5.


, , , . , .


pq, :


p=argmaxp(Ap,q),q=argminq(Ap,q)


:


pi0,qj0,1i,jn


i=1npi=j=1nqj=1


, . - : , .


, , :


A=(312231223)


, ,


i=1npi=j=1nqj=1



p=(0.74,0,29,0.03)


- , . - --.


2. --


-, , 1951- , , 1939- .


:


minxRf(x)


, :


hi(x)0,1im


lj(x)=0,1jr


, , , --:


x(f(x)i=1mλihi(x)j=1rμjlj(x))=0


λihi(x)=0,1im


λi0,1im


hi(x)0,1im


lj(x)=0,1jr


; .


— . :


  • hi(x)=0,
  • - hi(x)<0, λi=0.

, , , . , :


  • 2 λi;
  • 2, 1 5 ;
  • , 3 4;
  • 2 ;
  • , .

, . .


3.


. , , « ».


p:


  • (Ap,q)min
  • pi0,1in
  • j=1npi1=0

q:


  • (Ap,q)min
  • qj0,1jn
  • j=1nqj1=0

:


L1(p)=(Ap,q)+i=1nαipiβ(i=1npi1)


L2(q)=(Ap,q)+j=1nλjqjμ(j=1nqj1)


:


L1(p)pi=j=1naijqj+αiβ


L2(q)qj=i=1naijpi+λjμ


--, . p:


  • αipi=0,1in
  • αi0,1in
  • i=1npi=1
  • pi0,1in

q:


  • λjqj=0,1jn
  • λj0,1jn
  • j=1nqj=1
  • qj0,1jn

, :


j=1naijqjαi+β=0,1in


i=1naijpi+λjμ=0,1jn


i=1npi=1,j=1nqj=1


4n+22n+2. :


  • αipi=0,1in
  • λjqj=0,1jn

pi, αi, qj, λj. , 22n2n. 22n, 2n+22n+2( ).


, --:


αi,pi,λj,qj0,1i,jn


.


, . i:


j=1naijqjαi+β=0


, αi,


j=1naijqj+β=0


αi, qβ:


αi=j=1naijqj+β


, : A. , αi, λj: , ; . :


j=1naijqj+β=0,1in


i=1naijpiμ=0,1jn


i=1npi=1,j=1nqj=1


:


pi,qj0,1i,jn


, n+1n+1. .


5.


: , . . , p, q, p, q:


(Ap,q)(Ap,q)(Ap,q)


, , . , . , . : p1,q1;p2,q2;...;pk,qk— . p,q,


i1,...,k:(Api,q)(Ap,q)(Ap,qi)


6.


GitHub: https://github.com/ashagraev/zero_sum_game


matrix.h : , , . . , .


kkt.cpp. . , callback'.


There can be more than one equilibrium in a game; moreover, there can be infinitely many of them. In any case, you need to be prepared for the fact that the algorithm will output more than one solution (and the whole set of solutions will be some linear shell over the derived solutions). Therefore, the signature of the function assumes that the result is a vector of strategies, and not one strategy. And in main, accordingly, all these vectors are displayed .


Examples of input matrices for the program are in input.txt , and the results of running the program for these examples are in the file output.txt .


All Articles