Скачать презентацию LP and Duality Lecture 8 Dr Zvi Lotker Скачать презентацию LP and Duality Lecture 8 Dr Zvi Lotker

496c51a017e7725ffcb5baa27b40464a.ppt

  • Количество слайдов: 73

LP and Duality Lecture 8 Dr. Zvi Lotker LP and Duality Lecture 8 Dr. Zvi Lotker

In the last lecture n n linear optimization quadratic optimization In the last lecture n n linear optimization quadratic optimization

Examples n n diet problem: choose quantities x 1, …, xn of n foods. Examples n n diet problem: choose quantities x 1, …, xn of n foods. One unit of food j costs cj, contains amount aij of nutrient i healthy diet requires nutrient i in quantity at least bi to find cheapest healthy diet n n n minimize c. Tx subject to Ax≤b, x≥b piecewise-linear minimization minimize maxi=1, …, m a. Tix+bi equivalent to an LP

Assignment problem n n The assignment problem is finding a maximum weight matching in Assignment problem n n The assignment problem is finding a maximum weight matching in a weighted bipartite graph. Max cijxij n n n S. t. j=1, …, n xij=1, i=1, …, n xij=1, …, n xij≥ 0

Minimum spanning tree n n Given a connected, undirected graph, a spanning tree of Minimum spanning tree n n Given a connected, undirected graph, a spanning tree of that graph is a subgraph which is a tree and connects all the vertices together. Max Ct x n n n S. t x(S)≤S-1 for all S V x(E)=|V|-1 xe≥ 0 for all e E

Outline of the lecture n n n More example of Lp Generalized inequality constraints Outline of the lecture n n n More example of Lp Generalized inequality constraints Semidefinite program (SDP) Simplex algorithm Games Theory Lagrange Duality

Minimal surface n n Consider a dierentiable function f: R 2 R, domf = Minimal surface n n Consider a dierentiable function f: R 2 R, domf = C. The surface area of its graph is given by n n n A= C(1+|| f(x)||22)1/2 dx= C||( f(x), 1)||2 The minimal surface problem is to find the function The minimal surface problem is area function f that minimizes A subject to some constraint n n for example, some given values of f on the boundary of C We will approximate this problem by discretizing the function f.

Minimal surface n f(x) 1/k <fi+1, j-fi, j, fi, j+1 -fi, j> A Adisc Minimal surface n f(x) 1/k A Adisc 1/k 2 ||||2 n Min Adisc n n S. t f 0, j=lj f. K, j=rj

Linear Programming: Box constraints n n Min <c, t> Subject to li<x<ui Linear Programming: Box constraints n n Min Subject to li

Generalized inequality constraints n n convex problem with generalized inequality constraints minimize f 0(x) Generalized inequality constraints n n convex problem with generalized inequality constraints minimize f 0(x) n n n S. t fi(x)≤ki 0, i=1, …, m Ax = b f 0: Rn R convex; fi: Rn Rki ki-convex w. r. t. proper cone Ki same properties as standard convex problem (convex feasible set, local optimum is global, etc. )

conic form problem n n special case with affine objective and constraints minimize f conic form problem n n special case with affine objective and constraints minimize f 0(x) n n n S. t Fx+g≤k 0, i=1, …, m Ax = b

Semidefinite program (SDP) n minimize c. Tx n n n S. t x 1 Semidefinite program (SDP) n minimize c. Tx n n n S. t x 1 F 1+x 2 F 2+…+xn. Fn+G≤k 0 Ax = b Fi, G, K Sn+ Standard and inequality form sdp minimize Tr(CX) n n S. t Tr(Ai. X)=bi X≥ 0 Ai, C, X Sn+

Example n n Eigenvalue minimization minimize max(A(x)) n n equivalent SDP minimize t n Example n n Eigenvalue minimization minimize max(A(x)) n n equivalent SDP minimize t n n n Where A(x)=A 0+x 1 A 1+…+xn. An Ai Sn+ Where A 0+x 1 A 1+…+xn. An ≤t I Ai Sn+, x Rn, t R follows from n max(A)≤t A≤t. I

