CSC304 Lecture 4

Game Theory (Cost sharing & congestion games, Potential function, Braess’ paradox)

CSC304 - Nisarg Shah 1 Recap

• Nash equilibria (NE) ➢ No agent wants to change their ➢ Guaranteed to exist if mixed strategies are allowed ➢ Could be multiple

• Pure NE through best-response diagrams • Mixed NE through the indifference principle

CSC304 - Nisarg Shah 2 Worst and Best Nash Equilibria

• What can we say after we identify all Nash equilibria? ➢ Compute how “good” they are in the best/worst case

• How do we measure “social good”?

➢ Game with only rewards? Higher total reward of players = more social good

➢ Game with only penalties? Lower total penalty to players = more social good

➢ Game with rewards and penalties? No clear consensus…

CSC304 - Nisarg Shah 3 of Anarchy and Stability

(PoA) • Price of Stability (PoS)

“Worst NE vs optimum” “Best NE vs optimum”

Max total reward Max total reward Min total reward in any NE Max total reward in any NE

or or Max total cost in any NE Min total cost in any NE Min total cost Min total cost

PoA ≥ PoS ≥ 1

CSC304 - Nisarg Shah 4 Revisiting Stag-Hunt

Hunter 2 Stag Hare Hunter 1 Stag (4 , 4) (0 , 2) Hare (2 , 0) (1 , 1) • Max total reward = 4 + 4 = 8 • Three equilibria ➢ (Stag, Stag) : Total reward = 8 ➢ (Hare, Hare) : Total reward = 2 1 2 1 2 ➢ ( Τ3 Stag – Τ3 Hare, Τ3 Stag – Τ3 Hare) 1 1 1 1 o Total reward = ∗ ∗ 8 + 1 − ∗ ∗ 2 ∈ (2,8) 3 3 3 3 • Price of stability? Price of anarchy?

CSC304 - Nisarg Shah 5 Revisiting Prisoner’s Dilemma

John Stay Silent Betray Sam Stay Silent (-1 , -1) (-3 , 0) Betray (0 , -3) (-2 , -2)

• Min total cost = 1 + 1 = 2 • Only equilibrium: ➢ (Betray, Betray) : Total cost = 2 + 2 = 4

• Price of stability? Price of anarchy?

CSC304 - Nisarg Shah 6 Cost Sharing Game

• 푛 players on directed weighted graph 퐺

• Player 푖 푠1 푠2 ➢ Wants to go from 푠푖 to 푡푖 1 1 ➢ Strategy set 푆푖 = {directed 푠푖 → 푡푖 paths} ➢ Denote his chosen path by 푃푖 ∈ 푆푖 10 10 10 • Each edge 푒 has cost 푐푒 (weight) ➢ Cost is split among all players taking edge 푒 1 1 ➢ That is, among all players 푖 with 푒 ∈ 푃푖 푡1 푡2

CSC304 - Nisarg Shah 7 Cost Sharing Game

• Given strategy profile 푃, cost 푐푖 푃 to player 푖 is sum of his costs for edges 푒 ∈ 푃푖

퐶 푃 = σ 푐 푃 푠1 푠2 푖 푖 1 1

10 10 • Note: 퐶 푃 = σ푒∈퐸 푃 푐푒, where… 10

➢ 퐸(푃)={edges taken in 푃 by at least one player}

➢ Why? 1 1 푡1 푡2

CSC304 - Nisarg Shah 8 Cost Sharing Game

• In the example on the right: ➢ What if both players take direct paths? ➢ What if both take middle paths? ➢ What if one player takes direct path and the 푠1 푠2 other takes middle path? 1 1

• Pure Nash equilibria? 10 10 10

1 1 푡1 푡2

CSC304 - Nisarg Shah 9 Cost Sharing: Simple Example

• Example on the right: 푛 players s • Two pure NE ➢ All taking the n-edge: social cost = 푛 ➢ All taking the 1-edge: social cost = 1 푛 1 o Also the social optimum

• Price of stability: 1 • Price of anarchy: 푛 t ➢ We can show that price of anarchy ≤ 푛 in every cost-sharing game!

CSC304 - Nisarg Shah 10 Cost Sharing: PoA

