csci 3210: computational game theory linear programming

20
2/16/17 1 CSCI 3210: Computational Game Theory Mohammad T. Irfan Email: [email protected] Web: www.bowdoin.edu/~mirfan Course Website: www.bowdoin.edu/~mirfan/CSCI-3210.html Linear Programming and 2-Player Zero-Sum Games Ref: Wikipedia and [AGT] Ch 1 2-player zero-sum game Prove that NE existsin two ways 1. Nash's theorem Doesn't give an algorithm (why?) 2. Linear programming Gives an algorithm (next assignment)

Upload: others

Post on 02-Jan-2022

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

1  

CSCI 3210: Computational Game Theory

Mohammad T. Irfan

Email: [email protected] Web: www.bowdoin.edu/~mirfan

Course Website: www.bowdoin.edu/~mirfan/CSCI-3210.html

Linear Programming and 2-Player Zero-Sum Games Ref: Wikipedia and [AGT] Ch 1

2-player zero-sum game

u  Prove that NE exists– in two ways

1.  Nash's theorem u  Doesn't give an algorithm (why?)

2.  Linear programming u  Gives an algorithm (next assignment)

Page 2: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

2  

Example: 2-player zero-sum game

u  Penalty kick game

Left (0.42)

Right (0.58)

Left (0.38)

0.58, 0.42

0.95, 0.05

Right (0.62)

0.93, 0.07

0.70, 0.30

Shoo

ter

Goalkeeper

Example: 2-player zero-sum game

u  Fictitious game

u  Assumption (wlog): sum of payoffs in each cell is 0

u  More than 2 actions? u  Need an algorithm

L R

U 2, -2 -1, 1

D -3, 3 4, -4

Row

pla

yer

Column player

L R

U 2 -1

D -3 4

Page 3: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

3  

Linear Programming (LP)

Will come back to game theory later

Applications

u  Optimization u  Production, machine scheduling, employee

scheduling, supply chain management, etc.

u  Game theory

u  In general– optimization

Page 4: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

4  

LP

1.  Variables (or decision variables) u  We can choose the values of these variables

u  Why/what's the goal?

u  What values can we choose?

2.  Objective function (Why?) u  Minimization or maximization

u  Must be linear in the variables

3.  Constraints (What values?) u  Restricts the values of choice variables

u  Must be linear in the variables

Example

u  I'm planning my day-to-day life. Outside of 10 hours of sleep every day, I want to set aside a few hours for studying and a few hours for enjoying other things in life.

u  I get 10 units of payoff from every hour of study and 20 units of payoff from every hour of other activities.

u  I know that I must study at least 6 hours every day (to avoid getting fired from Bowdoin). Also, I feel guilty if I spend more than 6 hours on other activities.

u  How should I allocate my time optimally? u  Variables? u  Objective function? u  Constraints?

Page 5: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

5  

LP formulation

u Maximize 10 x1 + 20 x2

u  Subject to

x1 >= 6

x2 <= 6

x1 + x2 <= 14

x1, x2 >= 0

Geometric interpretation

u Maximize 10 x1 + 20 x2

u  Subject to

x1 >= 6

x2 <= 6

x1 + x2 <= 14

x1, x2 >= 0

u  Draw the "feasible region"

Page 6: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

6  

x1

x2

(0,0) 14

14

6

6

Note: x1, x2 >= 0: white region

Feasible region

One of the vertices (black dots) will give the optimal solution

Example: infeasible LP

u  I want to study at least 10 hours/day and do other activities for at least 5 hours/day. How should I allocate my time?

u  Maximize 10 x1 + 20 x2

u  Subject to

x1 >= 10

x2 >= 5

x1 + x2 <= 14

x1, x2 >= 0

Page 7: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

7  

Example: more var. & constraints

u  I get 15 units of payoff from every hour of study up to 3 hours and then 10 units of payoff from each additional hour of study (basically, my brain slows down). I also get 20 units of payoff from every hour of other activities. Everything else is unchanged.

u  Maximize 15 x1 + 10 x2 + 20 x3 u  Subject to

x1 + x2 >= 6 x1 <= 3 x3 <= 6 x1 + x2 + x3 <= 14 x1, x2, x3 >= 0

Example: unbounded LP

u  A tennis player is making a plan for practicing service and volley. She gets a payoff of 10 from every service and 5 from every volley.