SIMPLEX n n n n n Standard form slack form Simplex Method Simplex Illustrated: SIMPLEX n n n n n Standard form slack form Simplex Method Simplex Illustrated: Initial Dictionary Pivot ALGORITHM Simplex(A, b, c) ALGORITHM Initialize-simplex ALGORITHM Simplex using matrix notation Simplex Weaknesses: Exponential Iterations: Klee-Minty Reviewed

Feasibility in 2 -Space n n 2 x 1 + x 2 ≤ 4 Feasibility in 2 -Space n n 2 x 1 + x 2 ≤ 4 In an LP environment, restrict to Quadrant I since x 1, x 2 ≥ 0

Feasibility in 3 -Space n n Five total constraints; therefore 5 faces to the Feasibility in 3 -Space n n Five total constraints; therefore 5 faces to the polyhedron

Standard form n max CTx n n S. t Ax≤b x≥ 0 Standard form n max CTx n n S. t Ax≤b x≥ 0

Example n n Max c 1 x 1+c 2 x 2 S. t n Example n n Max c 1 x 1+c 2 x 2 S. t n n x 1+x 2≤ 4 x 1+2 x 2≥ 2 x 1+3 x 2=5 x 1 ≥ 0 n n Max +c 1 x 1+c 2 x 2 S. t n n n x 1+x 2≤ 4 -x 1 -2 x 2 ≤ -2 x 1+3 x 2 ≤ 5 x 1+3 x 2≥ 5 x 1 ≥ 0

Example n n Max -c 1 x 1 -c 2 x 2 S. t Example n n Max -c 1 x 1 -c 2 x 2 S. t n n n x 1+x 2≤ 4 -x 1 -2 x 2 ≤ -2 x 1+3 x 2 ≤ 5 x 1+3 x 2≥ 5 x 1 ≥ 0 n n Max -c 1 x 1 -c 2(y 1 -y 2) S. t n n n n x 1+(y 1 -y 2)≤ 4 -x 1 -2(y 1 -y 2) ≤ -2 x 1+3(y 1 -y 2) ≤ 5 x 1 -3(y 1 -y 2) ≤ -5 x 2=y 1 -y 2 x 1, y 2 ≥ 0

Augmented form (slack form) n n max c. Tx S. t. n n Ax=0 Augmented form (slack form) n n max c. Tx S. t. n n Ax=0 x≥ 0

Example n n Max c 1 x 1+c 2 x 2 S. t n Example n n Max c 1 x 1+c 2 x 2 S. t n n x 1+x 2≤ 4 x 1+2 x 2≥ 2 x 1+3 x 2=5 x 1, x 2 ≥ 0 n n max c 1 x 1+c 2 x 2 S. t n n n x 1+x 2+x 3=4 -x 1 -2 x 2+x 4=-2 x 1+3 x 2+x 5 = 5 -x 1 -3 x 2+x 6 =-5 x 1, x 2, x 3…, x 6 ≥ 0

Simplex Method n Every time a new dictionary is generated: n n n Simplex Simplex Method n Every time a new dictionary is generated: n n n Simplex moves from one vertex to another vertex along an edge of polyhedron Analogous to increasing value of a non-basic variable until bounded by basic constraint Each such point is a feasible solution

Notation n Variables of nonzero value are called basic variables, and values of zero Notation n Variables of nonzero value are called basic variables, and values of zero values are called nonbasic variables in the simplex algorithm

Simplex Illustrated: Initial Dictionary Current solution: x 1 = 0 x 2 = 0 Simplex Illustrated: Initial Dictionary Current solution: x 1 = 0 x 2 = 0 x 3 = 0

Simplex Illustrated: First Pivot Current solution: x 1 = 0 x 2 = 0 Simplex Illustrated: First Pivot Current solution: x 1 = 0 x 2 = 0 x 3 = 5

Simplex Illustrated: Second Pivot Current solution: x 1 = 2 x 2 = 0 Simplex Illustrated: Second Pivot Current solution: x 1 = 2 x 2 = 0 x 3 = 5

Simplex Illustrated: Final Pivot Final solution (optimal): x 1 = 0 x 2 = Simplex Illustrated: Final Pivot Final solution (optimal): x 1 = 0 x 2 = 4 x 3 = 5