• Theorem: The price of anarchy of a cost sharing game is at most 푛. • Proof: ∗ ∗ ∗ ➢ Suppose the social optimum is (푃1 , 푃2 , … , 푃푛 ), in which ∗ the cost to player 푖 is 푐푖 . ➢ Take any NE with cost 푐푖 to player 푖. ′ ∗ ➢ Let 푐푖 be his cost if he switches to 푃푖 . ′ ➢ NE ⇒ 푐푖 ≥ 푐푖 (Why?) ′ ∗ ➢ But : 푐푖 ≤ 푛 ⋅ 푐푖 (Why?) ∗ ➢ 푐 ≤ 푛 ⋅ 푐 for each 푖 ⇒ no worse than 푛 × optimum 푖 푖 ∎

CSC304 - Nisarg Shah 11 Cost Sharing

• Price of anarchy ➢ Every cost-sharing game: PoA ≤ 푛 ➢ Example game with PoA = 푛 ➢ Bound of 푛 is tight.

• Price of stability? ➢ In the previous game, it was 1. ➢ In general, it can be higher. How high? ➢ We’ll answer this after a short detour.

CSC304 - Nisarg Shah 12 Cost Sharing

• Nash’s theorem shows existence of a mixed NE. 10 B ➢ Pure NE may not always exist in 20 A 12 general. 7 C 60 32 • But in both cost-sharing games we E saw, there was a PNE. D ➢ What about a more complex 10 players: 퐸 → 퐶 game like the one on the right? 27 players: 퐵 → 퐷 19 players: 퐶 → 퐷

CSC304 - Nisarg Shah 13 Good News

• Theorem: Every cost-sharing game have a pure .

• Proof: ➢ Via “potential function” argument

CSC304 - Nisarg Shah 14 Step 1: Define Potential Fn

• Potential function: Φ ∶ ς푖 푆푖 → ℝ+ ➢ This is a function such that for every pure strategy profile ′ 푃 = 푃1, … , 푃푛 , player 푖, and strategy 푃푖 of 푖,

′ ′ 푐푖 푃푖 , 푃−푖 − 푐푖 푃 = Φ 푃푖 , 푃−푖 − Φ 푃

➢ When a single player 푖 changes her strategy, the change in potential function equals the change in cost to 푖!

➢ In contrast, the change in the social cost 퐶 equals the total change in cost to all players. o Hence, the social cost will often not be a valid potential function.

CSC304 - Nisarg Shah 15 Step 2: Potential Fn → pure Nash Eq

• A potential function exists ⇒ a pure NE exists. ➢ Consider a 푃 that minimizes the potential function. ➢ Deviation by any single player 푖 can only (weakly) increase the potential function. ➢ But change in potential function = change in cost to 푖. ➢ Hence, there is no beneficial deviation for any player.

• Hence, every pure strategy profile minimizing the potential function is a pure Nash equilibrium.

CSC304 - Nisarg Shah 16 Step 3: Potential Fn for Cost-Sharing

• Recall: 퐸(푃) = {edges taken in 푃 by at least one player}

• Let 푛푒 (푃) be the number of players taking 푒 in 푃 푛 (푃) 푒 푐 Φ 푃 = ෍ ෍ 푒 푘 푒∈퐸(푃) 푘=1

• Note: The cost of edge 푒 to each player taking 푒 is

푐푒/푛푒(푃). But the potential function includes all

fractions: 푐푒/1, 푐푒/2, …, 푐푒/푛푒 푃 .

CSC304 - Nisarg Shah 17 Step 3: Potential Fn for Cost-Sharing

푛 (푃) 푒 푐 Φ 푃 = ෍ ෍ 푒 푘 푒∈퐸(푃) 푘=1

• Why is this a potential function? 푐푒 ➢ If a player changes path, he pays for each new 푛푒 푃 +1 푐 edge 푒, gets back 푓 for each old edge 푓. 푛푓 푃 ➢ This is precisely the change in the potential function too. ➢ So Δ푐푖 = ΔΦ. ∎

CSC304 - Nisarg Shah 18 Potential Minimizing Eq.

• Minimizing the potential function gives some pure Nash equilibrium ➢ Is this equilibrium special? Yes!

• Recall that the price of anarchy can be up to 푛. ➢ That is, the worst Nash equilibrium can be up to 푛 times worse than the social optimum.

