EE364b Homework 5. A ij = φ i (x i,y i ) subject to Ax + s = 0, Ay + t = 0, with variables x, y R n. This is the bi-commodity network flow problem.

Similar documents
EE364b Homework 4. L(y,ν) = (1/2) y x ν(1 T y 1), minimize (1/2) y x 2 2 subject to y 0, 1 T y = 1,

EE364a Homework 8 solutions

EE364b Homework 7. t=1

EE364b Homework 2. λ i f i ( x) = 0, i=1

Dual Decomposition.

Analytic Center Cutting-Plane Method

CSCI : Optimization and Control of Networks. Review on Convex Optimization

A Brief Review on Convex Optimization

4. Convex optimization problems

Constrained Optimization and Lagrangian Duality

Exercises for EE364b

Lecture 7: Convex Optimizations

Lecture: Duality of LP, SOCP and SDP

4. Convex optimization problems (part 1: general)

Lecture: Convex Optimization Problems

Sequential Convex Programming

UC Berkeley Department of Electrical Engineering and Computer Science. EECS 227A Nonlinear and Convex Optimization. Solutions 6 Fall 2009

Homework Set #8 - Solutions

Convex Optimization. (EE227A: UC Berkeley) Lecture 6. Suvrit Sra. (Conic optimization) 07 Feb, 2013

5. Duality. Lagrangian

11. Equality constrained minimization

Final exam.

Inequality constrained minimization: log-barrier method

minimize x subject to (x 2)(x 4) u,

Homework Set #6 - Solutions

EE364b Convex Optimization II May 30 June 2, Final exam

Tutorial on Convex Optimization for Engineers Part II

EE363 homework 8 solutions

Extreme Abridgment of Boyd and Vandenberghe s Convex Optimization

Convex Optimization Boyd & Vandenberghe. 5. Duality

Lagrange duality. The Lagrangian. We consider an optimization program of the form

Nonlinear Optimization for Optimal Control

subject to (x 2)(x 4) u,

Relaxations and Randomized Methods for Nonconvex QCQPs

Lecture: Duality.

4. Convex optimization problems

9. Dual decomposition and dual algorithms

Math 273a: Optimization Subgradients of convex functions

14. Duality. ˆ Upper and lower bounds. ˆ General duality. ˆ Constraint qualifications. ˆ Counterexample. ˆ Complementary slackness.

Uses of duality. Geoff Gordon & Ryan Tibshirani Optimization /

10. Ellipsoid method

minimize x x2 2 x 1x 2 x 1 subject to x 1 +2x 2 u 1 x 1 4x 2 u 2, 5x 1 +76x 2 1,

15. Conic optimization

Convex Optimization. Lecture 12 - Equality Constrained Optimization. Instructor: Yuanzhang Xiao. Fall University of Hawaii at Manoa

Geometric problems. Chapter Projection on a set. The distance of a point x 0 R n to a closed set C R n, in the norm, is defined as

Primal/Dual Decomposition Methods

Math 5490 Network Flows

Subgradients. subgradients. strong and weak subgradient calculus. optimality conditions via subgradients. directional derivatives

Lecture Note 5: Semidefinite Programming for Stability Analysis

Convex Optimization. Newton s method. ENSAE: Optimisation 1/44

Convex optimization problems. Optimization problem in standard form

Algorithms for Nonsmooth Optimization

CS-E4830 Kernel Methods in Machine Learning

12. Interior-point methods

Lecture 15 Newton Method and Self-Concordance. October 23, 2008

Convex Optimization M2

EE/ACM Applications of Convex Optimization in Signal Processing and Communications Lecture 17

Subgradients. subgradients and quasigradients. subgradient calculus. optimality conditions via subgradients. directional derivatives

CSCI5654 (Linear Programming, Fall 2013) Lectures Lectures 10,11 Slide# 1

Convex Optimization. Ofer Meshi. Lecture 6: Lower Bounds Constrained Optimization

Optimization for Machine Learning

Convex Optimization. (EE227A: UC Berkeley) Lecture 4. Suvrit Sra. (Conjugates, subdifferentials) 31 Jan, 2013

Lagrange Duality. Daniel P. Palomar. Hong Kong University of Science and Technology (HKUST)

