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

Reducing solution space by predefining decision variables

is it possible to Reduce the solution space of an optimization problem by predefining decision variables. by doing so i am trying to decrease the solution time of an integer LP model. to be more clear: let's say my solution will be 3*3 matrice of 1s…
0
votes
1 answer

Solving Knapsack Problem for large dataset using PULP library in Python

I have the below dataframe: import itertools import pandas as pd import numpy as np p1_values = np.arange(19, 29.1, 0.1) p2_values = np.arange(23, 33.1, 0.1) p3_values = np.arange(36, 46.1, 0.1) p1_values = np.arange(19, 29.1, 0.1) p2_values =…
0
votes
0 answers

MILP - How to set variable to be absolute value of other variable

In a Milp, given an integer variable x, I would like to define a variable y which will be the absolute value of x. y = |x| x is bounded between [M, -M]. Is it even possible? Thank you!
0
votes
0 answers

Create constraint when variable is within a given range Pyomo

What is the best way to specify whether a given variable is within a given range in Pyomo? Here I have a binary decision variable assign[t, e] which I want to fix it 0 when t is within some range specified as below. I read that this might not be the…
0
votes
1 answer

How to get all solutions for an integer program in ortools?

I am trying to get all solutions for a Mixed Integer program through ortools. I have two lists x and y of size 4. I want to get all solutions which satisfy sum(x) = 4 * sum(y). I created a function which takes list of past solutions as input and…
0
votes
1 answer

Constraint 'feasibility_cut[1]' does not have a proper value. Found 'True'

I'm new to python and pyomo, so I would kindly appreciate your help, I'm currently having trouble trying to add a constraint to my mathematical model in Pyomo, the problem is while I try to add the "feasibility_cut", it says "Constraint…
0
votes
1 answer

lpSolve constraint for choices of start and length of shifts

I have a finite number of staff N, and I need to find an optimal schedule (using the least number of staff) meeting the demand Hour of Day Demand 0 d0 1 d1 ... ... 23 d23 where the d0, d1, ..., d23 are real numbers denoting the…
0
votes
1 answer

Julia-Jump Integer Programming Optimization model: issue with multiplying matrix by vector

I have written an optimization model that has 3 binary decision variables that are all in matrix form (X[p,s], Y[a,s], and Z[a,p]). a=associate, p=process, and s=station. I have encountered an issue with coding a constraint for my Z variable. Z is a…
0
votes
1 answer

Truck Type (infinite number of them) vs Orders

The goal of the docplex model below is to choose the trucks with total minimum cost to fulfill all orders. I treat the truck type as 1 truck in the following code, but in fact, a truck type can have infinite number of truck, in that case, how should…
william007
  • 17,375
  • 25
  • 118
  • 194
0
votes
0 answers

Fastest way to solve non-negative linear diophantine equations

Let A be a list of n lists of m non-negative integers, such that for all j there is i with A[i][j] nonzero. Let V be a list of m positive integers. Question: What is the fastest way to find all the lists X of n non-negative integers such that for…
0
votes
1 answer

How to Convert or Solve a Non-Linear Optimization Problem with Non-Linear Objective Function & Constraints

Overview I am working on an order allocation problem with variable and fixed costs. The initial formulation of this problem was a linear optimization, but when fixed and variable costs were introduced, it required the formulation to be non-linear…
0
votes
0 answers

Building a stacking constraint in Pyomo for Daily Fantasy Sports

I am creating an integer program in Python using pyomo for Major League Baseball (MLB) daily fantasy. Given a lineup of 10 players (1 of each position plus 2 pitchers) and a salary cap, the program returns the lineup that maximizes projected points.…
JRP
  • 125
  • 2
  • 10
0
votes
0 answers

ILP in poly-time?

Integer programming is said to be NP-complete. However, I think formulating a problem into ILP can't prove the problem to be NP-hard. Is there any example of problem that can be modeled into ILP but has a polynomial time?
Peter Chan
  • 13
  • 1
  • 5
0
votes
1 answer

GAMS Error in MIP Transportation Problem - Uncontrolled set entered as constant

I am trying to formulate an MIP model in which a transportation can be performed by available trains or new ship investments. My current code includes three tables: Monthly costs for trains, monthly costs for ships and initial investment costs for…
user11552448
0
votes
1 answer

Truck Optimization With Different Sizes of Boxes

I have a problem where I need to find the combination of boxes. Let say I have 3 small boxes with different sizes and I need to fit all these boxes into different size trucks but at the same time, I will need to minimize the truck cost. I tried the…