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
1 answer

How to mod a LpVariable with int?

I am doing linear programming with pulp in Python. And here is one of my constraints: pulp is a third-party pack. from pulp import * x1 = LpVariable('x1', 1, 5, cat='Integer') x2 = LpVariable('x2', 2, 6, cat='Integer') prob += x1 % 3 != x2 %…
Yuan
  • 23
  • 4
0
votes
1 answer

Problem with binary decision variable constraints in VRP

I would like to create non-linear violation costs in my VRP. I already created my whole VRP with time windows in which I have these decision variable: dvar float+ w[N][D]; // violation time for late arrivals for every node and every day These dvars…
Jeroen
  • 1
  • 1
0
votes
1 answer

How to get the number of cuts and the actual cuts that have been added to SCIP using a conshdlr in C++

My scip solution log is showing that the number of cuts that have been added are 10 but when I try to get the number using SCIPgetNCuts(scip) I always get 0. In addition to this, is there a way to get all the cuts that have been added into a…
Morpheus
  • 3,285
  • 4
  • 27
  • 57
0
votes
1 answer

TypeError: can't multiply sequence by non-int of type 'list_iterator' in docplex

Solving 0-1 integer programming problem using docplex solver in python. T_1_d = int((180+8*15-lon-math.acos(math.tan(10547*(math.pi)/81000*math.cos(2*(math.pi)*(date+9)/365))*math.tan(lat*(math.pi)/180))*180/(math.pi))/15) T_1_d1 =…
0
votes
0 answers

Is this an issue with pre-solve or how AMPL uses arrays?

I am modeling a production problem in AMPL with start and end inventories to be zero. Simple 3 products being produced over 4 day span, on a single machine. however my model keeps having problems with the bigM constraint and no inventory is…
0
votes
1 answer

Cplex Error: Adding trivial infeasible linear constraint

I want to solve an integer programming model with cplex python. I have this model: a and h are matrixes with 0s and 1s. p is a set of numbers. here is a part of my cplex code for this model: p=[i for i in range…
0
votes
1 answer

Minizinc error: invalid type-inst: expected `float', actual `var float'

I have the following Minizinc program which is a work in progress towards being a solution for the Traveling Salesman Problem (TSP). I know it's missing more than just fixing this error, but I would still like to understand why I'm getting this…
0
votes
0 answers

Is there a way for GAMS interruption and re-run from where it lasted?

If I have 5 hours to wait for GAMS result on Monday and 3 hours on Tuesday, and if I know that the model will be solved after 8 hours first run, is there a way to interrupt GAMS on Monday after 5 hours and run again on Tuesday from where it stopped…
0
votes
1 answer

Inequality Constraint x Upper Bound Definition on Variable Declaration

Which is more computationally efficient for a Mixed-Integer Problem Formulation: a. State the upper and lower bounds of the variables when declaring the variable b. Declare the variables with the solver default bounds and then imposing inequality…
0
votes
1 answer

Translate from lpSolve to lpSolveAPI Package

The goal: Use current lpSolve code to create a new code using the lpSolveAPI package. The background: I have been using lpSolve to find an optimal solution, for purposes of creating fantasy sports contest lineups, which maximizes the projected…
0
votes
1 answer

Team Allocation Optimisation with PuLP

Background: I am trying to allocate students to teams where each student will have a series of preferences to other students being in their teams. I have an objective function which I want to minimise along with 3 constraints for the function…
0
votes
1 answer

Remaining with Integral relaxed integer linear programming

When i relax my binary integer program (0,1) to LP (0< =x <=1), the solution seizes to be optimal since some of the x values are fractional. Is there a way i can relax and still get an optimal solution. Thanks
David
  • 1
  • 2
0
votes
1 answer

Matlab use fminsearch to optimize a interval of numbers

In Matlab I want to use fminsearch to optimize a interval of numbers given a object function fun to minimize. The integer numbers can be selected from 1 to 30, and the number of integers is fixed to 5 for now. Assume the step size is 1. It will…
SimaGuanxing
  • 673
  • 2
  • 10
  • 29
0
votes
1 answer

Pulp writing proper constraints to produce feasible solution

I'm trying to model selection of 15 players for specific number of fixtures. My LpProblem consists of 2 binary variables player and fixture. choices = LpVariable.dicts( "Choices", (fixtures, constraints["player"]), 0, 1, LpBinary) I…
Rolfrider
  • 97
  • 1
  • 8
0
votes
1 answer

Solution not Feasible in Linear Programming in Python Gurobi

This is continuation of this thread. I am coding MILP using Gurobi in Python where the objective is to maximize the rewards while ensuring the distance constraint is not violated. I am however getting solution is infeasible. I tried the IIS but it…
gfdsal
  • 651
  • 1
  • 8
  • 25