Questions tagged [cplex]

CPLEX is a fast commercial linear, quadratic, and mixed-integer optimizer. CPLEX offers a number of pre and post-processing tools allowing the software to substantially reduce the number of variables (columns) and constraints (rows) of a model. It is possible to solve models via an interactive shell, OPL (Optimization Programming Language), or a number of interfaces to programming languages, such as C, C++, Java, C#, Python, and MATLAB.

CPLEX is a commercial mathematical optimizer now owned and sold by IBM. It can solve continuous and mixed-integer optimization problems with linear and convex quadratic constraints and objectives and second-order cone problems. The core solver is written in C, but APIs are available for C, C++, Java, C#, Python, and MATLAB.

User's guide and API reference is available in the following formats:

  • PDF (for V12.1)
  • HTML (for V12.3 and up)

For troubleshooting questions that may involve back-and-forth (including posting attachments), or technical discussions about the algorithms, consider posting your question on the official IBM developerWorks forum instead.

2272 questions
0
votes
1 answer

docplex with callback in dropsolve

Is it possible to solve a model that has a callback using model.solve(url=url, key=api)? I am trying an example similar to this but callback has no effect when called on dropsolve.
ooo
  • 512
  • 1
  • 7
  • 27
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
2 answers

Can't import model from MPS file to IloCplex - IBM ILOG CPLEX - Java - Intellij

I'm currently developing a project in java using the Ilog Cplex libraries, I'm using the Intellij-Idea IDE. I'm having troubles importing a model from MPS file, this is the piece of code that gives me problems IloCplex iloCplexInstance = new…
0
votes
1 answer

Package ilog doesn't exist even after adding cplex.jar to lib

I was following the instructions in this github repo, downloaded the free version of cplex, and added cplex.jar from CPLEX_Studio_Community129/cplex/lib and put it into KidneyExchange/lib. I also added…
Reynard
  • 111
  • 1
  • 1
  • 4
0
votes
2 answers

Getting the number of branch and bound nodes explored CPLEX

So I'm curious how to get the number of branch and bounds nodes explored. I was interested in this to gage how hard solving my IP is - if there is a better metric for this please feel free to share. I tried to use…
Eigenvalue
  • 1,093
  • 1
  • 14
  • 35
0
votes
1 answer

CPLEX using if then constraints with CP optimizer in C#

Please help me if anyone can solve this problem, and I would be so appreciated. If there is a vehicle which can transport the material from machine 1 to machine 2 or from machine 4 to machine 3, which means there are two optional intervals (named…
Yuan
  • 31
  • 7
0
votes
3 answers

Cplex Java Library set up path problem in Eclipse

I have a newbie problem with taking the Cplex library in Eclipse, Error: Could not find or load main class Files\IBM\ILOG\CPLEX_Studio1210\cplex\bin\x64_win64 Caused by: java.lang.ClassNotFoundException:…
0
votes
1 answer

Cplex - multi objective function

I need to write a model with several objective functions in Cplex. I use the OPL language. what it is the syntax for the .mod file please ?
0
votes
2 answers

CPLEX vs Constraint Programming Solution for a linearly constrained MIP with a nonlinear objective(division)

I am trying to solve an MIP with a non-linear objective such as sum(a(i)*x(i))/sum(b(i)*x(i)) where a(i) and b(i) are parameters. Since CPLEX cannot extract this expression, I tried using CP. However, I have constraint stating that the decision…
osygl
  • 13
  • 2
0
votes
1 answer

Terminate and retrieve solution in ILOG after a certain time limit in python

I am using ILOG CPLEX from Python and I am running an Integer optimisation problem that takes sometimes more than 12 days to complete . I need to terminate the program after a certain time limit regardless of solution is obtained or not. Can anyone…
Ram_Giri
  • 1
  • 1
0
votes
2 answers

For loop with steps OPL Cplex

I need to write matrices of different dimensions in OPL CPLEX. Currently, I wrote this for loop : {int} row=...; {int} col=...; int y[row][col]; execute { for (var i=1; i<=row.size; i+=10){ for (var j in col){ y[i][j]=i; } } …
sroverto
  • 57
  • 7
0
votes
2 answers

Retrieving Reduced Cost of Dvar composed of "tuples" in CPLEX OPL

I want to retrieve the reduced cost of a decision variable in CPLEX OPL. However, the dvar indices are tuples, and cplex cannot iterate over a tuple to print the reduced costs. Is it impossible with tuples, or is there a way for it? For example…
osygl
  • 13
  • 2
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

Location of saved results in Cplex Optimisation Studio

In the CPLEX Optimisation Studio I can save and restore the results of model solves. I can not find these results in the OPL project directory. Where are those results stored? In the current workspace directory?
HTC
  • 107
  • 1
  • 4
0
votes
1 answer

How do I fix an internal error on IBM CPLEX?

I have a code that was running without issue until I tried to pull additional data from a local excel file. It was working fine until the line below was added: p from SheetRead(Sheet,"'Selection'!F1:F17");; Please let me know if you have any ideas…