3

I have a Mixed Integer Programming problem(binary integer variables), how many variables can I solve, i.e, upper limit and what would be time taken?

The problem would have a utmost 5 constraints and a minimisation cost function, but variables are in the form of a matrix of m*n. So, the question is what could be the max values of m and n, also the time it would take to finish the computation?

Using standard software/libraries like COIN CBC, GLPK, CPLEX, GUROBI.

vitaut
  • 37,224
  • 19
  • 144
  • 248
Yashwanth Remidi
  • 131
  • 3
  • 10
  • If you have max 5 constraints, then what is `m` and `n`? – vcp Mar 16 '16 at 05:21
  • m * n is the decision variable matrix, not the constraints, I define the constraints and the solver solves the problem with m*n variables and gives me the best variables as a solution. What is the maximum size of m*n that the solver in market can solve? – Yashwanth Remidi Mar 16 '16 at 05:27

1 Answers1

1

Is it really possible to use the open-source/commercial solvers, available in the market, to solve it ?

Short answer : Yes it is possible to solve MIP with millions of decision variables.

Theory

In general MIP is NP-hard problem and cannot be solved in polynomial times O(n^k). Also it is NOT straightforward to determine what is input "n" in for MIP problem. Is it no. of rows, column or their product, nature of the matrix A, nature of decision variables, gap between MIP and relaxed LP?

If IP formulation ( Ax = b ), the matrix A is totally unimodular, and all coefficients are integers, then the solution of the LP relaxation is also a solution of IP, and thus the complexity of your problem is polynomial.

If not, then you should expect the problem to be NP-hard in the general case. As a thumb rule, the more variables and the more constraints, the harder is the problem.

Practice

MIP/LP Solvers can use various techniques/algorithms to solve any problem in reasonable amount of time (in hours), especially if you are not looking for "the" optimal integer solution and willing to accept solution close the optimal.

There is no fixed size limit — the Gurobi Optimizer routinely solves models with millions of variables and constraints, even on standard laptop and desktop computers. More importantly, you can see the results in Gurobi's performance, particularly on larger, more difficult models. In fact, Gurobi recently solved 11 models in the MIPLIB2010 library that had not previously been solved by any other solver.

Source: http://www.gurobi.com/products/gurobi-optimizer

Special MIP Problems

Special techniques are available to solve special instances of MIPs.

I wrote simple column generation algorithm to solve cutting stock problems. See https://github.com/vcphub/cspsol

Community
  • 1
  • 1
vcp
  • 972
  • 8
  • 15
  • Yeah, precisely, what I wanted to ask, I have a MIP problem which, I tried to solve using Excel and it maxed out after 200 variables(~50 mins ) but I would want to scale it to 1M+ decision variables(in about 2-3 hrs). Is it really possible to use the open-source/commercial solvers, available in the market, to solve it ? – Yashwanth Remidi Mar 16 '16 at 09:06
  • 1
    Yes it *may* be possible. But if you are using a free/open source solver you will have to get lucky to solve it 'out of the box'. If your problem has nice structure and nice numerical characteristics it may be OK. But it may not - I have a problem currently that has only about 27k integer variables, and CPLEX on a reasonable server cannot find an integer solution in 8 hours for some instances. If you are OK to implement some clever techniques with a solver (like column generation, Benders or VLNS) you may get better performance and solve larger problems. BTW: the Excel solver is very weak. – TimChippingtonDerrick Mar 16 '16 at 09:39
  • Yep, excel is the weaker option among the other commercial solvers, mine is a simpler problem of lower complexity but the data is just huge. I have a matrix of costs (A) and want to generate a binary integer matrix (B). So, I want to minimise AxB and the only constraint is sum of each row in variable matrix is , meaning only one value in the row should be **1** and others should be zero. – Yashwanth Remidi Mar 16 '16 at 09:52
  • are you working with bin packing problem? https://en.wikipedia.org/wiki/Bin_packing_problem – vcp Mar 16 '16 at 10:12
  • Nope. It is a order to store allocation problem. But I did work on bin packing too, which actually uses a binary search tree for efficient 2D packing. It is quite similar to the branch and cut method used for MIP. – Yashwanth Remidi Mar 16 '16 at 10:25
  • Have a look at this: http://stackoverflow.com/questions/27848828/mixed-integer-programming-warehouse-location-python-glpk – vcp Mar 16 '16 at 11:02
  • If only one binary variable can be 1 (rest zero) in a row and you have 5 rows, that looks to me like very doable thing, Just throw it at a good MIP solver and see what happens, You can try some out at [NEOS](https://neos-server.org/neos/solvers/index.html). – Erwin Kalvelagen Mar 16 '16 at 16:47
  • Thanks for the help, I am trying do the same now. I am going to use COIN-cbc and Gurobi(if possible), since they seem to be the best of the class for MIP. And, @ErwinKalvelagen the constraints are 5, not the rows. I have like a 1000 col and **4000** rows to the least – Yashwanth Remidi Mar 17 '16 at 05:19
  • Row is a different word for constraint – Erwin Kalvelagen Mar 17 '16 at 05:34
  • And column is a different word for variable. – Erwin Kalvelagen Mar 17 '16 at 05:41