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
2
votes
2 answers

Python cvxopt glpk ilp return first feasible solution

I am using cvxopt.glpk.ilp to solve a very complicated Mixed Integer Program. I was wondering if there is a way to get the program to terminate after finding the first solution? It takes too long and a feasible solution would work fine for my…
GoBlue_MathMan
  • 1,048
  • 2
  • 13
  • 20
2
votes
1 answer

Two Dimensional Bin Packing

I am using the following Integer Programming Model for solving the Two Dimensional Bin Packing Problem. The following model illustrates the one dimensional version. The code I have written incorporates the constraints for the additional…
2
votes
1 answer

Solve Linear integer programming for petri nets in Java

Summary of my issue: I have system of linear equations out of a petri net like this (ILP): int[][] a = { {-1, 0, 0, 0}, {1, -1, 0, 0}, {1, 0, -1, 0}, {0, 1, 0, -1}, {0, 0, 1, -1}, {0, 0, 0, 1}}; …
Chris A.
  • 21
  • 4
2
votes
2 answers

Why using linear integer programming (ILP) though it is NP-Complete?

The question may be stupid but it really confuses me for a long time. I read a lot of papers in wireless sensor network. Many researchers model their problems into the form of ILP. However, ILP is NP-Complete so it is not efficient for solving a…
Ruisong
  • 33
  • 5
2
votes
4 answers

How to solve this ILP/CP matrix puzzle

I'm studying about algorithms and recently found the interesting challenge. It will give us some row/column, and our mission is to fill table with integer 1~N which displays only once and their row and column sums are equal to given row/column.…
2
votes
1 answer

Minimize image area while preserving a certain metric

I have a picture and I want to find the crop with the minimal area that at the same time retains a certain percentage of the edge energy. My take on this was to formulate this as a optimization problem and let scipy's constrained optimizers solve it…
2
votes
1 answer

Checking containment using integer programming

For this question, a region is a subset of Zd defined by finitely many linear inequalities with integer coefficients, where Zd is the set of d-tuples of integers. For example, the set of pairs (x, y) of non-negative integers with 2x+3y >= 10…
Winnie
  • 25
  • 2
2
votes
1 answer

Can this be expressed using Integer Programming or Constraint Programming?

Consider a fixed m by n matrix M, all of whose entries are 0 or 1. The question is whether there exists a non zero vector v, all of whose entries are -1, 0 or 1 for which Mv = 0. For example, [0 1 1 1] M_1 = [1 0 1 1] [1 1 0 1] In this…
Simd
  • 19,447
  • 42
  • 136
  • 271
2
votes
1 answer

How to change lp to mip when using CPLEX callable library

I've solved an lp using CPLEX callable library (in VS2010). The lp is the following: Maximize obj: x1 + 2 x2 + 3 x3 Subject To c1: - x1 + x2 + x3 <= 20 c2: x1 - 3 x2 + x3 <= 30 Bounds 0 <= x1 <= 40 End The code is given beneath.…
2
votes
1 answer

Library for solving knapsack-prblm(integer-programming)

I am trying to solve the knapsack-problem, which is also an integer-programming problem. I have looked at several approximate solutions like dynamic-programming, greedy algorithm, branch-and-bound algorithm, genetic algorithms. Can you tell me a…
Nishanth Reddy
  • 589
  • 2
  • 14
  • 27
2
votes
1 answer

Mixed integer programming with quadratic obj and quadratic constraints?

I was trying to use cplex for matlab to solve my optimization problem. However, It seemed to me that cplex was only able to solve PURE integer programming problem with quadratic objective function and quadratic constraints. Well I can certainly use…
user3075021
  • 95
  • 1
  • 8
2
votes
2 answers

MATLAB has crashed when using CPLEX API for linear programming

Hi I want to solve linear programming (LP) problem which has 25000 binary variables and almost 2555 equality constraints and 50 inequality constraints , so I used cplexbilp function which CPLEX API provided for MATLAB like…
oMiD
  • 322
  • 4
  • 20
2
votes
1 answer

Why does GLPSOL (GLPK) take a long time to solve a large MIP?

I have a large MIP problem, and I use GLPSOL in GLPK to solve it. However, solving the LP relaxation problem takes many iterations, and each iteration the obj and infeas value are all the same. I think it has found the optimal solution, but it won't…
abc
  • 211
  • 1
  • 3
  • 10
2
votes
1 answer

Maximising the benefit of a given scenario

I'm having trouble with a question given to us by my professor: A husband and wife are going on a trip and wish to maximise the benefit of bringing certain items with them. The husband can bring 20kgs and the wife can bring 17kgs. What should they…
Joe Austin
  • 557
  • 7
  • 24
2
votes
1 answer

Integer Programming unequal constraint

I am trying to model the following constraint in a MIP: x_1 +x_2 + ... +x_n != d The idea is to introduce a variable z that is 1, if x_1 +x_2 + ... +x_n = d and to add the constraint z <= 0. But I cannot figure out how to model the…
Christian
  • 1,308
  • 3
  • 14
  • 24