Counting solutions of integer programs using unrestricted ... - OPUS 4

0 downloads 0 Views 364KB Size Report
In many applications it is, however, desirable (or even necessary) to generate all ... and software verification and discrete geometry. In this paper, we ... prune the integer program search tree and to collect several solutions si- ..... models in integer domains, in Theory and Applications of Satisfiability Testing –. SAT 2006, vol.
Konrad-Zuse-Zentrum für Informationstechnik Berlin

T OBIAS ACHTERBERG1 S TEFAN H EINZ T HORSTEN KOCH

Counting solutions of integer programs using unrestricted subtree detection

1

ILOG Deutschland, Ober-Eschbacher Str. 109, 61352 Bad Homburg, Germany

Supported by the DFG Research Center M ATHEON Mathematics for key technologies in Berlin.

ZIB-Report 08-09 (February 2008)

Takustraße 7 D-14195 Berlin-Dahlem Germany

Counting solutions of integer programs using unrestricted subtree detection Tobias Achterberg1 , Stefan Heinz2? , and Thorsten Koch2 1

ILOG Deutschland, Ober-Eschbacher Str. 109, 61352 Bad Homburg, Germany [email protected] 2 Zuse Institute Berlin, Takustr. 7, 14195 Berlin, Germany {heinz,koch}@zib.de

Abstract. In the recent years there has been tremendous progress in the development of algorithms to find optimal solutions for integer programs. In many applications it is, however, desirable (or even necessary) to generate all feasible solutions. Examples arise in the areas of hardware and software verification and discrete geometry. In this paper, we investigate how to extend branch-and-cut integer programming frameworks to support the generation of all solutions. We propose a method to detect so-called unrestricted subtrees, which allows us to prune the integer program search tree and to collect several solutions simultaneously. We present computational results of this branch-and-count paradigm which show the potential of the unrestricted subtree detection.

1

Introduction

In the last decades much progress has been made in finding optimal solutions to integer linear programs (IP) [6]. Recently, more attention has been given to the task of finding all feasible solutions to a given IP, since it arises in applications, for instance, in the context of hardware and software verification and the analysis of polyhedra (see De Loera et al. [9] and references therein). Furthermore, for IP problems that evolve from industry applications, it is desirable to find multiple or even all optimal solutions as discussed in [8]. A common way to solve IP counting or enumeration problems is to transform them into an equivalent binary representation and use specialized solvers. For Boolean satisfiability instances an algorithm for counting solutions is introduced in [13]. A method based on binary decision diagrams is stated in [4]. This algorithm is capable of counting or enumerating all feasible solutions of binary linear programs (BP), which are IPs containing only binary variables. Alternative methods for these type of problems are given in [7] and [10]. Both approaches make use of a search tree. The first one additionally uses linear programming (LP) relaxations to detect infeasible subproblems. ?

Supported by the DFG Research Center Matheon Mathematics for key technologies in Berlin.

2

Tobias Achterberg, Stefan Heinz, and Thorsten Koch

There are only few algorithms that count or enumerate all feasible solutions of a general IP and work on the integer variable space. In [8] a branch-andcut based algorithm is introduced which is able to generate multiple or even all (near) optimal solutions of a given IP (available in cplex). Setting the objective function to zero forces this algorithm to enumerate all feasible solutions. Another method which operates on the integer variable space is Barvinok’s algorithm [3]. This algorithm counts all lattice points inside a convex polytope in polynomial time when the dimension is fixed. In this paper, we introduce a branch-and-count method based on a branchand-cut framework to generate all solutions of a given IP. This method works on the integer domain. Furthermore, we state a technique called unrestricted subtree detection which collects several solutions simultaneously.

2

Problem definition

We consider integer programs (IP) of the form min{cT x | A x ≤ b, l ≤ x ≤ u, x ∈

R

R

Zn }

R

with A ∈ m×n , b ∈ m , and c, l, u ∈ n . Note that all variables are bounded and of integer type. We are addressing the task of computing the finite set XIP = {x | A x ≤ b, l ≤ x ≤ u, x ∈ n } of all feasible solutions of a given IP. ∗ We denote by XIP ⊆ XIP the set of all optimal solutions of the integer program, ∗ that is, XIP = argmin{cT x | x ∈ XIP }. If c = 0, both sets are equal. It is known that the above formulation is quite general. Maximization problems can be transformed to minimization problems by multiplying the objective function coefficients by −1. Similarly, “≥” constraints can be multiplied by −1 to obtain “≤” constraints. Equations can be replaced by two opposite inequalities. In the next section, we discuss an approach to compute XIP . With this ∗ method it is also possible to generate XIP . There are two natural ways to do ∗ this: one is to first compute XIP and subsequently XIP by only keeping those elements of XIP that minimize the objective function. The other possibility is to solve the underlying IP to optimality, add an additional constraint of the form cT x ≤ c∗ to the IP, with c∗ being the optimal value of the IP, and finally, ∗ compute the set XIP0 for the resulting IP0 . Obviously, XIP0 is equal to XIP .

