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
2
votes
0 answers

How to implement "strictly less than" when setting up constraints in CPLEX Python api?

I think the character 'L' represents <=, how about strictly less than i.e. '<'?
Stanley Gan
  • 481
  • 1
  • 7
  • 19
2
votes
2 answers

Inconsistent arguments CPLEX error Python API

I have a long list of decision variables which basically based on an input data file. However, for convenience, let's use the example below: I am adding decision variables to my model and each of these decision variables are constrained to be…
Stanley Gan
  • 481
  • 1
  • 7
  • 19
2
votes
1 answer

New academic cplex expired license message

I've been trying to use cplex with pyomo to solve some LP, nevertheless when running I found the following error message [ 0.00] Setting up Pyomo environment [ 0.00] Applying Pyomo preprocessing actions [ 0.00] Creating model [ 0.02]…
esv
  • 41
  • 1
2
votes
5 answers

R: Install cplexAPI errors

I am trying to use cplexAPI in R. I am getting persistent errors. I am using Microsoft R Open 3.3.1 and have installed IBM ILOG CPLEX Optimization Studio Version: 12.7.0.0 on Windows 10. Here is what I have done, and what has resulted. I am going to…
jjhold
  • 99
  • 9
2
votes
1 answer

What is the CPLEX equivalent of Gurobi's .set() method?

I am trying to translate some Gurobi code across to CPLEX and am having trouble working out how to set the starting value for a variable. The original code looks like this: for (int b=0; b
guskenny83
  • 1,321
  • 14
  • 27
2
votes
2 answers

model.solve() method is not working ("CPLEX DLL not found") for DOcplex for Python

I build my mathematical model using DOcplex IBM package for Python. I am sure that the other part of the modeling is correct, however when the call to Model.solve() is executed, and I get the following error: "CPLEX DLL not found: please provide…
Faraz Ramtin
  • 345
  • 3
  • 11
2
votes
2 answers

Ampl Cplex solve error

Why do I get the following message everytime I try to solve a model with CPLEX: ampl: option solver Cplex; ampl: model Anchor_QP.mod; ampl: solve; Incorrect usage. Correct command syntax is: Cplex or Cplex -f or Cplex -c…
Ozgu
  • 151
  • 1
  • 12
2
votes
1 answer

CPLEX obtain reduced costs of a MIP?

I am solving a MIP problem using CPLEX. After solving it, I want to get the reduced costs. I am aware of the fact that reduced costs don't exist for the MIP, so I did the following: int type = CPXgetprobtype(env, lp); …
2
votes
2 answers

Cplex gives two different results?

I use Python API in Cplex to solve a Linear programing problem. When using Cplex, I had the result below: But then I saved my LP prolem as a lp file and use Cplex to solve again, the result was a little bit difference from the first one: Anyone…
Tuan Pham
  • 49
  • 4
2
votes
1 answer

Understanding CPLEX output

I am working on a problem using CPLEX and I am very unfamiliar with it. I know how the Simplex algorithm works, I know Branch&Bound, MIP problems etc, but only from a theory point of view. This is the first time I actually use CPLEX. I am using it…
excalibur1491
  • 1,201
  • 2
  • 14
  • 29
2
votes
0 answers

How to install PyCPX (a python wrapper for the IBM CPlex) with Miniconda python on windows 7

I'm trying to install PyCPX, a python wrapper for the IBM CPlex optimization suite on windows 7. PyCPX I am using the python that comes with Miniconda and I've removed the /usr/bin/python from my machine to ensure that I'm using the correct one.…
user6029533
  • 39
  • 1
  • 4
2
votes
1 answer

How to configure IntelliJ Idea with CPLEX

I have read many forums but I have not found anything about it for IntelliJ Idea. I'm not a developer but I manage a Tomcat8 server on Debian. A developer wants to use IBM ILOG CPLEX in its Grails application. He uses the IDE "IntelliJ Idea." He…
2
votes
2 answers

Error in defining constraints using IloRange in CPLEX (c++)

I am facing problem in writing constraints using IloRange. There are no compilation error but the code is not running. In the code, ad_sales.u_j[j] is a variable, while demand[j] and lambda[j] are parameters. The syntax I have used for ILoRange is…
S_R
  • 21
  • 2
2
votes
2 answers

How to prevent infeasible error with pulp and python?

I have an optimization problem and I write a python program to solve it. I used Pulp with the CPLEX solver: import pulp prob = LpProblem("myProblem", LpMinimize) x = pulp.LpVariable.dicts("p", range( K ), 0, 1, pulp.LpContinuous) prob +=…
1-approximation
  • 321
  • 1
  • 4
  • 13
2
votes
1 answer

How to access current solution after an iteration of the Barrier algorithm?

I want to access the current solution of QP after an iteration of the Barrier algorithm. There is a callback ContinuousCallbackI that is triggered after each iteration. I modified the callback code example: static ILOBARRIERCALLBACK2(MyCallback,…
kfrgaricus
  • 21
  • 1