u  She wants to practice service at least 100 times a day and doesn't want to practice volleys more than 500 times a day. What's her optimal plan?

u  Maximize 10 s + 5 v

u  Subject to s >= 100 v <= 500 s, v >= 0

Page 8: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

8  

Matrix algebra

u  Images from this tutorial: http://www.intmath.com/matrices-determinants/3-matrices.php

u  4x1 matrix (AKA vector)

u  3x3 matrix

Matrix multiplication

u  2x3 matrix multiplied by 3x2 matrix

u  Result is a 2x2 matrix

must match

Page 9: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

9  

Transpose of matrix

u  Transpose operator: superscript T

u  (A B)T = BT AT

A =123

456

!

"

###

$

%

&&&

AT =1 2 3

4 5 6

!

"

##

$

%

&&

Algorithms for solving LP

u  Simplex (Dantzig, 1947) u  Worst case exponential time

u  Practically fast

u  Ellipsoid (Khachiyan, 1979) u  O(n4 L) for n variables and L input bits

u  Pseudo-polynomial

u  Karmarkar's algorithm (Karmarkar, 1984) u  O(n3.5 L) for n variables and L input bits

u  Pseudo-polynomial, but breakthrough for practical reasons

u  Open problem: strongly polynomial algorithm?

Page 10: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

10  

LP Duality (von Neumann, 1947)

u  Interview with Dantzig u  http://www.personal.psu.edu/ecb5/Courses/

M475W/WeeklyReadings/Week%2015/An_Interview_with_George_Dantzig.pdf

u  If the "primal" LP is maximization, its "dual" is minimization and vice versa.

u  Every variable of the primal LP leads to a constraint in the dual LP and every constraint of the primal LP leads to a variable in the dual LP.

u  Dual of dual is primal.

Definition of dual LP Source: Applied Mathematical Programming book

Primal

Maximize cTxsubject to:

Ax <= bx >= 0

Dual

Minimize bTysubject to:

ATy >= cy >= 0

Page 11: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

11  

Example: LP duality u  How many Bowdoin logs and chocolate cakes should

Thorne make to maximize its revenue?

u  Objective function. Each log has a satisfaction of 10 (or price of $10), each cake 5.

u  Constraints. For both desserts, the chef needs to use an oven, a food processor, and a boiler.

Processing time/log Processing time/cake Total available time

Oven 5 min 1 min 85 min Food processor 1 min 10 min 300 min Boiler 4 min 6 min 120 min

Example: LP duality (cont...)

Primal LP

Maximize 10 x1 + 5 x2

Subject to

5 x1 + x2 <= 85 x1 + 10 x2 <= 300 4 x1 + 6 x2 <= 120

x1, x2 >= 0

Dual LP

Minimize 85y1 + 300y2 + 120y3

Subject to

5y1 + y2 + 4y3 >= 10

y1 + 10y2 + 6y3 >= 5

y1, y2, y3 >= 0

u  Intuition: dual gives the value of primal constraints u  Moulton wants to borrow Thorne's equipment for a day.

Thorne wants to charge "reasonable" prices $y1/min, $y2/min, and $y3/min for the 3 equipment, resp.

u  Dual objective: minimize total cost of renting

u  Dual constraints: recuperate lost payoff for each dessert

Page 12: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

12  

Another example: LP duality

Primal LP

Maximize 10 x1 + 20 x2

Subject to

x1 >= 6 (or, -x1 <= -6)

x2 <= 6

x1 + x2 <= 14

x1, x2 >= 0

Dual LP

Minimize -6 y1 + 6 y2 + 14 y3

Subject to

-y1 + y3 >= 10

y2 + y3 >= 20

y1, y2, y3 >= 0

Work out the solutions by hand

Complementary slackness

u  primal constraint non-binding (not equal) => corresponding dual variable = 0 u  Similar condition holds for dual constr. & primal

var.

u  The reverse implication may not hold

Page 13: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

13  

Weak duality theorem

Primal LP

Maximize ...

Dual LP

Minimize ...

Increasing objective function

Gap?

Weak duality theorem

u  Any feasible solution of the dual LP (minimization) gives an upper bound on the optimal solution of the primal LP (maximization).

u  Proof