• A potential-minimizing pure Nash equilibrium is better!

CSC304 - Nisarg Shah 19 Potential Minimizing Eq.

푛푒(푃) 푛 푐 1 ෍ 푐 ≤ Φ 푃 = ෍ ෍ 푒 ≤ ෍ 푐 ∗ ෍ 푒 푘 푒 푘 푒∈퐸(푃) 푒∈퐸(푃) 푘=1 푒∈퐸(푃) 푘=1

Social cost

Harmonic function 퐻(푛) ∀푃, 퐶 푃 ≤ Φ 푃 ≤ 퐶 푃 ∗ 퐻 푛 푛 = σ푘=1 1/푛 = 푂(log 푛)

퐶 푃∗ ≤ Φ 푃∗ ≤ Φ 푂푃푇 ≤ 퐶 푂푃푇 ∗ 퐻(푛)

Potential minimizing eq. Social optimum

CSC304 - Nisarg Shah 20 Potential Minimizing Eq.

• Potential-minimizing PNE is 푂(log 푛)-approximation to the social optimum.

• Thus, in every cost-sharing game, the price of stability is 푂 log 푛 .

➢ Compare to the price of anarchy, which can be 푛

CSC304 - Nisarg Shah 21 Congestion Games

• Generalize cost sharing games

• 푛 players, 푚 resources (e.g., edges)

• Each player 푖 chooses a set of resources 푃푖 (e.g., 푠푖 → 푡푖 paths)

• When 푛푗 player use resource 푗, each of them get a cost

푓푗(푛푗) • Cost to player is the sum of costs of resources used

CSC304 - Nisarg Shah 22 Congestion Games

• Theorem [Rosenthal 1973]: Every is a .

• Potential function: 푛푗 푃

Φ 푃 = ෍ ෍ 푓푗 푘 푗∈퐸(푃) 푘=1

• Theorem [Monderer and Shapley 1996]: Every potential game is equivalent to a congestion game.

CSC304 - Nisarg Shah 23 Potential Functions

• Potential functions are useful for deriving various results ➢ E.g., used for analyzing amortized complexity of algorithms

• Bad news: Finding a potential function that works may be hard.

CSC304 - Nisarg Shah 24 The Braess’ Paradox

• In cost sharing, 푓푗 is decreasing ➢ The more people use a resource, the less the cost to each.

• 푓푗 can also be increasing ➢ Road network, each player going from home to work ➢ Uses a sequence of roads ➢ The more people on a road, the greater the congestion, the greater the delay (cost)

• Can lead to unintuitive phenomena

CSC304 - Nisarg Shah 25 The Braess’ Paradox

• Parkes-Seuken Example: ➢ 2000 players want to go from 1 to 4 ➢ 1 → 2 and 3 → 4 are “congestible” roads ➢ 1 → 3 and 2 → 4 are “constant delay” roads

2

1 4

3

CSC304 - Nisarg Shah 26 The Braess’ Paradox

• Pure Nash equilibrium? ➢ 1000 take 1 → 2 → 4, 1000 take 1 → 3 → 4 ➢ Each player has cost 10 + 25 = 35 ➢ Anyone switching to the other creates a greater congestion on it, and faces a higher cost

2

1 4

3

CSC304 - Nisarg Shah 27 The Braess’ Paradox

• What if we add a zero-cost connection 2 → 3? ➢ Intuitively, adding more roads should only be helpful ➢ In reality, it leads to a greater delay for everyone in the unique equilibrium!

2

1 푐23 푛23 = 0 4

3

CSC304 - Nisarg Shah 28 The Braess’ Paradox

• Nobody chooses 1 → 3 as 1 → 2 → 3 is better irrespective of how many other players take it • Similarly, nobody chooses 2 → 4 • Everyone takes 1 → 2 → 3 → 4, faces delay = 40!

2

1 푐23 푛23 = 0 4

3

CSC304 - Nisarg Shah 29 The Braess’ Paradox

• In fact, what we showed is: ➢ In the new game, 1 → 2 → 3 → 4 is a strictly dominant strategy for each player!

2

1 푐23 푛23 = 0 4

3

CSC304 - Nisarg Shah 30