Lecture 2: Linear Programming and Duality Lecture Outline Part I: - - PowerPoint PPT Presentation

β–Ά
lecture 2 linear programming and duality lecture outline
SMART_READER_LITE
LIVE PREVIEW

Lecture 2: Linear Programming and Duality Lecture Outline Part I: - - PowerPoint PPT Presentation

Lecture 2: Linear Programming and Duality Lecture Outline Part I: Linear Programming and Examples Part II: Von Neumanns Minimax Theorem and Linear Programming Duality Part III: Linear Programming as a Problem Relaxation Part I:


slide-1
SLIDE 1

Lecture 2: Linear Programming and Duality

slide-2
SLIDE 2

Lecture Outline

  • Part I: Linear Programming and Examples
  • Part II: Von Neumann’s Minimax Theorem and

Linear Programming Duality

  • Part III: Linear Programming as a Problem

Relaxation

slide-3
SLIDE 3

Part I: Linear Programming, Examples, and Canonical Form

slide-4
SLIDE 4

Linear Programming

  • Linear Programming: Want to optimize a linear

function over linear equalities and inequalities.

  • Example: Maximize f x, y, z = 3𝑦 + 4𝑧 + 5𝑨

when

1. 𝑦 + 𝑧 + 𝑨 = 1 2. 𝑦 β‰₯ 0 3. 𝑧 β‰₯ 0 4. 𝑨 β‰₯ 0

  • Answer: 𝑦 = 𝑧 = 0, 𝑨 = 1, 𝑔 𝑦, 𝑧, 𝑨 = 5
slide-5
SLIDE 5

Example: Directed Connectivity

  • Directed connectivity: Is there a path from 𝑑 =

𝑦1 to 𝑒 = π‘¦π‘œ in a directed graph 𝐻?

  • Linear program: Minimize π‘¦π‘œ subject to

1. 𝑦1 = 1 2. π‘¦π‘˜ β‰₯ 𝑦𝑗 whenever x𝑗 β†’ π‘¦π‘˜ ∈ 𝐹(𝐻) 3. βˆ€π‘—, 𝑦𝑗 β‰₯ 0

  • Answer is 1 if there is a path from 𝑑 to 𝑒 in 𝐻

and 0 otherwise.

slide-6
SLIDE 6

Example: Maximum Flow

  • Max flow: Given edge capacities π‘‘π‘—π‘˜ for each

edge 𝑦𝑗 β†’ π‘¦π‘˜ in 𝐻, what is the maximum flow from 𝑑 = 𝑦1 to 𝑒 = π‘¦π‘œ?

  • Example:

6 s t 2 6 1 2 2 3 6 2 6 6 4 4 4 3 3 4 4 1 4

slide-7
SLIDE 7

Example Answer: 15

  • Answer: 15. Actual flow is red/purple, capacity

is blue/purple.

6 s t 2 6 1 2 2 3 4 2 5 2 1 3 4 3 2 3 5 6 6 1 4 4 6 3 4 4 4

slide-8
SLIDE 8

Max Flow Equations

  • Take π‘¦π‘—π‘˜ = flow from 𝑗 to π‘˜
  • Recall: π‘‘π‘—π‘˜ is the capacity from 𝑗 to π‘˜
  • Program: Maximize π‘¦π‘œ1 subject to

1. βˆ€π‘—, π‘˜, 0 ≀ π‘¦π‘—π‘˜ ≀ π‘‘π‘—π‘˜ (no capacity is exceeded, no negative flow) 2. βˆ€π‘—, Οƒπ‘˜=1

π‘œ

π‘¦π‘˜π‘— = Οƒπ‘˜=1

π‘œ

π‘¦π‘—π‘˜ (flow in = flow out)

slide-9
SLIDE 9

In-class Exercise

  • Shortest path problem: Given a directed graph

𝐻 with lengths π‘šπ‘—π‘˜ on the edges, what is the shortest path from 𝑑 = 𝑦1 to 𝑒 = π‘¦π‘œ in 𝐻?

  • Exercise: Express the shortest path problem as

a linear program.

slide-10
SLIDE 10

In-class Exercise Answer

  • Shortest path problem: How long is the shortest

path from 𝑑 = 𝑦1 to 𝑒 = π‘¦π‘œ in a directed graph 𝐻?

  • Linear Program: Have variables 𝑒𝑗 representing

the distance of vertex 𝑦𝑗 from vertex 𝑑 = 𝑦1. Maximize π‘’π‘œ subject to

1. 𝑒1 = 0 2. βˆ€π‘—, π‘˜, π‘’π‘˜ ≀ 𝑒𝑗 + π‘šπ‘—π‘˜ where π‘šπ‘—π‘˜ is the length of the edge from 𝑦𝑗 to π‘¦π‘˜

slide-11
SLIDE 11

