Chap 10 Integer Prog Formulations q Mixed Integer

  • Slides: 30
Download presentation
Chap 10. Integer Prog. Formulations q Mixed Integer Programming Problem minimize c’x + d’y

Chap 10. Integer Prog. Formulations q Mixed Integer Programming Problem minimize c’x + d’y subject to Ax + By = b x, y 0 x integer q Integer programming problem: no continuous variables y q Zero-one (or binary) integer programming problem: no continuous variables y and x restricted to be 0 or 1 q Note that the feasible solution set is no longer convex compared to the linear programming problem. Powerful modeling tool, but usually difficult to solve. Linear Programming 2009 1

10. 1 Modeling Techniques q Binary choice Example: zero-one knapsack problem Given n items,

10. 1 Modeling Techniques q Binary choice Example: zero-one knapsack problem Given n items, j th item has weight wj and value cj. Given capacity of the sack is K. Select the items to carry in the sack which maximizes the total value. maximize j = 1, …, n cjxj subject to j = 1, … , n wjxj K xj {0, 1}, j = 1, … , n (only one constraint. typical case in resource allocation problems. Has many applications in theory and algorithms. ) Variations: integer knapsack problem, min form, precedenceconstrained knapsack. Linear Programming 2009 2

q Forcing constraints decision A can be made ( x = 1 ) only

