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

CVXPY: Constraint Violation

I'm attempting to solve an optimization program in cvxpy. The issues is that the answer it returns violates the basic constraint that it was given. I've run this program before with success and attempted to emulate the same code as before but this…
0
votes
1 answer

Implementing MILP in PULP with restricted choices of group

I am trying to implement the following problem in PULP: https://math.stackexchange.com/questions/4232797/optimising-class-assignment-based-on-test-score-and-class-choice/4233234#4233234 Here is my attempt so far. I am not sure how to build the…
0
votes
1 answer

How do you determine allocations under budget constraints?

We have K people, and B choices to allocate from for each person (imagine for eg one of B movies being given to each of K persons) - each person gets utility U_k_b (you know this number) for the k, b pair. There is a budget constraint C_b for every…
0
votes
1 answer

CPLEX won't display decision variables after successful solution

I set up a code for a course scheduling optimization problem using IBM CPLEX. The decision variable is dvar boolean x[course][roomtype][timeslot];, where x is 1 if the course takes place in a room type r during timeslot t. The model has worked…
0
votes
0 answers

Scheduling minimization Integer Programming problem formulation

I am working with Integer Optimization optimization. I have a problem with t tasks and every task i needs w_i weeks to be completed and p_i_t workers on that specific week. There is a total time in weeks to complete all tasks. I need to optimize…
0
votes
1 answer

How do I run a simulation experiment (iterative procedure) in CPLEX?

I am a beginner of programming. I'm trying to practice run a simulation with CPLEX. Since I want to be a person who wants to work in an area in optimization. Therefore, I am trying to study some journals from different areas by myself. The attached…
0
votes
1 answer

Gurobipy: matrix constraints

Let x be the vector of n variables defined with: x = M.addMVar(shape = n, vtype = GRB.BINARY, name = "x"). Let A be an n by n matrix. Let v be an n by 1 constant vector that consists of positive integers. The constraint that I am interested…
Null_Space
  • 449
  • 1
  • 4
  • 9
0
votes
0 answers

Capacitated Maximum Coverage Location Generation in Python

I am building a variant of the maximum coverage location model and want to limit the amount of points that each "facility" can cover. I am using Gurobi optimization . I have tried using the AddConstr() function but have failed. Each K represents a…
izc2300
  • 1
  • 1
0
votes
0 answers

Implementation of two-dimensional integer programming

I have a 2x2 integer matrix A and 2d integers vectors b, c. I want to maximize c∙x under the constrains x≥0 and Ax≤b when x ranges over 2d integer vectors. This is a canonical form of two-dimensional integer linear program. Is there an…
0
votes
1 answer

How Can I declare constraints in Xpress IVE?

I am trying to write a model in Xpress IVE however I got error101: Incompatible types for operator ('mpvar' * 'mpvar' not defined). error. I tried to write this constraint but I couldn't make it. The two consecutive characters on the string must be…
0
votes
1 answer

what's the difference between optimal solution of cplex and the optimaltol solution of cplex?

what's the difference between optimal solution of cplex and the optimaltol solution of cplex? 1、When I solve a integer programming model with CPLEX solver, the result status of some instances show as “optimal”,however,the result status of some…
0
votes
1 answer

Indexing variables in sets in Xpress Mosel

I'm trying to solve a linear relaxation of a problem I've already solved with a Python library in order to see if it behaves in the same way in Xpress Mosel. One of the index sets I'm using is not the typical c=1..n but a set of sets, meaning I've…
0
votes
3 answers

Constraining the solutions for linear equations

I'm searching for a way to solve a system of linear equations. Specifically 8 equations with a total of 16 unknown values. Each unknown value (w[0...15]) is a 32-bit binary value which corresponds to 4 ascii characters written over 8 bits. For…
notsagg
  • 3
  • 1
  • 3
0
votes
0 answers

scipy.optimize.minimize - Multivariate optimization

I am looking to minimize an objective function subject to certain constraints. The function that I am looking to minimize is: def distance_function(choice_matrix, distance_matrix, factory_distance): hub_to_demand_distance =…
0
votes
1 answer

Linear programming constraint set-up related to placement

I have a code that you input the different sizes of modules (rectangular shapes in the form of width, height ) to, and it provides the optimum places for those modules dependent on certain constraints. The objective function is to minimize the…
user12928042