Canonical Form

  • Canonical form: Maximize cT𝑦 subject to

1. 𝐡𝑦 ≀ 𝑐 2. 𝑦 β‰₯ 0

slide-12
SLIDE 12

Putting Things Into Canonical Form

  • Canonical form: Maximize cT𝑦 subject to

1. 𝐡𝑦 ≀ 𝑐 2. 𝑦 β‰₯ 0

  • To put a linear program into canonical form:
  • 1. Replace each equality 𝑏𝑗

π‘ˆπ‘¦ = 𝑐𝑗 with two

inequalities 𝑏𝑗

π‘ˆπ‘¦ ≀ 𝑐𝑗 and βˆ’π‘π‘— π‘ˆπ‘¦ ≀ βˆ’π‘π‘—

  • 2. In each expression, replace π‘¦π‘˜ with (π‘¦π‘˜

+βˆ’π‘¦π‘˜ βˆ’)

where π‘¦π‘˜

+, π‘¦π‘˜ βˆ’ are two new variables.

slide-13
SLIDE 13

Slack Form

  • Slack form: Maximize cT𝑦 subject to

1. 𝐡𝑦 = 𝑐 2. 𝑦 β‰₯ 0

slide-14
SLIDE 14

Putting Things Into Slack Form

  • Slack form: Maximize cT𝑦 subject to

1. 𝐡𝑦 = 𝑐 2. 𝑦 β‰₯ 0

  • To put a linear program into slack form from

canonical form, simply add a slack variable for each inequality. Οƒπ‘˜=1

π‘œ

π‘π‘—π‘˜π‘¦π‘˜ ≀ 𝑐𝑗 ⬄ (Οƒπ‘˜=1

π‘œ

π‘π‘—π‘˜π‘¦π‘˜) + 𝑑𝑗 = 𝑐𝑗, 𝑑𝑗 β‰₯ 0

slide-15
SLIDE 15

Part II: Von Neumann’s Minimax Theorem and Linear Programming Duality

slide-16
SLIDE 16

Linear Programming Duality

  • Primal: Maximize cT𝑦 subject to

1. 𝐡𝑦 ≀ 𝑐 2. 𝑦 β‰₯ 0

  • Dual: Minimize π‘π‘ˆπ‘§ subject to

1. π΅π‘ˆπ‘§ β‰₯ 𝑑 2. 𝑧 β‰₯ 0

  • Observation: For any feasible 𝑦, 𝑧, π‘‘π‘ˆπ‘¦ ≀ π‘π‘ˆπ‘§

because π‘‘π‘ˆπ‘¦ ≀ π‘§π‘ˆπ΅π‘¦ = π‘§π‘ˆ 𝐡𝑦 βˆ’ 𝑐 + π‘§π‘ˆπ‘ ≀ π‘π‘ˆπ‘§

  • Strong duality: π‘‘π‘ˆπ‘¦ = π‘π‘ˆπ‘§ at optimal 𝑦, 𝑧
slide-17
SLIDE 17

Heart of Duality

  • Game: Have a function 𝑔: π‘Œ Γ— 𝑍 β†’ 𝑆.
  • π‘Œ player wants to minimize 𝑔(𝑦, 𝑧), 𝑍 player

wants to maximize 𝑔(𝑦, 𝑧)

  • Obvious: Better to go second, i.e

max

π‘§βˆˆπ‘ min π‘¦βˆˆπ‘Œ 𝑔(𝑦, 𝑧) ≀ min π‘¦βˆˆπ‘Œ max π‘§βˆˆπ‘ 𝑔(𝑦, 𝑧)

  • Minimax theorems: Under certain conditions,

max

π‘§βˆˆπ‘ min π‘¦βˆˆπ‘Œ 𝑔(𝑦, 𝑧) = min π‘¦βˆˆπ‘Œ max π‘§βˆˆπ‘ 𝑔(𝑦, 𝑧) !

slide-18
SLIDE 18

Von Neumann’s Minimax Theorem

  • Von Neumann [1928]: If π‘Œ and 𝑍 are convex

compact subsets of 𝑆𝑛 and π‘†π‘œ and 𝑔: π‘Œ Γ— 𝑍 β†’ 𝑆 is a continuous function which is convex in π‘Œ and concave in 𝑍 then max

π‘§βˆˆπ‘ min π‘¦βˆˆπ‘Œ 𝑔(𝑦, 𝑧) = min π‘¦βˆˆπ‘Œ max π‘§βˆˆπ‘ 𝑔(𝑦, 𝑧)

  • These conditions are necessary (see problem

set)

slide-19
SLIDE 19

Example

  • Let π‘Œ = 𝑍 = [βˆ’1,1] and consider the function

𝑔 𝑦, 𝑧 = 𝑦𝑧.

  • If the 𝑦 player goes first and plays 𝑦 = .5, the 𝑧

