CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the...

33
CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey

Transcript of CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the...

Page 1: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

CPSC 536NSparse Approximations

Winter 2013Lecture 1

N. Harvey

Page 2: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Linear Program• General definition– Parameters: c, a1,…,am2Rn, b1,…,bm2R

– Variables: x2Rn

• Terminology– Feasible point: any x satisfying constraints– Optimal point: any feasible x that minimizes obj. func– Optimal value: value of obj. func for any optimal point

Objective functionConstraints

Page 3: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

• Matrix form

• Parameters: c2Rn, A2Rm£n, b2Rm

• Variables: x2Rn

Linear Program• General definition– Parameters: c, a1,…,am2Rn, b1,…,bm2R

– Variables: x2Rn

Page 4: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Simple LP Manipulations• “max” instead of “min”

max cT x ´ min –cT x

• “¸” instead of “·”aTx ¸ b , -aTx · -b

• “=” instead of “·”aTx=b , aTx · b and aTx ¸ b

• Note: “<“ and “>” are not allowed in constraintsBecause we want the feasible region to be closed, in the topological sense.

Page 5: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x1

x2 x2 - x1 · 1

x1 + 6x2 · 15

4x1 - x2 · 10

Gradient ofObjective Function

(0,0)

Feasible region

Constraint

Optimalpoint

2D Example

x1¸0

x2¸0

Unique optimal solution exists

(3,2)

Objective Function

Page 6: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x1

x2 x2 - x1 · 1

x1 + 6x2 · 15

4x1 - x2 · 10

(0,0)

Feasible region

Constraint

Optimalpoints

2D Example

x1¸0

x2¸0

Optimal solutions exist:Infinitely many!

Gradient ofObjective Function

Objective Function

Page 7: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x1

x2 x2 - x1 ¸ 1

x1 + 6x2 · 15

4x1 - x2 ¸ 10

(0,0)

Feasible regionis empty

Constraint

2D Example

x1¸0

x2¸0

InfeasibleNo feasible solutions

(so certainly no optimal solutions either)

Gradient ofObjective Function

Page 8: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x1

x2 x2 - x1 · 1

(0,0)

Feasible region

Constraint

2D Example

x1¸0

x2¸0

UnboundedFeasible solutions, but no optimal solution

(Informally, “optimal value = 1”)

Gradient ofObjective Function

Page 9: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x1

x2 x2 - x1 · 1

Gradient ofObjective Function

(0,0)Feasible region

Constraint

2D Example

x1¸0

x2¸0

Important Point: This LP is NOT unbounded.The feasible region is unbounded,

but optimal value is 1

Optimal point (0,1)

Page 10: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

“Fundamental Theorem” of LP

• Theorem: For any LP, the outcome is either:– Optimal solution (unique or infinitely many)– Infeasible– Unbounded

(optimal value is 1 for maximization problem,or -1 for minimization problem)

• The main point is: if the LP is feasible and not unbounded, then the supremum is achieved.

Page 11: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Example: Bipartite Matching• Given bipartite graph G=(V, E)• Find a maximum size matching

– A set M µ E s.t. every vertex has at most one incident edge in M

Page 12: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

• Given bipartite graph G=(V, E)• Find a maximum size matching

– A set M µ E s.t. every vertex has at most one incident edge in M

The blue edges are a matching M

Example: Bipartite Matching

Page 13: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

• The natural integer program

• Given bipartite graph G=(V, E)• Find a maximum size matching

– A set M µ E s.t. every vertex has at most one incident edge in M

Example: Bipartite Matching

• Solving IPs is very hard. Try an LP instead.

(LP)

• Theorem: (IP) and (LP) have the same solution!• Proof: Later in the course!• Corollary: Bipartite matching can be solved by LP algorithms.

(IP)

Page 14: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Proving optimality

x1

x2

-x1+x2 · 1

x1 + 6x2 · 15

4x1 - x2 · 10

• Question: What is optimal point in direction c = (-7,14)?• Solution: Optimal point is x=(9/7,16/7), optimal value is 23.• How can I be sure?

– Every feasible point satisfies x1+6x2 · 15

– Every feasible point satisfies -x1+x2 · 1

– Every feasible point satisfies their sum: -7x1+14x2 · 23

(9/7,16/7)This is the objective function!

) -8x1+8x2 · 8

