Resources

Two-Person Zero-Sum Game (lpsole03)

 /***************************************************************/
 /*                                                             */
 /*            S A S   S A M P L E   L I B R A R Y              */
 /*                                                             */
 /*    NAME: lpsole03                                             */
 /*   TITLE: Two-Person Zero-Sum Game (lpsole03)                  */
 /* PRODUCT: OR                                                 */
 /*  SYSTEM: ALL                                                */
 /*    KEYS: OR                                                 */
 /*   PROCS: OPTMODEL                                           */
 /*    DATA:                                                    */
 /*                                                             */
 /* SUPPORT:                             UPDATE:                */
 /*     REF:                                                    */
 /*    MISC: Example 3 from the Linear Programming Solver       */
 /*          chapter of Mathematical Programming.               */
 /*                                                             */
 /***************************************************************/


proc optmodel;
   num a{1..3, 1..4}=[-5 3 1 8
                       5 5 4 6
                      -4 6 0 5];
   var x{1..4} >= 0;
   max f = sum{i in 1..4}x[i];
   con c{i in 1..3}: sum{j in 1..4}a[i,j]*x[j] <= 1;
   solve with lp / algorithm = ps presolver = none logfreq = 1;
   print x;
   print c.dual;
quit;