Z

3

Branch-and-count approach

Currently, the most successful general technique to solve IPs (to optimality) is branch-and-cut using LP-relaxations. For a detailed description of the work-flow of branch-and-cut algorithms in general, we refer to Nemhauser and Wolsey [11]. Branch-and-cut algorithms can be adapted to enumerate all feasible solutions of a given integer program, by traversing the whole search tree and collecting all feasible solutions step-by-step. In this section we introduce a technique to speed up the enumeration process of a brach-and-cut based algorithm.

Counting solutions of integer programs using unrestricted subtree detection

3.1

3

Pruning by detecting unrestricted subtrees

The basic idea of our approach is to find a way to deduce and construct all solution vectors contained in a subtree. If this is possible, the whole subtree can be pruned without explicitly enumerating all leaves. The two most simple structures are subtrees which have no solutions and subtrees where any variable assignment constitutes a feasible solution. We call these subtrees infeasible subtrees and unrestricted subtrees, respectively. The infeasible subtree detection is also an issue for a standard branch-and-cut based algorithm focusing on optimal solutions. One way to improve infeasible subtree detection is conflict analysis, see [1, 12]. Unrestricted subtrees can be detected in the following way: at every node S in the search tree, it is checked whether each constraint is locally redundant, i.e., whether it is always satisfied in the local domains. Definition. A constraint is called locally redundant at subproblem S if it is satisfied by all possible variable assignments of values in the local domains at subproblem S. Lemma 1. The subtree at a node S of the search tree is unrestricted if and only if all constraints are locally redundant at node S. Proof. Let x be an arbitrary vector in the local domains of subproblem S. If all constraints are locally redundant, each constraint is satisfied by x and thus, x is a feasible solution. Hence, the subtree below node S is unrestricted. On the other hand, if the subtree below S is unrestricted, x must be feasible. Therefore, it satisfies each individual constraint. It follows that each constraint is locally redundant at node S. t u A similar observation was made by Morgado et al. [10] with respect to BPs. Their search algorithm detects feasible solutions if all constraints are locally redundant (through previous variable fixings). Additionally, they have to add so-called blocking clauses to prevent the algorithm to count the same solutions several times. Branch-and-cut based algorithms find feasible solutions without checking each constraint for locally redundancy. Therefore, the redundancy check has to be performed explicitly in every search node to find unrestricted subtrees. Example 1. Consider the following IP: min{0T x | x0 + x1 + x2 ≤ 2, x0 − x1 + x2 ≤ 1, x0 + x1 − x2 ≤ 1, x0 − x1 − x2 ≤ 0, x ∈ {0, 1}3 }. In Figure 1 we depict different branching possibilities for the root node. Only in the first case, where we branch on variable x0 , the resulting subproblems constitute an unrestricted and an infeasible subtree. More precisely, if variable x0 is fixed to zero, all constraints are locally redundant; setting variable x0 to one, leads to an infeasible subproblem.

4

Tobias Achterberg, Stefan Heinz, and Thorsten Koch infeasible solution x0 feasible solution 0 1

x1 0

unrestricted subtree

x0 assign- x 1 ments x

0

1

infeasible subtree

0 0 0 0 0 1 0 1 0 0 1 1

2

x2 1

1 1 1 1 0 1 0 1 0 0 1 1

0 1 0 1 0 0 0 0 0 0 1 1

0 1 0 1 1 1 1 1 0 0 1 1

0 1 0 1 0 0 1 1 0 0 0 0

0 1 0 1 0 0 1 1 1 1 1 1

Fig. 1. Possible branching decisions in the root node for Example 1. Table 1. Results for chip verification instances. Instance

basic approach |XIP |

time

1251 809 424 691 655 360 138 573 440 623 2 097 152 1294 260 096 901 100 980 1683 >68 749 M 53 264 241 407

12.9 16.8 18.2 33.0 4.5 1.6 >1800 >1800

Name Cons Vars veri1 veri2 veri3 veri4 veri5 veri6 veri7 veri8

1589 854 219 748 1631 1140 2123 43

3.2

Computational results

unrestricted subtree detection

nodes depth 1 618 847 1 310 762 1 146 948 4 194 319 520 207 201 959 >272 M >237 M

26 30 29 23 22 22 50 34

time

nodes depth

0.3 17 639 9.6 491 567 15.0 860 227 4.9 327 687 0.7 41 011 0.1 2 087 >1800 >111 M 77.1 4 316 909

unrest.