HW1 solutions. 1. α Ef(x) β, where Ef(x) is the expected value of f(x), i.e., Ef(x) = n. i=1 p if(a i ). (The function f : R R is given.

10725/36725 Optimization Homework 4

Dual Proximal Gradient Method

Duality. Geoff Gordon & Ryan Tibshirani Optimization /

Convex Optimization M2

Convex Optimization Problems. Prof. Daniel P. Palomar

Optimization for Communications and Networks. Poompat Saengudomlert. Session 4 Duality and Lagrange Multipliers

Subgradient. Acknowledgement: this slides is based on Prof. Lieven Vandenberghes lecture notes. definition. subgradient calculus

The proximal mapping

Convex Optimization & Lagrange Duality

Shiqian Ma, MAT-258A: Numerical Optimization 1. Chapter 4. Subgradient

A Distributed Newton Method for Network Utility Maximization, I: Algorithm

Compressive sampling, or how to get something from almost nothing (probably)

Solving Dual Problems

12. Interior-point methods

ICS-E4030 Kernel Methods in Machine Learning

Convex Optimization. (EE227A: UC Berkeley) Lecture 15. Suvrit Sra. (Gradient methods III) 12 March, 2013

Course Outline. FRTN10 Multivariable Control, Lecture 13. General idea for Lectures Lecture 13 Outline. Example 1 (Doyle Stein, 1979)

Linear and non-linear programming

Convex Optimization and l 1 -minimization

Convex Optimization and Modeling

CHAPTER 2: CONVEX SETS AND CONCAVE FUNCTIONS. W. Erwin Diewert January 31, 2008.

Convex Functions. Daniel P. Palomar. Hong Kong University of Science and Technology (HKUST)

Distributed Optimization: Analysis and Synthesis via Circuits

An Introduction to CVX

Convex Optimization and Modeling

Convex Optimization on Large-Scale Domains Given by Linear Minimization Oracles

Lecture 14: Primal-Dual Interior-Point Method

EE364 Review Session 4

Dual methods and ADMM. Barnabas Poczos & Ryan Tibshirani Convex Optimization /36-725

Barrier Method. Javier Peña Convex Optimization /36-725

Motivation. Lecture 2 Topics from Optimization and Duality. network utility maximization (NUM) problem:

EE 546, Univ of Washington, Spring Proximal mapping. introduction. review of conjugate functions. proximal mapping. Proximal mapping 6 1

The Q-parametrization (Youla) Lecture 13: Synthesis by Convex Optimization. Lecture 13: Synthesis by Convex Optimization. Example: Spring-mass System

Operations Research Lecture 4: Linear Programming Interior Point Method

Matrix Rank Minimization with Applications

10. Unconstrained minimization

Transcription:

EE364b Prof. S. Boyd EE364b Homewor 5 1. Distributed method for bi-commodity networ flow problem. We consider a networ (directed graph) with n arcs and p nodes, described by the incidence matrix A R p n, where A ij = 1, if arc j enters node i 1, if arc j leaves node i 0, otherwise. Two commodities flow in the networ. Commodity 1 has source vector s R p, and commodity 2 has source vector t R p, which satisfy 1 T s = 1 T t = 0. The flow of commodity 1 on arc i is denoted x i, and the flow of commodity 2 on arc i is denoted y i. Each of the flows must satisfy flow conservation, which can be expressed as Ax+s = 0 (for commodity 1), and Ay + t = 0 (for commodity 2). Arc i has associated flow cost φ i (x i,y i ), where φ i : R 2 R is convex. (We can impose constraints such as nonnegativity of the flows by restricting the domain of φ i to R 2 +.) One natural form for φ i is a function only the total traffic on the arc, i.e., φ(x i,y i ) = f i (x i + y i ), where f i : R R is convex. In this form, however, φ is not strictly convex, which will complicate things. To avoid these complications, we will assume that φ i is strictly convex. The problem of choosing the minimum cost flows that satisfy flow conservation can be expressed as minimize ni=1 φ i (x i,y i ) subject to Ax + s = 0, Ay + t = 0, with variables x, y R n. This is the bi-commodity networ flow problem. (a) Propose a distributed solution to the bi-commodity flow problem using dual decomposition. Your solution can refer to the conjugate functions φ i. (b) Use your algorithm to solve the particular problem instance with φ i (x i,y i ) = (x i + y i ) 2 + ǫ(x 2 i + y 2 i ), domφ i = R 2 +, with ǫ = 0.1. The other data for this problem can be found inbicommodity_data.m. To chec that your method wors, compute the optimal value p, using cvx. For the subgradient updates use a constant stepsize of 0.1. Run the algorithm for 200 iterations and plot the dual lower bound versus iteration. With a logarithmic vertical axis, plot the norms of the residuals for each of the two flow conservation equations, versus iteration number, on the same plot. 1

Hint: We have posted a function [x,y] = quad2_min(eps,alpha,beta), which computes ( (x,y ) = argmin (x + y) 2 + ǫ(x 2 + y 2 ) + αx + βy ) x 0,y 0 analytically. You might find this function useful. Solution: (a) The Lagrangian of the flow control problem is n L(x,y,µ,ν) = φ i (x i,y i ) + µ T (Ax + s) + ν T (Ay + t) i=1 n = µ T s + ν T t + (φ i (x i,y i ) + ( µ i )x i + ( ν i )y i ), i=1 where µ i = a T i µ and ν i = a T i ν. The dual function is g(µ, ν) = inf L(x,y,µ,ν) x 0,y 0 n = µ T s + ν T t φ i( µ i, ν i ), i=1 where φ i(u,v) = sup x 0,y 0 (xu + yv φ i (x,y)). The dual is the unconstrained problem maximize g(µ, ν). In complete analogy to the analysis of the lecture notes, by using a subgradient method to solve the dual problem we obtain the following algorithm. given initial potential vectors µ and ν. repeat Determine lin flows from potential differences. (x i,y i ) := argmin (φ i (x i,y i ) + ( µ i )x i + ( ν i )y i ), j = 1,...,n. Compute flow surplus at each node. S i := a T i x + s i, i = 1,...,p. T i := a T i y + t i, i = 1,...,p. Update node potentials. µ i := µ i + α S i, i = 1,...,p. ν i := ν i + α T i, i = 1,...,p. (b) The following code solves the problem bicommodity_data; % Get solution cvx_begin 2

variables x_star(n) y_star(n) dual variables mu_star nu_star minimize(sum((x_star+y_star).^2)+eps*(sum(x_star.^2+y_star.^2))) subject to mu_star: A*x_star+s==0; nu_star: A*y_star+t==0; x_star >= 0; y_star >= 0; cvx_end f_min = cvx_optval; % Dual decomposition mu = zeros(p,1); nu = zeros(p,1); x = zeros(n,1); y = zeros(n,1); MAX_ITER = 200; L = []; infeas1 = []; infeas2 = []; for i = 1:MAX_ITER % Potential differences delta_mu = A *mu; delta_nu = A *nu; % Update flows for j = 1:n [x(j),y(j)] = quad2_min(eps,delta_mu(j),delta_nu(j)); end infeas1 = [infeas1 norm(a*x+s)]; infeas2 = [infeas2 norm(a*y+t)]; % Update lower bound l = sum((x+y).^2)+eps*(sum(x.^2+y.^2))+mu *(A*x+s)+nu *(A*y+t); L = [L l]; end % Update potentials alpha =.1; mu = mu+alpha*(a*x+s); nu = nu+alpha*(a*y+t); figure plot(1:max_iter,l, b-,[1 MAX_ITER],[f_min f_min], r-- ) legend( lb, opt ) xlabel( iter ) 3

2 1.8 1.6 1.4 1.2 1 0.8 0.6 g(µ, ν) φ(x,y ) 0.4 0.2 0 0 20 40 60 80 100 120 140 160 180 200 Figure 1: Lower bound g(µ, ν) on flow cost versus iteration. figure semilogy(infeas1) xlabel( iter ) ylabel( ninfeas1 ) figure semilogy(infeas2) ylabel( ninfeas2 ) xlabel( iter ) 4

10 1 10 0 Ax + s 2 10 1 10 2 10 3 10 4 0 20 40 60 80 100 120 140 160 180 200 Figure 2: Evolution of infeasibility for commodity 1 versus iteration. 10 1 10 0 Ay + t 2 10 1 10 2 10 3 10 4 0 20 40 60 80 100 120 140 160 180 200 Figure 3: Evolution of infeasibility for commodity 2 versus iteration. 5

2. Minimum eigenvalue via convex-concave procedure. The (nonconvex) problem minimize x T Px subject to x 2 2 1, with P S n n +, has optimal value λ min (P); x is optimal if and only if it is an eigenvector of P associated with λ min (P). Explain how to use the convex-concave procedure to (try to) solve this problem. Generate and (possibly) solve a few instances of this problem using the convex-concave procedure, starting from a few (nonzero) initial points. Compare the values found by the convex-concave procedure with the optimal value. Solution. We solve the problem minimize x T Px subject to 1 x 2 2 0 using the convex-concave procedure. Linearizing 1 x 2 2 around the point x (), we set x (+1) to the optimal point x in the problem minimize x T Px subject to 1 ( x () 2 + 2x ()T (x x () )) 0. An example graph, and its generating Matlab code, appear below. 150 100 x ()T Px () 50 0 1 2 3 4 5 6 7 8 randn( state, 1091); rand( state, 1091); n = 40; P = randn(n); P = 3*eye(n) + P *P; 6

vals = []; xold = 1/n*ones(n, 1); Nmax = 8; for i = 1:Nmax cvx_begin cvx_quiet(true); variable x(n) minimize(x *P*x) 1-2*xold *(x - xold) - xold *xold <= 0; cvx_end disp(cvx_optval) vals = [vals; cvx_optval]; xold = x; end figure(1); cla; plot(vals); hold on; plot([1 Nmax], min(eig(p))*[1 1], -- ); xlabel( x ); ylabel( y ); print -deps2 mineig.eps 3. Ellipsoid method for an SDP. We consider the SDP maximize 1 T x subject to x i 0, Σ diag(x) 0, with variable x R n and data Σ S n ++. The first inequality is a vector (componentwise) inequality, and the second inequality is a matrix inequality. (This specific SDP arises in several applications.) Explain how to use the ellipsoid method to solve this problem. Describe your choice of initial ellipsoid and how you determine a subgradient for the objective (expressed as 1 T x, which is to be minimized) or constraint functions (expressed as max i ( x i ) 0 and λ max (diag(x) Σ) 0). You can describe a basic ellipsoid method; you do not need to use a deep-cut method, or wor in the epigraph. Try out your ellipsoid method on some randomly generated data, with n 20. Use a stopping criterion that guarantees 1% accuracy. Compare the result to the solution found using cvx. Plot the upper and lower bounds from the ellipsoid method, versus iteration number. Solution. There are many possible choices for an initial ellipsoid that contains the optimal point x. For example, we can use the fact that all feasible x lie in the box 0 x diag(σ). One simple starting ellipsoid is the Euclidean ball centered at x = (1/2)diag(Σ) (the center of the box), with radius (1/2)( n i=1 Σ 2 ii) 1/2. Suppose that at the th iteration we have D () = diag(x () ). 7

We ll transform the problem to one of minimizing f(x) = 1 T x. When x () is feasible, the subgradient of f is simply 1. If a component of x () (say, the jth component) is negative, we use the constraint subgradient g = e j. The interesting case comes when x () 0, but λ max (diag(x () ) Σ) > 0. In this case we can find a constraint subgradient as follows. Find an eigenvector v associated with the largest eigenvalue of Σ diag(x () ). By the wea subgradient calculus, we can find any subgradient of the function v T (diag(x () Σ)v = v T Σv + n i=1 v 2 i x () i. But this is trivial, since this function is affine: We can tae g i = v 2 i, for i = 1,...,n. The following Matlab code implements the ellipsoid method. randn( state,0); n = 20; Sigma = randn(n,n); Sigma = Sigma *Sigma+eye(n); x = 0.5*diag(Sigma); A = diag(ones(n,1)*0.25*sum(diag(sigma).^2)); maxiters = 5000; U = inf; L = -inf; hist = []; feas = 0; tol = 0.01; for = 1:maxiters % find a subgradient [val,ind] = min(x); [V,d] = eig(diag(x)-sigma); if (val <= 0) feas = 0; g = zeros(n,1); g(ind) = -1; elseif (max(diag(d)) >= 0) feas = 0; g = V(:,n).^2; else g = -ones(n,1); feas = 1; D = diag(x); U = min(u,-sum(x)); L = max(l,-sum(x)-sqrt(g *A*g)); end hist = [hist [;feas;u;l]]; if (((U-L) < tol*sum(x)) && (feas == 1)) brea; end; % update the ellipsoid g = g/sqrt(g *A*g); 8

end x = x-a*g/(n+1); A = (n^2/(n^2-1))*(a-a*g*g *A*(2/(n+1))); cvx_begin variable xopt(n) Sigma-diag(xopt) == semidefinite(n); xopt >= 0; minimize(-sum(xopt)) cvx_end figure; set(gca, Fontsize,16); plot(hist(3,:), - ); hold on; plot(hist(4,:), -- ); plot(1:length(hist(3,:)),cvx_optval*ones(length(hist(3,:)),1), : ); xlabel( ); ylabel( ul ); axis([0,2000,-120,-20]); print( -depsc, ellipsoid_sdp.eps ); The following figure shows the progress of the ellipsoid method with iteration number. The solid line shows the upper bound u, the dashed line shows the lower bound l, and the dotted line is the optimal value p, obtained by using cvx. 20 30 40 50 60 70 80 90 100 110 120 0 200 400 600 800 1000 1200 1400 1600 1800 2000 9