Questions tagged [docplex]

docplex (a.k.a. IBM® Decision Optimization CPLEX® Modeling for Python) is a Python modeling API that provides modules for mathematical programming via CPLEX and constraint programming via CP Optimizer.

316 questions
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
0 answers

Dial A Ride Problem on Python using CPLEX

I try to program a Dial A Ride Problem based on Cordeau and Laporte model. I simplified the model : -Only one vehicle -Start equal terminal -Erased time constraints I manage to have some results with docplex on python But there is trouble... I can't…
StabiloHB
  • 13
  • 2
0
votes
1 answer

The sub-optimal with docplex (cplex) when time limit is reached?

I am using Docplex (Cplex python version) with a maximization objective. I set the time limit, using mdl.solve(TimeLimit=600). It is possible that the model doesn't reach the optimal during this time, so i want to get the objective value…
0
votes
1 answer

How to initiate the interval variable bounds in docplex (python)?

I have the following OPL code and need to implement it in docplex (python), i'm newbie in that field... using CP; dvar interval I1 in 0..20; dvar interval I2 in 0..20; dvar interval I3 in 0..20; dvar int over1; dvar int start1; dvar int…
0
votes
1 answer

how to define an indicator constraint in docplex python API?

I want to model an integer programming example with docplex in python. for an indicator constraint I have this equation (X is a binary variable): I wrote this code : for i1,i2,i3 in P: mdl.add_indicator_constraints(x[(i,j,k)] for i,j,k in ijk…
Sana.Nz
  • 81
  • 11
0
votes
1 answer

How to convert/get the value of integer expression in cplex?

I am new to Cplex. I need to compute the overlap between several intervals at same time. For that, i compute the overlap_length between two intervals at a time, and i save the max and min of the start/end points. For example, let's consider three…
0
votes
0 answers

trying to install docplex on python Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output

Collecting docplex Using cached https://files.pythonhosted.org/packages/1c/06/de7833f2e70d51286611a2676f130f0978d2c16f65047cb965d0af579d08/docplex-2.12.182.tar.gz ERROR: Command errored out with exit status 1: command:…
Radek
  • 1
0
votes
0 answers

Minimize percentage of delays with Docplex

I have a pandas dataframe like this: tail_n | flight_route | Percentage_delay _______________________________ 'N14125' | '(VB, MI)' | 0.1 | '(CC, SK)' | 0.5 | '(KF, KC)' | 0.3 'N351JB' | '(AZ,…
coelidonum
  • 523
  • 5
  • 17
0
votes
1 answer

Rectangle scheduler using CPLEX constraint programming

I need to schedule a set of rectangles in a big rectangle (named bin) using the constraint programming. As I'm using CPLEX, i found out the square sched example (I'm in fact new to CPLEX and PPC). When I have adapted the example for rectangle case,…
0
votes
1 answer

How do I Implement "Continuous with Minimum or Nothing" Variables in DocPlex?

I have a 5-20 variables in my problems, and generally for 3-6 the allowable solution space is either continuous down to a minimum value or exactly zero. For example, in one problem the first variable (x0) can be either be between 250-1000 or it can…
rhaskett
  • 1,864
  • 3
  • 29
  • 48
0
votes
2 answers

DOcplexException: Expecting sequence of constraints, got: True at position 0

I am using docplex in google collab with python For the following LP, the some of the decision variables are predetermined, and the LP needs to be solved for that. It's a sequencing problem and the sequence is a set of given values. The other…
0
votes
1 answer

How to define objective function of CVRP with 3d cost matrix using CPLEX Solver?

The following is an extract from https://medium.com/cmsa-algorithm-for-the-service-of-the-capacitated/using-cplex-and-python-for-finding-an-exact-solution-for-the-cvrp-ac789ee0d8c4, which of course, works fine when using a 2d cost…
0
votes
1 answer

DOCPLEX disable Warning: constraint has already been posted

I'm running a DOCPLEX model using the python API and one of the constraints causes the following error to be thrown.: My question is 1. what does this mean and 2. how do I disable the warning? Warning: constraint has already been posted: _x4844 <->…
Sledge
  • 1,245
  • 1
  • 23
  • 47
0
votes
1 answer

DOCPLEX: adding a constraint with sums two variables

I'm using the CPLEX solver in Python through DOCPLEX. Among other constraints, I would like to state the following one: cnrt_10 = { (w, w1, j-1, j): opt_model.add_constraint(ct=opt_model.sum(X_var[p, w, c, j-1] for c in range(1,…
campioni
  • 157
  • 1
  • 8
0
votes
1 answer

CPLEX and Anaconda Python integration error on MacOS

I installed Anaconda 1.9.7, the Python version is 3.7.3. Then used conda install -c ibmdecisionoptimization cplex and pip install cplex However, I face this error: No module named 'docplex'. There is nothing on the net for solving this error…
Sean
  • 103
  • 9