Preprocessing Complements of Operations Research Giovanni Righini Università degli Studi di Milano
Preprocessing Computational complexity theory classifies problems. However, when we run algorithms, this is because we are confronted with specific problem instances. The practical difficulty of solving a specific instance may well depend on its data, but it always depends on its size. Hence, before running any algorithm to solve a discrete optimization problem instance, it is often useful to pre-process it to possibly reduce its size.
Goals Pre-processing aims at: restricting bounds on variables; inserting constraints; fixing variables; removing redundant constraints; detecting infeasibility. This can be done repeatedly for all sub-problems generated in algorithms based on decomposition and implicit enumeration. Constraint programming is a discipline exploiting these techniques at their best.
Bounds tightening: example If we have a constraint y ux being y a continuous variable and x a binary variable, and we relax into x {0, 1} 0 x 1, it is important that u take the smallest possible value, i.e. the maximum value y can take in any feasible solution.
Bounds tightening: example y 1 +y 2 = 1.46 y 3 +y 4 = 0.72 y 2 y 3 +y 5 = 0 y 6 = 0.32 y 5 y 6 +y 7 = 0 0 y i Mx i i = 1,...,7 x i {0, 1} i = 1,...,7 From this system, we can derive: y 1 1.46x 1 y 2 1.46x 2 y 3 0.72x 3 y 4 0.72x 4 y 5 (1.46+0.72)x 5 y 6 = 0.32 y 7 (1.46+0.72+0.32)x 7
Constraints insertion: example Given the constraint a j x j b j with a j > 0 j and x j {0, 1} j, we can insert cover inequalities x j C 1 C : a j > b. j C j C Strengthening bounds and inserting constraints yield tighter formulations.
Variable fixing: example x 1 + x 2 1 x 1 +(1 x 2 ) 1 x 1, x 2 {0, 1} x 1 = 0
Redundant constraints detection: example 3x 2 2x 3 2 4x 1 3x 2 3x 3 6 2x 1 2x 2 + 6x 3 5 x B 3 We define x i = 1 x i i = 1,...,3. 3x 2 + 2x 3 3 x 2 + x 3 1 4x 1 + 3x 2 + 3x 3 4 2x 1 + 2x 2 + 6x 3 7 x 2 + x 3 1 x B 3 Therefore x 2 = 0, i.e. x 2 = 1.
Redundant constraints detection: example Therefore x 1 + x 3 = 1. And so on... +2x 3 3 redundant 4x 1 + 3x 3 4 x 1 + x 3 1 2x 1 + 6x 3 7 x 1 + x 3 1 x B 3 Fixing variables and removing redundant constraints yield smaller instances.
Preprocessing options State-of-the-art solvers have powerful pre-processing capabilities. They offer the possibility of turning pre-processing algorithms them on/off. Domain reduction for integer variables and constraint propagation are two main concepts developed and exploited in constraint programming algorithms. There are solvers based on constraint programming. They are especially useful when finding a feasible solution is difficult, because of many sets of constraints.
Elementary pre-processing techniques Given a mixed-integer problem, MIP) min{cx + hy : Ax + Gy b, x B n, y R m } with bounds l j y j u j j = 1,...,m where some of the y variables can be constrained to be integer-valued, we consider, one at a time, the constraints a j x j + a j x j + g j y j + g j y j b j B + i j B i j C + i j C i where a j > 0 j B + i a j < 0 j B i g j > 0 j C + i g j < 0 j C i We indicate the i th constraint with a i x + g i y b i.
Infeasibility If a i j 0+ a i j 1+ gj i l j + gj i u j > b i j B + i j B j C + i i then the problem instance is infeasible. j C i The minimum value the left-hand-side can take is too large.
Redundancy If a i j 1+ a i j 0+ gj i u j + gj i l j b i j B + i j B i then the constraint is redundant. j C + i j C i The maximum value the left-hand-side can take is small enough.
Bounds tightening Let define for each k = 1,...,m z i k = min{ a i j x j + a i j x j + gj i y j + gj i y j gk i y k}. j B + i j B i j C + i j C i It corresponds to the minimum value the left-hand-side of constraint i can take neglecting the term g i k y k. If k C + i we must have z i k + gi k y k b i for all feasible values of y k. Therefore we can set u k := min{u k, b i z i k gk i } Analogously, if k C i we can set l k := max{l k, zi k b i gk i }
Elementary probing techniques They consists in tentatively fixing a binary variable to 0 or to 1 and analyzing the consequences. They can lead to: variable fixing coefficients improvement.
Variable fixing Let define for each k = 1,...,n z i k = min{ a i j x j + a i j x j a i k x k + gj i y j + gj i y j}. j B + i j B i j C + i j C i If k B + i and z i k + ai k > b i, then we can fix x k := 0. If k B i and z i k > b i, then we can fix x k := 1.
Coefficients improvement Consider a variable index k B + i and define z i k = max{ a i j x j a i k x k + a i j x j + gj i y j + gj i y j} j B + i j B i j C + i j C i If z i k b i, then constraint i is redundant for x k = 0. Hence, when x k = 0 we can reduce both a i k and b i by an amount (slack) δ = b i z i k. This modification is valid also when x k = 1 because we subtract the same amount from both sides of the inequality. Therefore we can make constraint i tighter by setting: a i k := ai k δ b i := b i δ Analogously we can improve coefficients for k B i.
Computational complexity The bounds z i and z i can be computed in O(mn). Infeasibility: z i > b i Redundancy: z i b i Bounds tightening: u k > b i (z i g i k l k) g i k l k < (zi g i k u k) b i g i k k C + i k C i Variable fixing: z i + a i k > b i z i a i k > b i k B + i k B i z i a Coefficients improvement: i k < b i k B + i z i + a i k < b i k B i They are O(mn) tests. Each of them takes constant time.
Advanced preprocessing techniques They are similar to the elementary preprocessing and probing techniques, but they consider more than one constraint at a time. They are based on logical implications: by fixing a binary variable and running the elementary preprocessing techniques on the resulting constraint system, we can fix additional variables or strengthen the coefficients of other variables. These logical implications can be used for: Advanced probing Constraints insertion Variable elimination
Advanced probing We tentatively fix x k = 0 (or x k = 1) and we run the elementary preprocessing techniques. If the resulting instance is infeasible, then we can fix x k = 1 (or x k = 0). If a constraint i is redundant, then we can improve the coefficient of x k in constraint i.
Consider a logical relation Logical inequalities If x i = 1 then y j = v j where v j is a datum. The relation can be translated into linear inequalities in this way: { yj l j +(v j l j )x i y j u j (u j v j )x i This allows for automatic disaggregation of constraints. From an aggregated constraint like y j ( u j )x i j j we obtain logical implications If x i = 0 then y j = 0 j and therefore the disaggregated constraints y j u j x i j.
Clique inequalities A logical relation between two binary variables can be expressed as If x i = 1 then x j = 0 where each x can be a variable or its complement. The relation states that it is not allowed that both variables take value 1. We can define a graph (also called incompatibility graph) G = (B o, B c, E), where B o is the vertex set corresponding to the original variables, B c is the vertex set corresponding to their complement, E has an edge for each pair of incompatible variables. Every maximal clique C of G corresponds to a valid inequality x j + x j 1 j C o j C c where C = C o C c, C o = C B o and C c = C B c.
Clique inequalities Moreover, if there is only one variable index k C o C c, then { xj = 0 j C o, j k x j = 1 j C c, j k If, instead, there are two or more variable indices k C o C c, then the instance is infeasible.
Variable elimination If { xi = 0 y j = v j x i = 1 y j = v j then y j = v j. If { xi = 0 y j = l j x i = 1 y j = u j then y j = l j +(u j l j )x j. In these cases we obtain equality constraints and hence we can eliminate variables by substitution.
Probing on constraints We tentatively fix the value of the right-hand-side of an inequality constraint and we analyze the consequences. For instance, with a clique inequality j C x j 1 we can have two cases: either j C x j = 0 or j C x j = 1. If we fix j C x j = 1 and we obtain an infeasible instance, then we can set x j = 0 j C. If we fix j C x j = 1 and we find a redundant constraint i, then we can improve the coefficients of x j j C in constraint i.