19 8 448 29 245 766 29 143 360 20 163 840 19 20 487 13 1 044 42 >55 684 k 31 2 122 366

We integrated the unrestricted subtree detection into the branch-and-cut framework scip (Version 1.00.5) [2]. As an LP-solver we used soplex 1.3.3 [14]. All computations presented in this section were run on computers with an Intel Core 2 Quad CPU with 2.66 GHz, 4 MB cache, and 4 GB of RAM. A time limit of 30 minutes was employed. Due to the lack of space we first restrict our self to 8 real-world instances which contain several ten-thousand solutions each. These instances arise from chip verification problems and have been provided by OneSpin Solutions1 . The results are given in Table 1. The first four columns contain the problem instance information, namely the name (“Name”), the number of constraints and variables (“Cons”, “Vars”), and the number of feasible solutions (“|XIP |”). Columns labeled with “basic approach” and “unrestricted subtree detection” report the individual results for the branch-and-count framework without and with unrestricted subtree detection, respectively; the first subcolumns report the running time in seconds, the total number of search nodes, and the maximum search tree depth. For the unrestricted subtree detection we further state the number of detected (non-trivial) unrestricted subtrees (“unrest.”). The unrestricted subtree detection leads to a substantial decrease in the number of needed search nodes. This comes along with a reduction in the total running time and the maximum depth level of the search tree. 1

www.onespin-solutions.com

Counting solutions of integer programs using unrestricted subtree detection

5

We also applied our method to the MIPLIB [5] instances that do not have ∗ continuous variables to compute the sets XIP of all optimal solutions. The generation of all optimal solutions can be performed in less than 5 minutes for each instance, except for cracpb1 and p2756. For p0548 the unrestricted subtree detection was necessary to solve the instance within the time limit. We compared our approach (scip) to existing methods, in particular azove [4], cplex [8], LattE [9], and zerOne [7]. Our approach clearly dominates the other solvers on the chip verification instances. For the MIPLIB instances the branch-and-cut based algorithms, i.e., cplex, zerOne, and scip, are similar in efficiency, while the other solvers are inferior.

References 1. T. Achterberg, Conflict analysis in mixed integer programming, Discrete Optim., 4 (2007), pp. 4–20. , Constraint Integer Programming, PhD thesis, TU Berlin, 2007. 2. 3. A. I. Barvinok, A polynomial time algorithm for counting integral points in polyhedra when the dimension is fixed, Math. Oper. Res., 19 (1994), pp. 769–779. 4. M. Behle and F. Eisenbrand, 0/1 vertex and facet enumeration with BDDs, in Workshop on Algorithm Engineering and Experiments (ALENEX), 2007. 5. R. E. Bixby, E. A. Boyd, and R. R. Indovina, MIPLIB: A test set of mixed integer programming problems, SIAM News, 25 (1992), p. 16. 6. R. E. Bixby, M. Fenelon, Z. Gu, E. Rothberg, and R. Wunderling, MIP: Theory and practice – closing the gap, in Systems Modelling and Optimization: Methods, Theory, and Applications, M. Powell and S. Scholtes, eds., Kluwer, 2000, pp. 19–49. 7. M. R. Bussieck and M. E. Lübbecke, The vertex set of a 0/1-polytope is strongly P-enumerable, Comput. Geom, 11 (1998), pp. 103–109. 8. E. Danna, M. Fenelon, Z. Gu, and R. Wunderling, Generating multiple solutions for mixed integer programming problems, in Integer Programming and Combinatorial Optimization, M. Fischetti and D. P. Williamson, eds., vol. 4513 of LNCS, 2007, pp. 280–294. 9. J. A. De Loera, R. Hemmecke, J. Tauzer, and R. Yoshida, Effective lattice point counting in rational convex polytopes, J. Symb. Comput., 38 (2004), pp. 1273– 1302. 10. A. Morgado, P. J. Matos, V. M. Manquinho, and J. P. M. Silva, Counting models in integer domains, in Theory and Applications of Satisfiability Testing – SAT 2006, vol. 4121 of LNCS, 2006, pp. 410–423. 11. G. L. Nemhauser and L. A. Wolsey, Integer and Combinatorial Optimization, John Wiley & Sons, New York, 1988. 12. T. Sandholm and R. Shields, Nogood learning for mixed integer programming, Tech. Rep. CMU-CS-06-155, Carnegie Mellon University, Computer Science Department, 2006. 13. M. Thurley, sharpSAT - counting models with advanced component caching and implicit BCP, in Theory and Applications of Satisfiability Testing – SAT 2006, vol. 4121 of LNCS, 2006, pp. 424–429. 14. R. Wunderling, Paralleler und objektorientierter Simplex-Algorithmus, PhD thesis, TU Berlin, 1996.