Simplex Review and Analysis n n n Simplex pivoting represents traveling along polyhedron edges Simplex Review and Analysis n n n Simplex pivoting represents traveling along polyhedron edges Each vertex reached tightens one constraint (and if needed, loosens another) May take a longer path to reach final vertex than needed

Pivot 1. 2. 3. 4. Compute the coefficients of the eq for the new Pivot 1. 2. 3. 4. Compute the coefficients of the eq for the new basic variable Compute the coefficients of the remaining constrains Compute the objects function. Compute new sets of basic and non basic variables

Pivot n n 1. 2. Pivot(N, B, A, b, c, v, l, e) Computed Pivot n n 1. 2. Pivot(N, B, A, b, c, v, l, e) Computed the coefficients of the eq for the new basic variable be bl/al, e For each j N-{e} 1. 3. Do a’e, j ai, j/al, e a’e, l 1/al, e

Pivot n n 1. Pivot(N, B, A, b, c, v, l, e) Computed the Pivot n n 1. Pivot(N, B, A, b, c, v, l, e) Computed the coefficients of the remaining constrains For each i B-{l} 1. 2. Do b’i bi-aij b’e For each j N-{e} 1. Do a’i, j ai, j-ai, e a’e, j

Pivot n n Pivot(N, B, A, b, c, v, l, e) Computed the objects Pivot n n Pivot(N, B, A, b, c, v, l, e) Computed the objects function. 1. 2. v’ v+ce a’b’e For each j N-{e} 1. 3. Do c’j cj-cea’e, j c’l -cea’e, l

Pivot n n 1. 2. 3. Pivot(N, B, A, b, c, v, l, e) Pivot n n 1. 2. 3. Pivot(N, B, A, b, c, v, l, e) Compute new sets of basic and non basic variables N’={N-{e}} {l} B’={B-{l}} {e} Returan (N’, B’, A’, b’, c’, v’)

Pivot(N, B, A, b, c, v, l, e) Computed the coefficients of the eq Pivot(N, B, A, b, c, v, l, e) Computed the coefficients of the eq for the new basic variable be bl/al, e For each j N-{e} n n 1. 2. Do a’e, j ai, j/al, e 1. a’e, l 1/al, e Computed the coefficients of the remaining constrains For each i B-{l} 3. n 1. Do b’i bi-aij b’e For each j N-{e} 1. 2. 1. Computed the objects function. n v’ v+ce a’b’e For each j N-{e} 1. 2. 1. 3. n 1. 2. 3. Do a’i, j ai, j-ai, e a’e, j Do c’j cj-cea’e, j c’l -cea’e, l Compute new sets of basic and non basic variables N’={N-{e}} {l} B’={B-{l}} {e} Returan (N’, B’, A’, b’, c’, v’)

Simplex(A, b, c) n n (N, B, A, c, v) Initialize-simplex While some index Simplex(A, b, c) n n (N, B, A, c, v) Initialize-simplex While some index j N has cj >0 n Do choose an index i B n Do if ai, e>0 n n n Then i bi/aie else i Choose an index l B that minimizes l If l = then return ”unbounded” Else (N, B, A, c, v) Pivot(N, B, A, c, v) Outpot(N, B, A, c, v)

Simplex(A, b, c) n n Output For i=1 to n n Do if i Simplex(A, b, c) n n Output For i=1 to n n Do if i B then xi=bi Else xi=0 Return (x 1, …. , xn)

The problem L n n Max –x 0 S. t. n n aijxj-x 0≤bj The problem L n n Max –x 0 S. t. n n aijxj-x 0≤bj For i=1, …, m xi≥ 0 for i=0, …, n

Initialize-simplex n n Let l be the index of the minimum bi If bl>0 Initialize-simplex n n Let l be the index of the minimum bi If bl>0 n n n n Then return ({1, …, n}, {n+1, …, n+m}, A, b, c, 0) Let (N, B, A, b, c, v) be the slack form for L L has n+1 non basic variables and m basic variables (N, B, A, b, c, v) Pivot(N, B, A, b, c, v) The basic solution is feasible for L Use simplex to find an optimal solution If solution is 0 then set x to be the basic optimal solution of L n Else return infeasibal