player should play 𝑧 = 1, obtaining 𝑔 𝑦, 𝑧 = .5

  • If the 𝑦 player goes first and plays 𝑦 = βˆ’.5, the

𝑧 player should play 𝑧 = βˆ’1, obtaining 𝑔 𝑦, 𝑧 = .5

  • The best play for the 𝑦 player is 𝑦 = 0 as then

𝑔 𝑦, 𝑧 = 0 regardless of what 𝑧 is.

slide-20
SLIDE 20

Connection to Nash Equilibria

  • Recall: π‘Œ player wants to minimize 𝑔(𝑦, 𝑧), 𝑍

player wants to maximize 𝑔(𝑦, 𝑧).

  • If (π‘¦βˆ—, π‘§βˆ—) is a Nash equilibrium then

𝑔 π‘¦βˆ—, π‘§βˆ— ≀ max

π‘§βˆˆπ‘ min π‘¦βˆˆπ‘Œ 𝑔 𝑦, 𝑧

≀ min

π‘¦βˆˆπ‘Œ max π‘§βˆˆπ‘ 𝑔 𝑦, 𝑧 ≀ 𝑔(π‘¦βˆ—, π‘§βˆ—)

  • Note: Since 𝑔 is convex in 𝑦 and concave in 𝑧,

pure strategies are always optimal.

  • However, this is circular: proof that Nash

equilibria exist β‰ˆ proof of minimax theorem

slide-21
SLIDE 21

Minimax Theorem Proof Sketch

  • Proof idea:
  • 1. Define a function π‘ˆ: π‘Œ Γ— 𝑍 β†’ π‘Œ Γ— 𝑍 so that

π‘ˆ 𝑦, 𝑧 = (𝑦, 𝑧) if and only if (𝑦, 𝑧) is a Nash equilibrium.

  • 2. Use Brouwer’s fixed point theorem to argue that T

must have a fixed point.

slide-22
SLIDE 22

Attempt #1

  • We could try to define π‘ˆ as follows
  • 1. Starting from (𝑦, 𝑧), take 𝑦′ to be the closest point

to 𝑦 which minimizes 𝑔(𝑦′, 𝑧).

  • 2. Now take 𝑧′ to be the closest point to 𝑧 which

maximizes 𝑔(𝑦′, 𝑧′)

  • 3. Take π‘ˆ 𝑦, 𝑧 = (𝑦′, 𝑧′)
  • π‘ˆ 𝑦, 𝑧 = 𝑦, 𝑧 ⬄(𝑦, 𝑧) is a Nash equilibrium.
slide-23
SLIDE 23

Brouwer’s Fixed Point Theorem

  • Brouwer’s fixed point theorem: If π‘Œ is a convex,

compact subset of π‘†π‘œ then any continuous map 𝑔: π‘Œ β†’ π‘Œ has a fixed point

  • Example: Any continuous function 𝑔: 𝐸2 β†’ 𝐸2

has a fixed point.

slide-24
SLIDE 24

Correct function T

  • Problem: Previous π‘ˆ may not be continuous!
  • Correct π‘ˆ: Starting from 𝑦, 𝑧 :
  • 1. Define Ξ” 𝑦2 = 𝑔 𝑦, 𝑧 βˆ’ 𝑔 𝑦2, 𝑧 if 𝑔 𝑦2, 𝑧 <

𝑔(𝑦, 𝑧) and Ξ” 𝑦2 = 0 otherwise.

  • 2. Take 𝑦′ =

𝑦+Χ¬

𝑦2βˆˆπ‘Œ Ξ” 𝑦2 𝑦2

1+Χ¬

𝑦2βˆˆπ‘Œ Ξ” 𝑦2

  • 3. Define Ξ” 𝑧2 = 𝑔 𝑦′, 𝑧2 βˆ’ 𝑔 𝑦′, 𝑧 if 𝑔 𝑦, 𝑧2 >

𝑔(𝑦, 𝑧) and Ξ” 𝑧2 = 0 otherwise.

  • 4. Take 𝑧′ =

𝑧+Χ¬

𝑧2βˆˆπ‘ Ξ” 𝑧2 𝑧2

1+Χ¬

𝑧2βˆˆπ‘ Ξ” 𝑧2

and π‘ˆ 𝑦, 𝑧 = (𝑦′, 𝑧′)

slide-25
SLIDE 25

Duality Via Minimax Theorem

  • Idea: Instead of trying to enforce some of the

constraints, make the program into a two player game where the new player can punish any violated constraints.

  • Example: Maximize cT𝑦 subject to

1. 𝐡𝑦 ≀ 𝑐 2. 𝑦 β‰₯ 0

  • Game: Take 𝑔 𝑦, 𝑧 = π‘‘π‘ˆπ‘¦ + π‘§π‘ˆ 𝑐 βˆ’ 𝐡𝑦 where