q Forcing constraints decision A can be made ( x = 1 ) only if decision B also has been made ( y = 1 ) ( If y = 0 (decision B not made), then x = 0 (decision A cannot be made) x y, x, y {0, 1} Example: Facility location problem (uncapacitated) n potential facility locations, m clients who needs to be serviced from these locations. fixed cost cj of opening a facility at location j. cost dij of serving client i from facility j. Select a set of facility locations and assign each client to one facility , while minimizing the total cost. Linear Programming 2009 3

q Formulation minimize j = 1, …, n cjyj + i = 1, …,

q Formulation minimize j = 1, …, n cjyj + i = 1, …, m j = 1, …, n dijxij subject to j = 1, … , n xij = 1 , for all i xij yj , for all i, j xij , yj {0, 1}, for all i, j ( or i xij myj for all j ) yj = 1 if facility j is open, 0 otherwise. xij = 1 if client i is served by facility j, 0 otherwise. (or we may set 0 xij 1, and interpret it as the fraction of customer i’s demand serviced by facility j) Note that even without the binary constraints on xij , each client will be served entirely from a location which can serve it most cheaply. Then the meaning of xij is changed as the fraction of client i’s demand satisfied from facility j. Linear Programming 2009 4

q Relations between variables Generalized upper bound constraints (GUB constraints) j = 1, …

q Relations between variables Generalized upper bound constraints (GUB constraints) j = 1, … , n xj 1 xj {0, 1} Linear Programming 2009 for all j 5

q Disjunctive constraints at least one of two constraints (a’x b, c’x d) needs

q Disjunctive constraints at least one of two constraints (a’x b, c’x d) needs to be satisfied. Let M be a sufficiently large number a’x b - My, c’x d - M(1 – y) y {0, 1} In the text, following form is used assuming a, c 0 and x 0. a’x yb, c’x (1 – y)d y {0, 1} q Note that the feasible solution set is not convex for disjunctive constraints. Extension for more than 2 constraints. Linear Programming 2009 6

q Restricted range of values x { a 1, a 2, … , a

q Restricted range of values x { a 1, a 2, … , a m } x = j = 1, …, m ajyj j = 1, …, m yj = 1, yj {0, 1} Linear Programming 2009 7

q Arbitrary piecewise linear cost functions f(x) x = i = 1, … ,

q Arbitrary piecewise linear cost functions f(x) x = i = 1, … , k i ai f(x) = i = 1, … , k i f(ai) 0 a 1 1 Linear Programming 2009 a 2 y 1 2 a 3 y 2 3 a 4 y 3 x 4 8

minimize i = 1, … , k i f(ai) subject to i = 1,

minimize i = 1, … , k i f(ai) subject to i = 1, … , k i = 1 , 1 y 1 , i yi – 1 + y i , i = 2, … , k – 1 k yk - 1 , i = 1, … , k-1 yi = 1 , i 0 , yi {0, 1} Linear Programming 2009 9

Ø Alternative formulation f(x) c 4 c 2 c 3 c 1 K x

Ø Alternative formulation f(x) c 4 c 2 c 3 c 1 K x OR-1 2009 L 1 L 2 L 3 (x 1) (x 2) (x 3) 10

Formulation: Want to express x as x = x 1 + x 2 +

Formulation: Want to express x as x = x 1 + x 2 + … + xk Ljwj xj Ljwj-1 j = 1, 2, … , k w 0 = 1 wj {0, 1} j = 1, 2, … , k xj 0 j = 1, 2, … , k Ø note that we have wj wj-1 for j = 1, 2, … , k. If wj = 0 for some j wk = 0 for k j+1 If wj = wj-1 = 1 xj = Lj If wj = wj-1 = 0 xj = 0 If wj = 0, wj-1 = 1 0 xj Lj Ø Write the piecewise linear function as K + c 1 x 1 + c 2 x 2 + … + ckxk. OR-1 2009 11

q Set covering, set packing, set partitioning problems M = { 1, … ,

q Set covering, set packing, set partitioning problems M = { 1, … , m}, N = { 1, … , n} M 1 , M 2 , … , M n M weight cj for each Mj F N is a cover of M if j F Mj = M F N is a packing of M if Mj Mk = for all j, k F, j k. F N is a partition of M if it is both a cover and a packing of M. Find a cover F of minimum weight. Find a packing F of maximum weight. Find a partitioning of (min, max) weight. Linear Programming 2009 12

q A : m n, (0, 1) matrix if i Mj Let aij =

q A : m n, (0, 1) matrix if i Mj Let aij = 1 , 0, otherwise define xj = 1 if j F. ( i. e. Mj is selected) 0, otherwise constraints Ax e , Ax = e, where e is an m-dimensional vector with all components equal to 1. q Has many practical applications in scheduling, graphs, . . . Linear Programming 2009 13

q Boolean Quadratic Function min f(x) = i = 1 n dixi + i,

q Boolean Quadratic Function min f(x) = i = 1 n dixi + i, j, i j cijxixj , xi {0, 1} for all i Let yij = xixj min i = 1 n dixi + i, j, i j cijyij xi + xj – yij 1 -xi + yij 0 -xj + yij 0 for all i, j, i j xi, yij {0, 1} for all i, j q constraints ensure that yij = 1 xi = 1, xj = 1 Linear Programming 2009 14

q Ex: quadratic knapsack problem, max cut of a graph, lift-and-project algorithm for 0

q Ex: quadratic knapsack problem, max cut of a graph, lift-and-project algorithm for 0 -1 IP. q Def: Given a graph G = (V, E), and subset S V of vertices, the set of edges with exactly one endpoint in S is called a cut (relative to S). q Given G = (V, E), and edge weights cij, e = (i, j) E, find a maximum weight cut of G. max (i, j) E cij ( xi(1 -xj) + (1 -xi)xj ) xi {0, 1} for all i (may add constraint x 1 = 1 ) q Note: max cut problem is difficult to solve (NP-hard), but min cut problem is easy (max-flow min-cut theorem). Linear Programming 2009 15

10. 2 Guidelines for strong formulations q Time to solve LP generally depends on

10. 2 Guidelines for strong formulations q Time to solve LP generally depends on the number of constraints (m) and the number of variables (n). q Empirically, number of iterations in simplex method: O(m), O(log n) Each iteration: O(m 2) q However, for integer programming problems, running time is usually exponential (NP-hard problems) of the problem size and very erratic. q Strong formulation is important. A formulation which describes the feasible integer points closely is desirable. (Why? ) Linear Programming 2009 16

q Branch-and-Bound Algorithm for IP (IP) minimize subject to c’x Ax b x 0

q Branch-and-Bound Algorithm for IP (IP) minimize subject to c’x Ax b x 0 and integer q Let z. IP be the optimal value of IP and z. LP be the optimal value of the LP relaxation of IP, i. e. problem with integer requirement dropped. Then z. LP z. IP holds, i. e. z. LP provides a lower bound on z. IP. Usually upper bound can be obtained from a feasible solution. If lower bound = upper bound, then optimal. q If LP relaxation gives an integer optimal solution, then it is optimal. Otherwise, divide the feasible solution set of IP into two (or more) disjoint subsets and continue to solve the LP relaxation for each subset. Linear Programming 2009 17

q Ex: 0 -1 IP Let S be the set of feasible solutions to

q Ex: 0 -1 IP Let S be the set of feasible solutions to IP. If xj* = , 0 < <1, in an optimal solution x* to LP relaxation, divide S into two sets S 1, S 2, where S 1 = S { x: xj = 0}, S 2 = S { x: xj = 1}. Then solve LP relaxation for S 1 and S 2 respectively. q Important tool to facilitate search: If we have current best integer solution (incumbent) with value z 0 and LP relaxation of a subproblem gives value z’ with z 0 z’, then the subproblem does not include a better solution than the current incumbent and the subproblem can be pruned. Therefore, if we can find a strong lower bound (high value), it is more likely that the subproblem can be pruned earlier in the search procedure, hence mitigating the need to seach the subproblem further (prevent the explosion of the search tree). Linear Programming 2009 18

q Why strong formulation? Let P 1, P 2 be the set of feasible

q Why strong formulation? Let P 1, P 2 be the set of feasible solutions to the LP relaxation of two different formulations. ( P 1 P 2, S P 1, S P 2 ) Then the optimal values of the LP relaxations of the two formulations give z. P 2 zp 1. Thus formulation for P 1 gives stronger bound. ex) formulations for the facility location problem P 2 P 1 Linear Programming 2009 19

10. 3 Modeling with exponentially many constraints q Minimum spanning tree problem Graph G

10. 3 Modeling with exponentially many constraints q Minimum spanning tree problem Graph G = (N, E), |N| = n, |E| = m Edge weight ce , e E Find min weight spanning tree. (Recall Kruskal, Prim’s alg. ) Tree : connected acyclic graph (spanning tree: all nodes of G included in the tree) Forest: acyclic graph A spanning tree has n – 1 edges and connected ( iff condition) Linear Programming 2009 20

Linear Programming 2009 21

Linear Programming 2009 21

q For S N, define E(S) = { ( i, j ) E :

q For S N, define E(S) = { ( i, j ) E : i, j S } (S) = { ( i, j ) E : i S, j S} ( cut defined by S) q Subtour elimination formulation (no subtour allowed) minimize e E ce xe subject to e E x e = n – 1 e E(S) xe |S| - 1 , S N, S , N, xe { 0, 1 }. Has exponential number of constraints ( 2 n – 1 ) Linear programming relaxation can be obtained by replacing xe { 0, 1 } with 0 xe 1. If not have e E xe = n – 1, obtain formulation for min weight forest (negative arc costs may be allowed) Linear Programming 2009 22

q Cutset formulation ( use connectedness) Use e (S) xe 1 , S N,

q Cutset formulation ( use connectedness) Use e (S) xe 1 , S N, S , N. q Comparing two formulations: The polyhedron of LP relaxation of subtour elim. formul. is properly contained in the one for cutset formulation, hence it is better. It can be shown that LP relaxation of subtour elim. formul. gives integer optimal solutions. q Why consider IP formulation although there exist good algorithms? Algorithms fail if problem structure changed a little bit: degree constrained spanning tree problem, Shortest total path length spanning tree problem, Steiner tree problem, capacitated spanning tree problem, … Linear Programming 2009 23

q Traveling salesman problem (undirected) Undirected graph G = (N, E), edge cost ce

q Traveling salesman problem (undirected) Undirected graph G = (N, E), edge cost ce , e E Find a minimum cost tour Cutset formulation minimize e E ce xe subject to e ({i}) xe = 2 , i N e (S) xe 2 , S N, S , N, xe { 0, 1 }. Linear Programming 2009 24

q Subtour elimination formulation minimize e E ce xe subject to e ({i}) xe

q Subtour elimination formulation minimize e E ce xe subject to e ({i}) xe = 2 , i N e E(S) xe |S| - 1 , S N, S , N, xe { 0, 1 }. q LP relaxations of both formulations give the same solution set. Linear Programming 2009 25

Remarks q For directed version of the TSP problem, the following formulation is possible,

Remarks q For directed version of the TSP problem, the following formulation is possible, which is smaller in size. But it is a bad formulation. (refer exercise 10. 15 in text page 477) ui – uj + nyij n – 1 , ( i, j ) A, i, j 1, { i : ( i, j ) A} yij = 1 , j N { j : ( i, j ) A} yij = 1 , i N yij { 0, 1 }, i, j N q Note that, uj’s are continuous variables in the above formulation. q Undirected TSP is a special case of directed case, we may replace each edge by two directed arcs with opposite direction and having the same costs as the edge. Linear Programming 2009 26

q Is the formulation correct? The formulation has u, y variables. If (u*, y*)

q Is the formulation correct? The formulation has u, y variables. If (u*, y*) feasible, we only read y* values ( projection of (u*, y*) to y space) We need to show that (1) any tour solution y* satisfies the constraints and (2) any non-tour solution does not satisfy the constraints. (1) For any tour y*, if node i is k-th node in the tour, assign ui = k. (2) If y* is 0, 1 and satisfies degree constraints, it is either a tour or consists of subtours. If subtours exist, there is one that does not include node 1. Add the constraints ui – uj + nyij n – 1 along the arcs in the subtour. Linear Programming 2009 27

q Comparing the LP relaxation of the cutset formulation (say A) (in directed case

q Comparing the LP relaxation of the cutset formulation (say A) (in directed case version) and the LP relaxation of the previous formulation (B): It can be shown that the projection of the polyhedron B onto y space gives a polyhedron which completely contains A (the inclusion can be strict), hence cutset formulation (or subtour elimination formulation) is stronger. ( Let P = {(x, y) Rn Rp : Ax + Gy b}, then Projx (P) = { x: (x, y) P for some y} ) q Although the previous formulation is not strong, it can be an alternative to use if you only have a generic IP software to use, not the sophisticated one to handle the subtour elimination constraints. Linear Programming 2009 28

How to Solve the LP relaxation of the Cut-Set Formulation? (many constr. ) Solve

How to Solve the LP relaxation of the Cut-Set Formulation? (many constr. ) Solve LP relaxation (w/o cut-set constraints) If y* tour, stop. O/w find violated cut-set? Solve LP after adding the Cut-set constraint. Y N Stop Linear Programming 2009 29

q If the obtained solution is not a tour, branch and apply the same

q If the obtained solution is not a tour, branch and apply the same procedure again. Choose the best solution q Branching : If xij* 0, 1, solve two subproblems after setting xij = 0, and xij = 1. q Branch-and-cut approach ( cutting plane alg. ) q Ideas for TSP formulation can be used for various routing, sequencing problems. q Branch-and-cut Ideas useful to solve many difficult IP problems. q What can we do for the LP with many variables? For the LP with many vars. and constraints? q TSP site: http: //www. tsp. gatech. edu/ Linear Programming 2009 30