Simplex using matrix notation n n maximize CTx S. t. Ax≤b, x≥ 0 where Simplex using matrix notation n n maximize CTx S. t. Ax≤b, x≥ 0 where c. B are the coefficients of basic variables in the c-matrix; and B is the columns of [AI] corresponding to the basic variables.

Algorithm n Choose an initial BF as shown above n n This implies that Algorithm n Choose an initial BF as shown above n n This implies that B is the identity matrix, and is a zero-vector. While nonoptimal solution: n Determine direction of highest gradient n n n Choose the variable associated with the coefficient in that has the highest negative magnitude. This nonbasic variable, which we call the entering basic, will be increased to help maximize the problem.

Algorithm n n Determine maximum step length Use the subequation to determine which basic Algorithm n n Determine maximum step length Use the subequation to determine which basic variable reaches zero first when the entering Rewrite problem Check for improvement

Simplex Weaknesses: Exponential Iterations: Klee-Minty Reviewed n n n Cases with high complexity (2 Simplex Weaknesses: Exponential Iterations: Klee-Minty Reviewed n n n Cases with high complexity (2 n-1 iterations) Normal complexity is O(m 3) How was this problem solved?

Geometric Interpretation & Klee-Minty n n Saw non-optimal solution earlier How can we represent Geometric Interpretation & Klee-Minty n n Saw non-optimal solution earlier How can we represent the Klee. Minty problem class graphically?

Step 1: Constructing a Shape n n n Start with a cube. What characteristics Step 1: Constructing a Shape n n n Start with a cube. What characteristics do we want the cube to have? What is the worst case to maximize z?

Step 1: Constructing a Shape n n Goal 1: Create a shape with a Step 1: Constructing a Shape n n Goal 1: Create a shape with a long series of increasing facets Goal 2: Create an LP problem that forces this route to be taken

Step 2: Increasing Objective Function: Modifying the Cub [0, 1, 0. 8] n Squash Step 2: Increasing Objective Function: Modifying the Cub [0, 1, 0. 8] n Squash the cube [0, 0, 1] [1, 0, 0. 98] [1, 0. 8, 0] [0, 1, 0] n New dictionary [1, 0, 0] [0, 1, 0. 82]

Games Theory n n n A game consists of a set of players A Games Theory n n n A game consists of a set of players A set of moves (or strategies) available to those players, A specification of payoffs for each combination of strategies

Normal form n n The normal )or strategic form) game is a matrix which Normal form n n The normal )or strategic form) game is a matrix which shows the players, strategies, and payoffs Example Player 2 chooses Left Player 2 chooses Right Player 1 chooses Up 4, 3 – 1, – 1 Player 1 chooses Down 0, 0 3, 4 Normal form or payoff matrix of a 2 -player, 2 -strategy game

Zero sum and non-zero sum n In zero-sum games the total benefit to all Zero sum and non-zero sum n In zero-sum games the total benefit to all players in the game, for every combination of strategies, always adds to zero. Main article: Zero-sum A B A – 1, 1 3, – 3 B 0, 0 – 2, 2 A zero-sum game

prisoner's dilemma Prisoner B Stays Silent Prisoner A Betrays Both serve six months Prisoner prisoner's dilemma Prisoner B Stays Silent Prisoner A Betrays Both serve six months Prisoner B Betrays Prisoner A serves ten years Prisoner B goes free Prisoner A goes free Both serve two years Prisoner B serves ten years

Mixed strategies for matrix games n The players use randomized or mixed strategies, n Mixed strategies for matrix games n The players use randomized or mixed strategies, n n which means that each player makes his or her choice randomly and independently of the other player's choice, according to a probability distribution u and v give the probability distributions of the choices of the two players, n i. e. , their associated strategies.

The expected payoff n The expected payoff from player 1 to player 2 is The expected payoff n The expected payoff from player 1 to player 2 is then n Player 1 wishes to choose u to minimize n n u. TPV player 2 wishes to choose v to maximize n u. TPV