we have the constraint that 𝑧 β‰₯ 0 (here 𝑧 wants to minimize 𝑔(𝑦, 𝑧)).

  • If 𝐡𝑦 𝑗 > 𝑐𝑗, 𝑧 can take 𝑧𝑗 β†’ ∞ to punish this.
slide-26
SLIDE 26

Strong Duality Intuition

  • Canonical primal form: Maximize cT𝑦 subject to

1. 𝐡𝑦 ≀ 𝑐 2. 𝑦 β‰₯ 0

  • = max

𝑦β‰₯0 min 𝑧β‰₯0 π‘‘π‘ˆπ‘¦ + π‘§π‘ˆ 𝑐 βˆ’ 𝐡𝑦

  • = min

𝑧β‰₯0 max 𝑦β‰₯0 π‘§π‘ˆπ‘ + (π‘‘π‘ˆ βˆ’ π‘§π‘ˆπ΅)𝑦

  • Canonical dual form: Minimize π‘π‘ˆπ‘§ subject to

1. π΅π‘ˆπ‘§ β‰₯ π‘‘π‘ˆ 2. 𝑧 β‰₯ 0

  • Not quite a proof, domains of 𝑦, 𝑧 aren’t compact!
slide-27
SLIDE 27

Slack Form Duality Intuition

  • Slack primal form: Maximize cT𝑦 subject to

1. 𝐡𝑦 = 𝑐 2. 𝑦 β‰₯ 0

  • = max

𝑦β‰₯0 min 𝑧 π‘‘π‘ˆπ‘¦ + π‘§π‘ˆ 𝑐 βˆ’ 𝐡𝑦

  • = min

𝑧 max 𝑦β‰₯0 π‘§π‘ˆπ‘ + (π‘‘π‘ˆ βˆ’ π‘§π‘ˆπ΅)𝑦

  • Slack dual form: Minimize π‘π‘ˆπ‘§ subject to

1. π΅π‘ˆπ‘§ β‰₯ π‘‘π‘ˆ

  • See problem set for a true proof of strong duality.
slide-28
SLIDE 28

Max-flow/Min-cut Theorem

  • Classical duality example: max-flow/min-cut
  • Max-flow/min-cut theorem: The maximum flow

from 𝑑 to 𝑒 is equal to the minimum capacity across a cut separating 𝑑 and 𝑒.

  • Duality is a bit subtle (see problem set)
slide-29
SLIDE 29

Max-flow/Min-cut Example

  • Maximum flow was 15, this is matched by the

minimal cut shown below:

6 s t 2 6 1 2 2 3 6 2 6 6 4 4 4 3 3 4 4 1 4

slide-30
SLIDE 30

Part III: Linear Programming as a Problem Relaxation

slide-31
SLIDE 31

Convex Relaxations

  • Often we want to optimize over a nonconvex

set, which is very difficult.

  • To obtain an approximation, we can take a

convex relaxation of our set.

  • Linear programming can give such convex

relaxations.

slide-32
SLIDE 32

Bad Example: 3-SAT solving

  • Actual problem: Want each 𝑦𝑗 ∈ {0,1}.
  • A clause 𝑦𝑗 ∨ π‘¦π‘˜ βˆ¨π‘™ can be re-expressed as

𝑦𝑗 + π‘¦π‘˜ + 𝑦𝑙 β‰₯ 1

  • Negations can be handled with the equality

¬𝑦𝑗 = 1 βˆ’ 𝑦𝑗

  • Convex relaxation: Only require 0 ≀ 𝑦𝑗 ≀ 1
  • Too relaxed: Could just take all 𝑦𝑗 =

1 2!

  • Note: strengthening this gives cutting planes
slide-33
SLIDE 33

Example: Maximum Matching

  • Have a variable π‘¦π‘—π‘˜ for each edge 𝑗, π‘˜ ∈ 𝐹(𝐻)
  • Actual problem: Maximize σ𝑗,π‘˜: 𝑗,π‘˜ ∈𝐹(𝐻) π‘¦π‘—π‘˜

subject to

1. βˆ€π‘— < π‘˜: 𝑗, π‘˜ ∈ 𝐹 𝐻 , π‘¦π‘—π‘˜ ∈ {0,1} 2. βˆ€π‘—, Οƒπ‘˜<𝑗: π‘˜,𝑗 ∈𝐹 𝐻 π‘¦π‘˜π‘— + Οƒπ‘˜>𝑗: 𝑗,π‘˜ ∈𝐹 𝐻 π‘¦π‘—π‘˜ ≀ 1

  • Convex relaxation: Only require 0 ≀ π‘¦π‘—π‘˜ ≀ 1
  • Gives exact value for bipartite graphs, not in

general (see problem set)