Integer Programming (Part 1)
Total Page:16
File Type:pdf, Size:1020Kb
Integer programming (part 1) Lecturer: Javier Pe~na Convex Optimization 10-725/36-725 Coordinate descent Pn Assume f(x) = g(x) + i=1 hi(xi), with g convex, differentiable and each hi convex. To minimize f: start with some initial guess x(0), and repeat (k) (k−1) (k−1) (k−1) x1 2 argmin f x1; x2 ; x3 ; : : : xn x1 (k) (k) (k−1) (k−1) x2 2 argmin f x1 ; x2; x3 ; : : : xn x2 (k) (k) (k) (k−1) x3 2 argmin f x1 ; x2 ; x3; : : : xn x2 ::: (k) (k) (k) (k) xn 2 argmin f x1 ; x2 ; x3 ; : : : xn x2 for k = 1; 2; 3;:::. 2 Outline Today: • (Mixed) integer programming • Examples • Solution techniques: I relaxation I branch and bound I cutting planes 3 (Mixed) integer program Optimization model where some variables are restricted to be integer min f(x) x subject to x 2 C xj 2 Z; j 2 J n n where f : R ! R;C ⊆ R and J ⊆ f1; : : : ; ng: When J = f1; : : : ; ng, the above problem is a pure integer program. Throughout our discussion assume f and C are convex. 4 Special case: binary variables In some cases the variables of an integer program represent yes/no decisions or logical variables. These kinds of decisions can be encoded via binary variables that take values 0 or 1. Combinatorial optimization A combinatorial optimization problem is a triple (N; F; c) where • N is a finite ground set • F ⊆ 2N is a set of feasible solutions N • c 2 R is a cost function The goal is to solve X min ci S2F i2S Many combinatorial optimization problems can be written as binary integer programs. 5 Knapsack problem Determine the most valuable items to take in a limited volume knapsack. max cTx x subject to aTx ≤ b xj 2 f0; 1g; j = 1; : : : ; n here cj and aj are the value and volume of item j and b is the volume of the knapsack. 6 Assignment problem There are n people available to carry n jobs. Each person can be assigned to exactly one job. There is a cost cij if person i is assigned to job j. Find minimum cost assignment. n n X X min cijxij x i=1 j=1 n X xij = 1; j = 1; : : : ; n i=1 n X xij = 1; i = 1; : : : ; n j=1 xij 2 f0; 1g; i = 1; : : : ; n; j = 1; : : : ; n: 7 Facility location There are N = f1; : : : ; ng depots and M = f1; : : : ; mg clients. Fixed cost fj associated to the use of depot j Transportation cost cij if client i is served from depot j. Determine what depots to open and what clients each depot serves to minimize the sum of fixed and transportation costs. n m n X X X min fjyj + cijxij x;y j=1 i=1 j=1 n X xij = 1; i = 1; : : : ; n j=1 xij ≤ yj; i = 1; : : : ; m; j = 1; : : : ; n xij 2 f0; 1g; i = 1; : : : ; m; j = 1; : : : ; n yj 2 f0; 1g; j = 1; : : : ; n 8 Facility location (alternative formulation) Since all variables are binary, the mn constraints xij ≤ yj; i = 1; : : : ; m; j = 1; : : : ; n can be replaced by the n constraints m X xij ≤ myj; j = 1; : : : ; n i=1 Alternative formulation n m n X X X min fjyj + cijxij x;y j=1 i=1 j=1 n X xij = 1; i = 1; : : : ; n j=1 m X xij ≤ myj; j = 1; : : : ; n i=1 xij 2 f0; 1g; i = 1; : : : ; m; j = 1; : : : ; n yj 2 f0; 1g; j = 1; : : : ; n 9 K-means and K-medoids clustering (1) (n) d Assume x ; : : : ; x 2 R . K-means Find partition S1 [···[ SK = f1; : : : ; ng that minimizes K X X kx(j) − µ(i)k2 i=1 j2Si where µ(i) := 1 P x(i); centroid of cluster i. jSij j2Si K-medoids Find partition S1 [···[ SK = f1; : : : ; ng and select (i) (j) y 2 fx : j 2 Sig; i = 1;:::;K to minimize K X X kx(j) − y(i)k2 i=1 j2Si 10 Best subset selection 1 p n×p n Assume X = x ··· x 2 R and y 2 R . Best subset selection problem: 1 2 min ky − Xβk2 β 2 subject to kβk0 ≤ k Here kβk0 := number of nonzero entries of β. Can you give an integer programming formulation to this problem? 11 Least median of squares regression 1 p n×p n Assume X = x ··· x 2 R and y 2 R . p Given β 2 R let r := y − Xβ Observe X 2 • Least squares (LS): βLS := argmin ri β i X • Least absolute deviation (LAD): βLAD = argmin jrij β i Least Median of Squares (LMS) βLMS := argmin(medianjrij): β Can you give an integer programming formulation for LMS? 12 How hard is integer programming? • Solving integer programs is much more difficult than solving convex optimization problems. • Integer programming is NP-hard. There are no known polynomial-time algorithms for solving integer programs. • Solving the associated convex relaxation (ignoring integrality constraints) results in an lower bound on the optimal value. • The convex relaxation may only convey limited information: I Rounding to a feasible integer solution may be difficult I The optimal solution to the relaxation can be arbitrarily far away from the optimal solution to the integer program I Rounding may result in a solution far from optimal 13 Techniques for solving integer programs Consider an integer program z := min f(x) x2X (Assume X includes both convex and integrality constraints.) Unlike convex optimization, there are no straightforward \optimality conditions" to verify that a feasible point x? 2 X is optimal. A naive alternative: find a lower bound z ≤ z and an upper bound z ≥ z with z = z. 14 Techniques for solving integer programs Consider an integer program z := min f(x) x2X Algorithmic template Find a decreasing sequence of upper bounds z1 ≥ z2 ≥ · · · zs ≥ z and an increasing sequence of lower bounds z1 ≤ z2 ≤ · · · zt ≤ z stop when zs − zt ≤ for some specified tolerance > 0: 15 Primal and dual bounds How can we find upper and lower bounds for the problem z := min f(x) x2X Primal bounds Any feasible x 2 X yields an upper bound f(x) ≥ z. In some problems it is easy to find feasible solutions but this is not always the case. Dual bounds Finding lower bounds poses a different challenge. They are often called \dual" for reasons that will become apparent soon. The most commonly used lower bounds are via relaxations. 16 Relaxations We say that the problem min g(x) x2Y is a relaxation of the problem min f(x) x2X if • X ⊆ Y • g(x) ≤ f(x) for all x 2 X Observe that the optimal value of a relaxation is a lower bound on the optimal value of the original problem. 17 Convex relaxations Consider the problem min f(x) x subject to x 2 C xj 2 Z; j 2 J n n where f : R ! R;C ⊆ R are convex and J ⊆ f1; : : : ; ng: Convex relaxation: min f(x) x subject to x 2 C 18 Lagrangian relaxations Consider a problem of the form min f(x) x subject to Ax ≤ b x 2 X If this problem is difficult, consider shifting some of the constraints to the objective: For u ≥ 0 consider the Lagrangian relaxation L(u) := min f(x) + uT(Ax − b) x subject to x 2 X Observe that L(u) ≤ z for all u ≥ 0. The best (highest) such bound can be obtained by solving the dual problem max L(u) u≥0 Observe that the dual is a concave maximization problem. 19 Lagrangian relaxation for facility location Recall the facility location problem n m n X X X min fjyj + cijxij x;y j=1 i=1 j=1 n X xij = 1; i = 1; : : : ; n j=1 xij ≤ yj; i = 1; : : : ; m; j = 1; : : : ; n xij; yj 2 f0; 1g; i = 1; : : : ; m; j = 1; : : : ; n Lagrangian relaxation: for unrestricted v n m n m X X X X L(v) := min fjyj + (cij − vi)xij + vi x;y j=1 i=1 j=1 i=1 xij ≤ yj; i = 1; : : : ; m; j = 1; : : : ; n xij; yj 2 f0; 1g; i = 1; : : : ; m; j = 1; : : : ; n 20 Lagrangian relaxation for facility location For each v, the Lagrangian relaxation L(v) is easily solvable: 1 if c − v < 0 and P (c − v )− + f < 0 x (v) = ij i ` `j ` j ij 0 otherwise 1 if P (c − v )− + f < 0 y (v) = ` `j ` j j 0 otherwise. This gives both a lower bound L(v) and a heuristic primal solution. Furthermore, the subdifferential of −L(v) is easy to compute. Thus we can use a subgradient method to solve max L(v) , min −L(v): v v 21 Branch and bound (B&B) This is the most common algorithm for solving integer programs. It is a divide and conquer approach. Let X = X1 [ X2 [···[ Xk be a partition of X. Thus min f(x) = min fmin f(x)g: x2X i=1;:::;k x2Xi Observe • A feasible solution to any of the subproblems yields an upper bound u(X) on the original problem. • Key idea: obtain a lower bound `(Xi) for each min f(x). x2Xi • If `(Xi) ≥ u(X) then we do not need to consider min f(x). x2Xi 22 Branch and bound algorithm Consider the problem min f(x) x subject to x 2 C (IP) xj 2 Z; j 2 J n n where f : R ! R;C ⊆ R are convex and J ⊆ f1; : : : ; ng: 1.