u  Any feasible solution of the primal LP (maximization) is a lower bound on the optimal solution of the dual LP (minimization).

Primal LP (max)

Dual LP (min)

Increasing objective function

Gap?

Page 14: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

14  

Weak duality theorem

u  Implications u  Primal unbounded è Dual infeasible

u  Dual unbounded è Primal infeasible

u  Both primal and dual may be infeasible (although not implied by this theorem)

Primal LP (max)

Dual LP (min)

Increasing objective function

Gap?

Strong duality theorem

u  If the primal LP has a finite optimal solution, then so does the dual LP. Moreover, these two optimal solutions have the same objective function value. u  In other words, if either the primal or the dual LP

has a finite optimal solution, the gap between them is 0.

Page 15: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

15  

2-player zero-sum game

Algorithm via LP duality

Example: 2-player zero-sum game

u  Assumption (wlog): sum of payoffs in each cell is 0

L R

U 2, -2 -1, 1

D -3, 3 4, -4

Row

pla

yer

Column player

L R

U 2 -1

D -3 4

Matrix A

Page 16: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

16  

Row player

u  How much (vr) can row player guarantee self?

u  Mixed strategy p (vector of probabilities)

u  Expected payoff of column player for action j = (pTA)j = Σi (pi Ai,j)

u  LP

vr = max v

subject to

piAi, ji∑ ≥ v, for each action j of column player

pi =1i∑

pi ≥ 0, for each action i of row player

Row player's thought process: maximize my guaranteed payoff v from column player knowing that column player will always minimize her payout to me (in other words, v is the least for any action j of column player).

Column player

u  How much (vc) can col. player guarantee self?

u  Mixed strategy q (vector of probabilities)

u  Expected payoff of row player for action i = (Aq)i = Σj (Ai,j qj)

u  LP vc = min u subject to

Col. player's thought process: minimize my guaranteed payout u to row player knowing that row player will choose to maximize her payoff.

Ai, jq jj∑ ≤ u, for each action i of row player

qj =1j∑

qj ≥ 0, for each action j of column player

Page 17: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

17  

Minimax Theorem

u  At an equilibrium, vr = vc

u  Proof:

1.  The two LPs are duals of each other.

2.  Primal LP has a finite optimal solution (it's feasible + bounded).

3.  By duality theorem, vr = vc.

u  Another proof: 1.  Let v* be row player's payoff at a NE.

2.  vr <= v*, because is vr is row player's guaranteed payoff and v* cannot be lower than that.

3.  By assumption of NE, column player will not give row player more than vr. So, vr = v*. SImilarly, vc = v*.

u  This quantity vc or vr is known as the value of the game (v*)

Example: Infinite game with no NE

u  2-player game

u  Actions: Any real number in [0, 1] u  Infinite # of actions

u  Payoffs: same as action, unless both players choose 1, in which case both get 0.

u  No mixed NE (therefore no pure NE)

u  Many infinite games do have NE!

Page 18: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

18  

More LP duality example

Vertex cover problem

Vertex cover problem

u  Given a graph, select the minimum number of nodes such that at least one endpoint of every edge is selected.

u  Answer?

4

5 6

7

8 9

2

3

1 0

Page 19: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

19  

Optimization

u  xt is 1 if node t is picked and 0 otherwise

u  Is the following a usual linear program?

Minimize Σt xt

Subject to

xu + xv >= 1, for each edge (u, v)

xt ε {0, 1}, for each node t

Integer linear program (ILP) In general "NP-hard" to solve

LP relaxation

Minimize Σt xt

Subject to

xu + xv >= 1, for each edge (u, v)

xt >= 0, for each node t

Approximation algorithm: Rounding the LP solution gives a

2-approximation

Page 20: CSCI 3210: Computational Game Theory Linear Programming

2/16/17  

20  

Dual of LP relaxation

u  Primal

Minimize Σt xt

Subject to

xu + xv >= 1, for each edge (u, v)

xt >= 0, for each node t

u  Dual

Maximize Σe ye

Subject to

Σall edges e incident on t ye <= 1, for each node t

ye >= 0, for each edge e

c and b are vectors of 1s.

Maximum matching problem (relaxed)

Maximum matching problem

u  Select the maximum number of edges so that the selected edges do not share any vertex.

u  What's your solution?

4

5 6

7

8 9

2

3

1 0