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

Write constraint VRP ( i <>j) in C#

I have a VRP code in AMPL and want to write it in GUROBI-C#. Here is the constraint in AMPL: subject to cons2{j in customer}: sum{i in nodes: i<>j} x[i,j] = 1; and here is my code in C#, but it is still not working: //constraint 2 for (int j = 1; j…
0
votes
2 answers

Mixed Integer Programming IF-THEN with Logical AND operation

I have the following constraint I'm trying to model in Mixed Integer Programming with Python's PuLP module: Given linear programming variables: x1,x2,y1,y2 where x1, x2, y1, y2 eventually solve to integer values if (x1<=y2 and y1<=x2) then a=1 else…
0
votes
1 answer

Construction heuristics in binary integer programming

I have been trying for find answers to this question, but I cannot find anything comprehensive. I am looking to find an algorithm or heuristic to construct an initial feasible solution to the binary integer programming problems, more specifically…
0
votes
0 answers

Relaxing binary variable but having the same solution

I have this MIP optimization problem, with couple of binary variables; however when I relax one of the binary variables the optimal solution of the objective does not change. But the solving time increase drastically. How could this happen? I…
13554N
  • 37
  • 9
0
votes
2 answers

If condition in Integer Programming

I am solving an integer programming problem with the condition if a=0 then b=0 else b=1 where a is integer while b is binary I looked on previous question similar to this but could not find solution. please help to define constraint equation in…
0
votes
2 answers

Constraint in Linear Programming

I am trying to write a constraint for the problem: if a=>0, and b=>0, then a=b. So far, I have written, Let u >= a-b u >= b-a Now, I need to make sure that u = 0 if both a>0 and b>0, but cannot seem to figure it out. Can you guys please give me a…
novice
  • 545
  • 3
  • 16
0
votes
1 answer

Gurobi 7.0-How to Find the n Best Solutions to MILP?

I am using Gurobi 7.0 through Matlab. Based on the documentation, in order to find the n best solutions you need to set the parameters: PoolSearchMode=2, to find alternative optimal solutions in a systematic way. PoolSolutions=n, number of of…
Septimus G
  • 103
  • 1
  • 7
0
votes
1 answer

PuLP-OR: Can you delete variables already created?

My question is very simple. Is it possible to delete a variable that I have already created? Or my only hope is to not create the variable to begin with? I guess if you can print a variable then using: del prob.variable would delete it. But I can't…
0
votes
2 answers

If Then Constraints in non-linear programming

I have several constrains in a No linear problem. For example: In m(x+y-n)^2 If x+y-n>=0 Then m=0, Else m=1. How can I write this conditional constraint as linear or non-linear constraint?
0
votes
0 answers

lp_solve all optimal solutions

I am using the lp_solve java wrapper to find an optimal solution to an IP. Is there an easy way to find all solutions? Or do I have to add new constraints to rule out the current solution and re-solve?
Austen
  • 65
  • 7
0
votes
0 answers

Decision support system for supplier selection and order allocation

I wrote a small program to solve a problem i have but having trouble to scale it and could need some points/help. There are 3 matrices for data 1) Price of an item price = [ [11.5, 12.5, 10.75, 11.5], [19, 13.5, 12.85, 11.9], [1.95, 1.9,…
0
votes
1 answer

CPLEX not substituting equality correctly?

I am quite new to CPLEX and I am writing a very simple model that CPLEX does not want to satisfy. I know my model is "verbose" as I have variables that simply equal other variables, but it is my first step to a more complicated model so I want it…
0
votes
1 answer

CPLEX using LP file format: indicator constraints with boolean operators

I am completely new to CPLEX and far from an expert in MIP but I am trying to solve a problem with this technology (CPLEX 12.4). I ahve decided to create the MIP models in an .lp file and give it to CPLEx so I can have a plenty of inputs and test…
0
votes
1 answer

Python pulp optimizer with min absolute value

I'm using pulp (https://pythonhosted.org/PuLP/) for optimization purposes and get issue. I need to use constraint like abs(x) > MIN and I found solution here http://lpsolve.sourceforge.net/5.5/absolute.htm, I just create two constraints: x + M * B…
0
votes
3 answers

how to find all integer solutions to sum(xi) =b, with linear constraints

Suppose sum(xi) = 10, 0<= xi <= 2, i = 1, 2, ..., 10. How to find all integer solutions for xi. thank you. I have read about Euclidean algorithm, but it looks like just for two unknown variables. What algorithms can be used here.
daydayup
  • 2,049
  • 5
  • 22
  • 47