Page 15: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Proving optimality• Question: What is optimal point in direction c = (-7,14)?• Solution: Optimal point is x=(9/7,16/7), optimal value is 23.• How can I be sure?

– Every feasible point satisfies x1+6x2 · 15

– Every feasible point satisfies -x1+x2 · 1 ) -8x1+8x2 · 8

– Every feasible point satisfies their sum: -7x1+14x2 · 23

• Certificates• To convince you that optimal value is ¸ k, I can find x such

that cT x ¸ k.• To convince you that optimal value is · k, I can find a linear

combination of the constraints which proves that cT x · k.

• “Strong Duality Theorem”: Such certificates always exists.

This is the objective function!

Page 16: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View• Suppose c=[-1,1]• Then every feasible x satisfies cTx = -x1+x2 · 1• If this constraint is tight at x ) x is optimal

x1

x2-x1+x2· 1

x1 + 6x2 · 15

Objective Function c

i.e. -x1+x2=1i.e. x lies on the red line

(because equality holds here)

Page 17: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View

x1

x2-x1+x2· 1

x1 + 6x2 · 15

Objective Function c

• Suppose c=[1,6]• Then every feasible x satisfies cTx = x1+6x2 · 15• If this constraint is tight at x ) x is optimal(because equality holds here)i.e. x1+6x2=15

i.e. x lies on the red line

Page 18: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View

x1

x2-x1+x2· 1

x1 + 6x2 · 15

Objective Function c

(because equality holds here)

• Suppose c=®¢[1,6], where ®¸0• Then every feasible x satisfies cTx = ®¢(x1+6x2)·15®

• If this constraint is tight at x ) x is optimali.e. x1+6x2=15i.e. x lies on the red line

Page 19: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View• What if c does not align with any constraint?• Can we “generate” a new constraint aligned with

c?

x1

x2-x1+x2· 1

x1 + 6x2 · 15

Objective Function c

Page 20: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View• Can we “generate” a new constraint aligned with c?• One way is to “average” the tight constraints• Example: Suppose c = u+v.• Then every feasible x satisfies

cTx = (u+v)Tx = (-x1+x2) + (x1+6x2) · 1 + 15 = 16• x is feasible and both constraints tight ) x is optimal

x1

x2

-x1+x2· 1

x1+6x2·15

Objective Function c

u=[-1,1]

v=[1,6]

Page 21: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Geometric View• Can we “generate” a new constraint aligned with c?• One way is to “average” the tight constraints• More generally: Suppose c = ®u+¯v for ®,¯¸0• Then every feasible x satisfies

cTx = (®u+¯v)Tx = ®(-x1+x2) + ¯(x1+6x2) · ®+15¯• x is feasible and both constraints tight ) x is optimal

x1

x2

-x1+x2· 1

x1+6x2·15

Objective Function c

u=[-1,1]

v=[1,6]

Page 22: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

x feasible ) a1T x · b1 and a2

T x · b2

) (a1+a2)T x · b1+b2 (new valid constraint)

More generally, for any ¸1,…,¸m¸0

x feasible ) (§i ¸

ia

i)T x · §

i ¸

ibi (new valid constraint)

“Any non-negative linear combination of the constraints gives a new valid constraint”

Definition: A new constraint aTx·b is valid if it is satisfied by all feasible points

To get upper bound on objective function cTx, need (§i ¸iai) = c(because then our new valid constraint shows cT x · §i ¸ibi)

Want best upper bound ) want to minimize §i ¸ibi

Duality: Algebraic View

Page 23: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Algebraic View

To get upper bound on objective function cTx, need (§i ¸

ia

i) = c

Want best upper bound ) want to minimize §i ¸

ibi

We can write this as an LP too!

Primal LP

´

Theorem: “Weak Duality Theorem”If x feasible for Primal and ¸ feasible for Dual then cTx · bT¸.Proof: cT x = (AT ¸)T x = ¸T A x · ¸T b. ¥

Since ¸¸0 and Ax·b

Dual LP

Page 24: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Duality: Algebraic View

To get upper bound on objective function cTx, need (§i ¸

ia

i) = c

Want best upper bound ) want to minimize §i ¸

ibi

We can write this as an LP too!

Primal LP

´

Theorem: “Weak Duality Theorem”If x feasible for Primal and ¸ feasible for Dual then cTx · bT¸.

Corollary: If x feasible for Primal and ¸ feasible for Dual and cTx = bT¸ then x optimal for Primal and ¸ optimal for Dual.

