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

Need to speed up the operations on numpy arrays in python

I am solving an integer programming model by importing Cplex as a library in Python. Let's say the optimization problem has a constraint in the following form (Ax = b): x0+x1+x1+x3 = 1 The indices of the x variables in this constraint are 0,1,1, and…
user710
  • 161
  • 2
  • 12
0
votes
1 answer

DCP requirement violated when specifying constraing in cvxpy, perhaps need to rethink entire formulation of problem

This is a follow-up to an earlier specific question, but as I add more complexity to the problem formulation, I realize that I need to take a step back and consider whether cvxpy is the best tool for my problem. What I'm trying to solve: create the…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
0
votes
1 answer

Specifying complex constraints in cvxpy yields strict inequalities error

I am trying to recreate an integer linear optimization problem using cvxpy that I have outlined in Excel - . Note that this is a dummy example, the actual dataset will have thousands of variables. Please ignore the solution in cell K5 of the…
matsuo_basho
  • 2,833
  • 8
  • 26
  • 47
0
votes
0 answers

Solve system of linear equations for integer solutions

I would like to solve a system of linear equations with the added constraint that the solution vector must only contain integers. I assume this can be accomplished by something like intlinprog, but it is not clear to me how a regular linear equation…
0
votes
0 answers

How to speed up graph coloring problem in python PuLP

I am trying to solve the classic graph coloring problem using python PuLP. We have n nodes, a collection of edges in the form edges = [(node1, node2), (node2, node4), ...], and we are trying to find the minimum number of node colors so that no…
0
votes
1 answer

Implementing Objective function with intlinprog

I have a Matlab program that outputs some binary variables based on some constraints. As an example with three n=3 bits, {x_1 x_2 x_3, x_4 x_5 x_6, x_7 x_8 x_9} my program will output all these bits based on the constraints. At this point, I have…
user12928042
0
votes
1 answer

linear programming problem for minimum cost

A construction company has 6 projects, for each they need $d_i$ workers. The company has no workers at the beginning of project 1. Each new worker must take a safety course that costs 300, and 50 more for each worker. If there is no new worker there…
0
votes
2 answers

Error in check_for_unknown_vars_impl(model, the_ast) : The expression contains a variable that is not part of the model

the question was to find the minimum distance-quantity value, however, the code keep showing up the following error Error in check_for_unknown_vars_impl(model, the_ast) : The expression contains a variable that is not part of the model. I…
0
votes
1 answer

How to formulate matrix constraint for cost Optmization in PuLP

I am trying to formulate this complex matrix based constraint in PuLP for a cost Optimization Problem: I have a vars[(i,j)] for i in TruckTypes for j in Days as my decision variable which can take only non-negative integer values. I am trying to…
0
votes
1 answer

How to Formulate a Pulp Objective Function with a max operator

I am trying to formulate an objective function for cost optimization in PuLP wherein the maximum of an array is added to the objective function. Please ignore the indentation. #Decision Variables allocation_vars = LpVariable.dicts( …
0
votes
0 answers

integer programming with python cvxpy for resource allocation

I want to solve a problem in python with integer programming (cvxpy librairy), but I am a little confuse about the definition of my constraints. Here is my problem. I have two databases. 1 contains food products (name of the product/quantity…
0
votes
1 answer

How to clone a cplex object in Java?

I am solving a problem in Java using the CPLEX library. I use a class "Model" to create a CPLEX object, and add to it variables, objective function and multiple constraints. This is the basic model, and I call the constraints "basic constraints". I…
0
votes
0 answers

How can I optimize this integer programming constraint problem?

I am trying to run this constraint problem but the memory runs out, S_{i} are 1975 Students that need to be assigned to one of 188 teacher assistants classes, each teacher assistant must chose a time slot TA_{j} for its class. Each Teacher assistant…
0
votes
1 answer

Why does CPLEX set unrelated variables as 1?

I have been working on a combinatorial optimization problem which can be modeled as an integer linear programming. I implemented it as a c++ project in visual studio 2017 and CPLEX1271. Since there are exponentially many constraints, I implemented…
Mengfan Ma
  • 351
  • 2
  • 13
0
votes
1 answer

2D decision variables in PuLP

I am new to PuLP, and I am trying to run an optimization problem where one of my decision variables is 2D. I'm a little confused as to how one can declare 2D decision variables as part of plp.LpVariable? As of now, this is how I am declaring the…