Questions tagged [integer-programming]

Solving systems of linear equations where variables are integers.

An integer program is a problem where, in addition to the linear inequalities constraints, the variables are also constraint to be integers only.

While can be solved in polynomail time, integer-programming is NP-hard.

A good solver for such optimization problems is lp_solve. See also GLPK (http://www.gnu.org/software/glpk/) and CBC (https://projects.coin-or.org/Cbc)

However, for large or hard instances you may need a commercial solver such as CPLEX or Gurobi.

For more information see wikipedia.

307 questions
5
votes
0 answers

CVXOPT: solving a simple integer linear programming program

I am using CVXOPT to solve a very simple problem: min -7890424934354.171875*x1 -7890424934354.274414*x2 -7890424934354.246093*x3 s.t: x1 + x2 + x3 = 1 x1,x2,x3 are binary We can see that the optimal solution should be obviously: x1 =0; x2 = 1;…
Sue
  • 113
  • 1
  • 9
5
votes
1 answer

specifying tolerance for GLPK solver in PuLP Python

I am running PuLP Programming Library in Python 2.7.8, Windows 32 bit. I'm using GLPK as my solver for a mixed integer linear programming problem. The solver converges to approx. 1% of the optimal quickly, however time to compute the exact optimal…
Akhil
  • 53
  • 1
  • 5
5
votes
2 answers

Set partitioning with constraints java

The what I'm attempting to produce an optimum set of brackets (optimum defined by constraints) for a tournament. The problem I don't know how to approach the problem. This paper is pretty high level but discusses the possibility of solving set…
4
votes
3 answers

Integer programming: Is it possible to define an incompatibility constraint?

I'm using jsLPSolver to solve an integer-programming problem. I'm having trouble adjusting the model to contain incompatibility constraints. I've got the following model: { "optimize": "cost", "opType": "min", "constraints": { …
tetri
  • 3,753
  • 2
  • 25
  • 37
4
votes
0 answers

How to solve a facility location allocation (IP) problem in CVXPY

I am learning to solve optimization problems using CVXPY, so I started with the following simple facility location allocation problem. The Code in CVXPY is given as: Fi = np.array([1,1,1]) # Fixed cost of each facility Ci = np.array([15, 10,…
4
votes
2 answers

Determining whether an integer program is infeasible

Suppose we have an integer or mixed-integer program with a couple of thousand of constraints. How can we determine whether this IP / MIP is feasible?
4
votes
1 answer

Gurobi, How to change a continuous variable to a binary variable

I am using gurobi-python interface. Is there anyway to convert a continuous variable to a binary variable. I just do not want to convert m.addVar(lb=0, ub=1, vtype=GRB.CONTINUOUS) to m.addVar(lb=0, ub=1, vtype=GRB.BINARY). I have to do it in…
user2512443
  • 485
  • 1
  • 6
  • 20
3
votes
1 answer

Integer division in Mixed Integer Linear Programming

What is a solver friendly way of encoding integer division in MILP programs? Currently I'm using the following encoding (in Gurobi python), which may not be totally correct and I hope not that optimal. # res is an integer variable in the solver #…
3
votes
1 answer

Is there any way to improve speed of or-tools?

I'm trying to use or-tools to solve an MIP problem. It could run quite fast with small Number and Range, you may treat them as number of variables and number of constraints. But for larger values, it runs slower and sometimes even can't get the…
3
votes
1 answer

How to count distinct number of decision variables - Linear programming

I have 5 decision variables (say) x1 - x5, lower bound for each = 5, and upper bound for each = 30 and they are allowed to take only integer values. These decision variables are leveraged to calculate gross margin (via some function), and objective…
3
votes
0 answers

How to control ordering of Matlab *optimproblem.Variables*

Matlab's optimproblem class of objects allows users to define an Integer Linear Program (ILP) problems using symbolic variables. This is dubbed the "problem-based" formulation. Internal methods takes care of setting up the detailed ILP formulation…
3
votes
1 answer

Why does Matlab's `intlinprog` return near-integers for integer variables?

My background is not linear programming. I am delving into Matlab's Mixed Integer Linear Programming (intlinprog), motivated by the aim to apply it properly rather than advancing the science of the underlying engine. According to the intlinprog…
user36800
  • 2,019
  • 2
  • 19
  • 34
3
votes
1 answer

Constraints Added by docplex.mp.model.add_if_then Cause Read Error by CPlex

I'm using docplex to build up a mixed integer program which is then solved via cplex. However, upon trying to solve the MIP I receive the following error: CPLEX> read plan.lp CPLEX Error 1434: Line 184224: Couldn't convert '1<->' to a number. No…
3
votes
1 answer

Integer Programming in R Using Genalg

I'm trying to solve a problem in R using the package genalg, specifically this package because I need a GA package that is understandable. The problem is that I must build fire stations near cities, but I'm aiming for the minimum amount of…
3
votes
2 answers

block of consecutive variables to have same value in mixed-integer linear programming

I am trying to model the operation of a system component, the component will have two operating modes, let's call them 1 and 2, plus the idle mode 0 There is no limit on idling, but each operating mode will last for exactly 3 time-series points, so…
1
2
3
20 21