Dual LP

Page 25: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

´

new variables(non-negative)

transpose transpose

transpose

Dual LP Inequality Form

Dual of Dual

´

Let x = v-u

Primal:

Conclusion: “Dual of Dual is Primal!”

Dual of Dual

´

A has size m x nc 2 Rn and b 2 Rm

u2Rn v2Rn w2Rm

Page 26: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Primal vs Dual

Weak Duality Theorem:If x feasible for Primal and ¸ feasible for Dual then cTx · bT¸.

Infeasible Unbounded Opt. Exists

Infeasible

Unbounded

Opt. Exists

Primal(maximization)

Dual(minimization) Impossible Impossible

Impossible

Fundamental Theorem of LP: For any LP, the outcome is either:Infeasible, Unbounded, Optimum Point Exists.

Possible

Possible

Strong Duality Theorem:If Primal has an opt. solution x, then Dual has an opt. solution ¸.Furthermore, optimal values are same: cTx = bT¸.

Impossible

Impossible

Possible

Possible

Exercise!

Page 27: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Strong DualityPrimal LP: Dual LP:

Strong Duality Theorem:Primal has an opt. solution x , Dual has an opt. solution y.Furthermore, optimal values are same: cTx = bTy.

• Weak Duality implies cTx·bTy. So strong duality says cTx¸bTy.

• Restatement of Theorem: Primal has an optimal solution, Dual has an optimal solution, the following system is solvable:

Punchline: Finding optimal primal & dual LP solutionsis equivalent to solving this system of inequalities.

• Can we characterize when systems of inequalities are solvable?

(for any feasible x,y) (for optimal x,y)

Page 28: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Systems of Equalities• Lemma: Exactly one of the following holds:– There exists x satisfying Ax=b– There exists y satisfying yTA=0 and yTb>0

• Geometrically…

x1

x2span(A1,…,An) = column space of A

x3

A1 A2

b

(b is in column space of A)

Page 29: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Systems of Equalities• Lemma: Exactly one of the following holds:– There exists x satisfying Ax=b (b is in column space of A)

– There exists y satisfying yTA=0 and yTb>0 (or it is not)

• Geometrically…

x2

column space of A

x3

A1

A2

b

x1

y

Hyperplane

Positive open halfspace

++

Ha,0

col-space(A)µHy,0 but b2Hy,0

Page 30: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Systems of Inequalities• Lemma: Exactly one of the following holds:–There exists x¸0 satisfying Ax=b –There exists y satisfying yTA¸0 and yTb<0

• Geometrically…Let cone(A1,…,An) = { §i xiAi : x¸0 } “cone generated by A1,…,An”

(Here Ai is the ith column of A)

x1

x2

x3

A1

A2

b

A3

cone(A1,…,An)

(b is in cone(A1,…,An))

Page 31: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Systems of Inequalities• Lemma: Exactly one of the following holds:–There exists x¸0 satisfying Ax=b (b is in cone(A1,

…,An))

–There exists y satisfying yTA¸0 and yTb<0

• Geometrically…

x1

x2

x3

A1

A2

b

A3

cone(A1,…,An)

Positive closed halfspace

Negative open halfspace

--+

Hy,0

cone(A1,,An)2Hy,0 but b2Hy,0

(y gives a separating hyperplane)

y

Page 32: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

• Lemma: Exactly one of the following holds:–There exists x¸0 satisfying Ax=b (b is in cone(A1,

…,An))

–There exists y satisfying yTA¸0 and yTb<0 (y gives a “separating hyperplane”)

• This is called “Farkas’ Lemma”– It has many interesting proofs.– It is “equivalent” to strong duality for LP.– There are several “equivalent” versions of it. Gyula Farkas

Systems of Inequalities

Page 33: CPSC 536N Sparse Approximations Winter 2013 Lecture 1 N. Harvey TexPoint fonts used in EMF. Read the TexPoint manual before you delete this box.: AAAAAAAAAA.

Gyula Farkas

Variants of Farkas’ Lemma

The System Ax · b Ax = b

has no solution x¸0 iff 9y¸0, ATy¸0, bTy<0 9y2Rn, ATy¸0, bTy<0

has no solution x2Rn iff 9y¸0, ATy=0, bTy<0 9y2Rn, ATy=0, bTy<0

This is the simple lemma on systems of equalities

These are all “equivalent”(each can be proved using another)