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
1
vote
2 answers

How to set gap when solving with cplex

I am writing code in c++ and calling CPLEX to solve it. It finds a very good solution quickly, but takes a very long time trying to improve it. So I want to set the gap to a larger value to terminate the code, and this is what I use: …
1
vote
2 answers

Pulp Matching algorithm to replace greedy algo

I am trying to create a matching algorithm using pulp but the results for the sample data I'm getting are wrong as I think the function is flawed. Sample data: users = { 1: (5.0, 4.0, 1.0, 2, 1, 1), 2: (8.0, 6.0, 2.0, 3, 2, 1) } dataset =…
Olivia
  • 814
  • 1
  • 14
  • 26
1
vote
1 answer

Solving an equation such that the solution is inetger

I have an equation y*8.57E-7 = x with the constraints: x>0 x should be an integer y should be an integer It might be solved with dynamic programming, but I am weak in analyzing it this way. For me the simple solution was to use brute force. But as…
1
vote
1 answer

Minimize AbsEquality rather than enforce in OrTools

I'm trying to solve the following using OR tools: Given the following bags containing different colors of balls: bag red blue green black A 10 5 85 0 B 25 50 25 0 C 0 100 0 0 D 90 5 5 0 E 2 0 98 0 F 0 0 0 100 How many of each…
Chris
  • 555
  • 2
  • 9
  • 28
1
vote
2 answers

How to obtain multiple solutions of a binary LP problem using Google's OR-Tools in Python?

I am new to integer optimization. I am trying to solve the following large (although not that large) binary linear optimization problem: max_{x} x_1+x_2+...+x_n subject to: A*x <= b ; x_i is binary for all i=1,...,n As you can see, . the control…
1
vote
1 answer

How to write constraint with sum of absolutes in Integer Programming?

I found a solution for just one term here. How can we formulate constraints of the form |x1- a1| +|x2-a2| + .... + |xn - an| >= K in Mixed Integer Linear Programming ?
1
vote
1 answer

How to convert the following if conditions to Linear integer programming constraints?

These are the conditions: if(x > 0) { y >= a; z <= b; } It is quite easy to convert the conditions into Linear Programming constraints if x were binary variable. But I am not finding a way to do this.
1
vote
1 answer

CVXPY error when trying to solve a convex minimization / binary programming problem

I'm trying to solve a problem that I submitted to QSE, https://quant.stackexchange.com/questions/65680/find-k-of-n-assets-that-minimize-the-correlation-matrix/, but I'm running into an issue using the cvxpy lib. Namely, what I believe to be a…
1
vote
1 answer

Integer problem is unbounded, but its linear relaxation not in CVXPY

Dears, I´m experimenting on CVXPY and have generated a simple Integer Program. For the sake of comparisson I´ve also generated a linear relaxation of it. But, when solving, I get a value for the relaxed problem (1.429). For the integer problem,…
1
vote
0 answers

Incorporate product of main and auxiliary variables in objective function

This is a follow-up question to a previous post. The problem I'm trying to solve is to find the largest combination of cells at the intersection of company and category with an average above a certain threshold. Additionally, if I include 3…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
1
vote
2 answers

What is the CP/MILP problem name for the assignment of agents to tasks with fixed start time and end time?

I'm trying to solve a Constraint Satisfaction Optimisation Problem that assigns agents to tasks. However, different then the basic Assignment Problem, a agent can be assigned to many tasks if the tasks do not overlap. Each task has a fixed…
1
vote
1 answer

Javascript algorithm for the Fixed-Charge Transportation Problem

I've already asked for the name of a problem in which we search for a certain matrix with given sums of each row and column in the Math…
Eduardo Poço
  • 2,819
  • 1
  • 19
  • 27
1
vote
1 answer

Implementing a constraint based on previous variable's value in GNU Mathprog/AMPL

I have a binary program and one of my variables, x_it is defined on two sets, being I: Set of objects and T: Set of the weeks of the year, thus x_it is a binary variable standing for whether object i is assigned to something on week t. The…
oakenshield1
  • 851
  • 1
  • 11
  • 26
1
vote
1 answer

Computing Irreducible Inconsistent Subsystem (IIS) using Julia JuMP (Gurobi)

Trying to compute IIS for my stupidly overcomplicated model. I'll include the whole model for clarity: using JuMP using Gurobi import XLSX roster = Model(Gurobi.Optimizer) Intern = 1:11 #i Week = 1:52 #k Rotation = 1:23 #j Leave_week =…
Chris Swan
  • 57
  • 8
1
vote
1 answer

How can I get the properties of a Gurobi's Presolve model?

I have an integer programming problem with linear objective function and some quadratic constraints. When I use Gurobi to solve this problem, Gurobi uses Presolve to create a Quadratically Constrained Integer Programming model. Now, I would like to…