point of view of player 1 n n assuming her strategy u is known point of view of player 1 n n assuming her strategy u is known to player 2. Player 2 will choose v to maximize u. TPv, n n n The best player 1 can do is to choose u to minimize this worst-case payoff to player 2, to choose a strategy u that solves the problem min maxi (PTu)i n n the expected payoff is Sup{u. TPv: v≥ 0, 1 Tv=1 }= maxi (PTu)i S. t u≥ 0, 1 Tu=1 Let p 1* be optimal value of this problem

point of view of player 2 n n assuming her strategy v is known point of view of player 2 n n assuming her strategy v is known to player 1. Player 1 will choose u to minimize u. TPv, n n n The best player 2 can do is to choose u to minimize this worst-case payoff to player 2, to choose a strategy u that solves the problem max mini (Pv)i n n the expected payoff is Sup{u. TPv: u≥ 0, 1 Tu=1 }= maxi (Pv)i S. t v≥ 0, 1 Tv=1 Let p 2* be optimal value of this problem

Duality n n n Lagrange dual problem weak and strong duality geometric interpretation optimality Duality n n n Lagrange dual problem weak and strong duality geometric interpretation optimality conditions examples

Lagrangian n n standard form problem (not necessarily convex) minimize f 0(x) n n Lagrangian n n standard form problem (not necessarily convex) minimize f 0(x) n n n variable x Rn, domain D, optimal value p* Lagrangian: L: Rn Rm Rp R, n n n S. t fi(x)≤ 0, i=1, …, m hi(x) = 0; i = 1, …, p with dom L=D Rm Rp L(x, , )=f 0(x)+ ifi(x) + jhj(x) weighted sum of objective and constraint functions n n i is Lagrange multiplier associated with fi(x) ≤ 0 j is Lagrange multiplier associated with hj(x) = 0

Lagrange dual function n Lagrange dual function: g: Rm Rp R, n n g Lagrange dual function n Lagrange dual function: g: Rm Rp R, n n g is concave, can be - for some , lower bound property: n n g( , )= infx D L(x, , ) = infx D f 0(x)+ ifi(x)+ jhj(x) if ≥ 0, then g( , )≤ p* Proof if x’ is feasible and ≥ 0, then n n f 0(x’)≥L(x’, , )≥infx D L(x, , )=g( , ) minimizing over all feasible x’ gives p*≥g( , )

Least-norm solution of linear equations n minimize x. Tx n n S. t Ax=b Least-norm solution of linear equations n minimize x. Tx n n S. t Ax=b x* = A b Where A =(ATA)-1 AT or A =AT(AAT)-1 dual function Lagrangian is L(x, )=x. Tx+ T(Ax-b) to minimize L over x, set gradient equal to zero: n n x. L=2 x+ AT =0 x=-1/2 AT plug in L to obtain g: g( )=L(-1/2 AT , )=-1/4 TAAT -b. T lower bound property: p*≥-1/4 TAAT -b. T

Standard form LP n Min c. Tx n n n dual function Lagrangian is Standard form LP n Min c. Tx n n n dual function Lagrangian is n n n S. t Ax=b, x≥ 0 L(x, , )=c. Tx+ T(Ax-b)- Tx= = -b. T +(c+AT - )Tx L is linear in x, hence g( , )=infx D L(x, , )=-b. T if c+AT - =0 otherwise g( , )=- n

The dual problem n n maximize g ( , ) S. t. n n The dual problem n n maximize g ( , ) S. t. n n ≥ 0 Finds best lower bound on p*, obtained from Lagrange dual function a convex optimization problem; optimal value denoted d* , are dual feasible if ≥ 0, ( , ) dom g

equivalent problem g( , )=infx D -b. T +(c+AT - )Tx n Min c. equivalent problem g( , )=infx D -b. T +(c+AT - )Tx n Min c. T x n n n S. t Ax-b=0 x≥ 0 max b. T n S. t AT +c≥ 0 n max b. T n n S. t AT - +c=0 ≥ 0

