Mixed Integer Programming Class Library (MIPCL) Nicolai N. Pisaruk Belarus State University, Faculty of Economy, Nezavisimosty Av., 4, 220088 Minsk, Belarus April 20, 2016 Abstract The Mixed Integer Programming Class Library (MIPCL) is a free software designed for implementing mixed-integer programming models quickly, easily, and efficiently. Computational experiments show that currently MIPCL is one of the best noncommercial mixed-integer programming solvers. MIPCL libraries, documentation and examples are provided under the terms of the GNU Lesser Public License. Therefore, MIPCL is equally freely available for noncommercial and commercial use. 1 Introduction A mixed integer (linear) program (MIP) is an optimization problem with linear objective and linear constraints in which some of its variables are required to take on integral values. A wide variety of practical problems can be formulated as MIPs. For details on mixed integer programming, see, e.g., [12, 13, 11]. For decades from its introduction, mixed integer programming believed to be a powerful modeling tool that did not work in practice. The past twenty years has seen an impressive increase in the quality of software both commercial and noncommercial designed for solving MIPs. Today, with faster computers and better software, we can solve to optimality many classes of difficult practical MIPs. In general, noncommercial MIP solvers cannot match the speed and robustness of best commercial counterparts (CPLEX [7], GUROBY [6], Xpress-MP [5]), but they are a viable alternative for those users who cannot afford costly commercial software. At the same time, for practical applications of moderate size, the best noncommercial MIP solvers (SCIP [1], CBC [4], MIPCL [8]) are almost equally efficient as the best commercial solvers. 1
2 MIPL MIPCL is a tool for solving mixed integer programs (MIPs). It is completely implemented in C++. MIPCL can be used standalone as a shared object (dynamically linked library) in C++ projects; together with a modeling tool MIPshell; as an application for solving MIPs written in the MPS format. A detailed description of MIPCL can be found in the MIPCL Reference Manual [8]. MIPCL is implemented as a library of C++ classes. The main classes are CMIP and CLP. CMIP is a system for solving MIPs, and CLP is a system for solving linear programs (LPs). MIPCL supports MIPCL supports implementation of both branch-and-cut and branch-and-price algorithms, preprocessing (automatic reformulation), symmetry breaking, primal heuristics, cut/column generation, strong branching. The MIPCL API makes it easy for users to integrate optimization into their own application. The developer interface has been designed for maximum easeof-use. MIPCL is highly flexible through many virtual functions that allow developers to implement problem specific separation routines to apply problem specific cutting planes; column generation procedures; primal heuristics to search for feasible solutions with specific support for probing and diving; node selectors to guide the search; branching rules to split the problem into subproblems; preprocessing to simplify solved problems; managing the pool storing cuts and generated columns. MIPCL comes with clear, comprehensive documentation and examples to help you get started quickly. MIPCL also comes with many examples developed to ease using the MIPCL libraries. Since all the examples are available in source code, they are useful for teaching mixed-integer programming. 2
2.1 Multithreading Modern multi-core desktop computers provide parallel computing environments that allow MIP solvers work in parallel. Therefore, MIPCL has been redesigned to parallelize the tree search. Developing and debugging complex multithreaded applications is far from being a trivial task. When designing multithreaded MIPCL library, the main goal was not to add further difficulties. If you do not overload any MICLfunction in your application, then there is nothing to be bothered about: your application will run equally well both with singlethreaded and multithreaded libraries. But if in your application generates cuts or columns, implements some problem specific branching strategy. or simply overload any virtual function of the base class CMIP, in any derived subclass of CMIP, you have to implement the clone constructor and an interface that is used by MIPCL to create objects of this derived subclass. The clone constructor is called when a new thread is created. It is is very similar to the copy constructor except that the clone constructor does not allocates memory to store shared (with the created object) members of the cloned object. 2.2 Performance The MIPCL code was run with a limit of 2 hours on the MIPLIB2010 benchmark set (statistics of these problems can be obtained from the MIPLIB2010 website [9]) with the MIPLIB2010 scripts on the following platform: AMD FX8120, 8 cores, 8GB, 3.1GHz. In a consize form the results are given in the last column of Table 1. To compare MIPCL with its best counterparts (commercial and noncommercial), we use the results of tests conducted by H.Mittelmamm [10]. The following codes were run with a limit of 2 hours on the MIPLIB2010 benchmark set on different platforms: CPLEX: CPLEX-12.6.1 [7], GUROBY: GUROBY-6.0.0 [6], SCIPC: ug[scip/cpx]-3.1.1 (parallel development version of SCIP+CPLEX) [2], SCIPS: ug[scip/spx]-3.1.1 (parallel development version of SCIP+SOPLEX) [2], CBC: CBC-2.9.4 [3], XPRESS: XPRESS-7.8.0 [5]. We compare the MIPCL results with those for its counterparts obtained on the following platform: Intel i7-2600, 4 cores, 16GB, 3.4GHz, which performance is similar (and even assumed to be a little bit better) than the performance of the platform on which we tested MIPCL. GMRT stands for geometric mean of run times. 3
CBC CPLEX SCIPC SCIPS Gurobi XPRESS MIPCL Solved 61 86 72 67 86 86 82 Stopped 24 1 10 17 1 1 5 Failed 2 0 5 3 0 0 0 GMRT 17.4 1.05 8.19 12.7 1 1.3 4.1 Table 1: Results produced by MIP solvers 3 MIPshell modeling framework Anyone who has ever attempted to apply mathematical programming in practice knows that it is usually not a simple and straightforward exercise. Optimization programming languages are the tools that facilitates modelling and solving optimization problems. MIPshell is not an optimization programming language. It is just a framework designed to ease modelling and solving LPs and MIPs with MIPCL. MIPshell comprises collection of STL-based C++ classes that represent variables, constraints, sets, vectors, arrays, and etc.; library of functions to simplify posing optimization problems; preprocessor that translates new modelling operators into fragments of C++ code. Developing complex industrial applications, we need an API that supports writing GUI interfaces, working with databases, connecting to remote servers, and etc. None of the existing optimization programming languages supports implementation of all these requirements. On the other hand, modern development frameworks, such as Qt or Microsoft Visual Studio, have everything what is needed. One can easily incorporate MIPCL together with MIPshell into any of such frameworks. 3.1 Illustrative Example Let us consider the following MIP (f e y e + c e x e ) min, e E x e e E:t e=v e E:h e=v x e = d v, v V, 0 x e u e y e, e E, y e {0, 1}, e E, (1) wich is a formulation of the fixed charge network flow problem (see [13]). Here, G = (V, E) is a directed graph, and, for each e = (v, w) E, t e = v and h e = w are the tail and head nodes of arc e, u e is the capacity, and f e + c e x e is the 4
the cost of shipping x e > 0 units of product along e (if x e = 0, then nothing is paid). In MIPshell, (1) is written as follows: int e; VAR VECTOR x("x",real GE,E); VAR VECTOR y("y",bin,e); minimize(sum(e in E) (f(e)*y(e) + c(e)*x(e))); forall(v in V) sum(e in E: h(e)==v) x(e) - sum(e in E: t(e)==v) x(e) == d(v); forall(e in E) x(e) <= u(e)*y(e); optimize(); To help you get started quickly, MIPshell comes with clear, comprehensive documentation and a great deal of examples. Since all the examples are available in source code, they are useful for teaching mixed integer programming. References [1] T. Achterberg, SCIP: solving constraint integer programs. Math. Prog. Comp. (2009) 1: 1-41. [2] http://www.zib.de [3] J.J.H.Forrest, COIN branch and cut. COIN-OR., http://www.coin-or.org [4] COIN-OR. Computational Infrastructure for Operations Research. http://www.coin-or.org [5] Dash Optimization. Xpress-MP. http://www.dashoptimization.com [6] Guroby Optimization Inc. Guroby Optimizer. Software, 2012, http://www.guroby.com/welcome.html [7] IBM. IBM ILOG CPLEX Optimization Studio. http://www- 01.ibm.com/software/integration/optimisation/cplex-optimization-studio/ [8] MIPCL Reference Manual, Online 2015, http://mipcl-cpp.appspot.com/static/docs/mipcl/html/index.html [9] MIPLIB2010, http://miplib.zib.de [10] http://mittelmann@asu.edu [11] N.N. Pisaruk, Models and methods of mixed-integer programming. Belarus State University, 2010. 5
[12] M.Jürgen, T.Liebling, D.Naddef, G.L.Nemhauser, W.R.Pulleyblank, G.Reinelt, G.Rinaldi, L.A.Wolsey (eds.): 50 Years of Integer Programming 1958-2008. Springer, Berlin (2009). [13] L.A. Wolsey. Integer Programming. Wiley, 1998. 6