Karush-Kuhn-Tucker (KKT) conditions n n the following four conditions are called KKT conditions (for Karush-Kuhn-Tucker (KKT) conditions n n the following four conditions are called KKT conditions (for a problem with differentiable fi, hi): 1. 2. 3. 4. primal constraints: ifi(x)≤ 0, hi(x)=0 dual constraints: i≥ 0 complementary slackness ifi(x)=0 gradient of Lagrangian with respect to x vanishes: f 0(x)+ i fi(x)+ j hj(x)=0

Two-way partitioning n Min XTWX n n n S. t xi 2=1, i=1, …, Two-way partitioning n Min XTWX n n n S. t xi 2=1, i=1, …, n A nonconvex problem; feasible set contains 2 n discrete points interpretation: partition {1, …, n} in two sets Wi, j is cost of assigning i, j to the same set -Wi, j is cost of assigning to different sets dual function

Two-way partitioning n Min XTWX n S. t xi 2=1, i=1, …, n n Two-way partitioning n Min XTWX n S. t xi 2=1, i=1, …, n n dual function n lower bound property: p*≥-1 T if W+diag( ) ≥ 0 n example: =- min(W)1 gives p*≥n min(W)

Lagrange dual and conjugate function n the conjugate of a function f is n Lagrange dual and conjugate function n the conjugate of a function f is n n Min f 0(x) n n n f*(y) = supx dom f y. Tx-f(x) S. t Ax≤b, x. C=d Using the conjugate of f 0 we can write the dual function: g( , )=infx D f 0(x)+ T(Ax-b) + T(Cx-d) =-b T-d T+infx D f 0(x)+ TAx + TCx =-b T-d T-f*0(-AT - CT ) The domain of g follows from the domain of f* n dom(g)={( , ): -AT - CT Dom f 0* }

Example n f 0(x)=-logx, f*(y)=xy+log(x) n n Therefore f*(y)=-log(-y)-1 g( , )= -b T-d Example n f 0(x)=-logx, f*(y)=xy+log(x) n n Therefore f*(y)=-log(-y)-1 g( , )= -b T-d T+log(-AT - CT )+1

Equality constrained norm minimization n Min ||x|| n S. t n n Conjugate function Equality constrained norm minimization n Min ||x|| n S. t n n Conjugate function is n n Were ||y||*=sup||x||≤ 1 x. Ty And so we get n n Ax=b g( )=-d T-f*0(- AT ) f*(y) = supx dom f y. Tx-f(x)

Weak and strong duality n n n weak duality: d*≤p* always holds (for convex Weak and strong duality n n n weak duality: d*≤p* always holds (for convex and nonconvex problems) can be used to find nontrivial lower bounds for difficult problems n n for example, solving the SDP Min -1 T n n S. t W + diag( )≥ 0 gives a lower bound for the two-way partitioning problem

strong duality: d* = p* n n n does not hold in general (usually) strong duality: d* = p* n n n does not hold in general (usually) holds for convex problems conditions that guarantee strong duality in convex problems are called n n constraint qualifications Slater's constraint qualification

Slater's constraint qualification n n strong duality holds for a convex problem Min f Slater's constraint qualification n n strong duality holds for a convex problem Min f 0(x) n n n if it is strictly feasible, i. e. , n n S. t fi(x)≤ 0 i=1, …, m Ax=0 x int D: fi(x)<0 i=1, …, m and Ax=0 also guarantees that the dual optimum is attained (if p*>- )

n n Inequality form LP primal problem minimize c. Tx n n dual function n n Inequality form LP primal problem minimize c. Tx n n dual function dual problem Max -b. T n n n S. t Ax≤ b S. t AT +c=0, ≥ 0 from Slater's condition: p*=d* if ATx

Weak duality n n Example Min –x n n n s. t x-1/2≤ 0 Weak duality n n Example Min –x n n n s. t x-1/2≤ 0 x {0, 1} g( )=minx {0, 1}{-x+ (x-1/2)}=min{- /2, /2 -1} p*=0 d*=-1/2

Game theory P 1*=P 2* n n n P 1*≥P 2* Using duality it Game theory P 1*=P 2* n n n P 1*≥P 2* Using duality it follows that P 1*=P 2* min maxi (PTu)i n n Min t n n n S. t u≥ 0, 1 Tu=1 PTu≤t. I S. t u≥ 0, 1 Tu=1 The Lagrange is t+ T(PT-t 1)- Tu+ (1 -1 Tu)= +(1 -1 T )t+(P - 1 - )Tu So the dual function is n