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
1 answer

Cplex limit time of the presolve phase

I'm using Cplex 12.8 and trying to solve ILP models with hard time limit constraints on them, i.e., the total solving time must not exceed a certain threshold. I'm interested in the number of times a feasible solution has been found. I'm using the…
abc
  • 11,579
  • 2
  • 26
  • 51
2
votes
1 answer

pyomo error: CPLEXDirect does not support expressions of degree None

I am working on a POC to see if pyomo will work for my application and I could use some help determining if there is a fix for the error below of if my intent is not possible. After adding the constraint "split_comp_color" I am getting the error:…
2
votes
0 answers

Limit root node processing in CPLEX Python

I have a very large problem (1m variables, 3m constraints) that I'm trying to solve using CPLEX in Python. Obviously, solving it optimally is out of the question, so I have implemented a time limit so I could get the best solution within that…
2
votes
1 answer

CPLEX - Reduced Costs

I am currently working with cplex and am trying to determine the reduced cost of a LP. I am a little puzzled by the results. My current understanding of reduced cost is that it describes the amount by which a objective function coefficient must…
2
votes
1 answer

Python sparse matrix in Cplex?

I am working on a large quadratic programming problem. I would like to feed in the Q matrix defining the objective function into IBM's Cplex using Python API. The Q matrix is built using scipy lil matrix because it is sparse. Ideally, I would like…
user58925
  • 1,537
  • 5
  • 19
  • 28
2
votes
2 answers

Linear programming two sets of constraints CPLEX Python API

I am trying to solve a linear programming problem using IBM's CPLEX Python API. It involves two sets of equality constraints. The code below works fine when we use either one of the two sets of constraints, but fails to find a solution when both…
user58925
  • 1,537
  • 5
  • 19
  • 28
2
votes
0 answers

How to port CPLEX linear optimization from Matlab to C++

I am trying to port an application from Matlab to C++. This application contains a linear optimization problem of the form: min. F * x s.t. A * x < Rhs s.t. Lb <= x <= Ub which needs to be solved. The matlab API of CPLEX supports writing all…
Devon Cornwall
  • 957
  • 1
  • 7
  • 17
2
votes
1 answer

the differece of logfile when calling cplex from IDE and python

Recently, I'm doing a research about MISOCP. At first, I tried to build a model in python and solve it by calling CPLEX. But I got a problem about the objective CPLEX solved and I was told to check the tolerance of the answer in the logfile by my…
TIAN YUAN
  • 31
  • 2
2
votes
1 answer

C++: Error: Using empty handle

I used C++ and CPLEX to write a model as following. There is no mistake when writing. However, when I run it, it showed the Error:Using empty handle. I'm puzzled about where is the mistake and how to solve it. Thanks for any help! This…
Daniel
  • 21
  • 1
2
votes
0 answers

Compilation error when trying to install the Rcplex package in R

I've already installed the CplexApi package using the following guide: https://www.r-bloggers.com/using-cplex-in-r-installing-cplexapi-in-windows-10/ I'm now trying to install the Rcplex package in a simillar way. I've edited the makevars.win file…
Muki
  • 31
  • 3
2
votes
1 answer

Compile a windows executable from linux using MINGW and linking with CPLEX libraries

The point of this effort is to prevent me from dual booting windows ,having to install CPLEX twice in the same system (storage is quite limited) and ofc be able to compile the required cross-platform executables from my main os which is debian…
Greg K.
  • 686
  • 1
  • 5
  • 18
2
votes
4 answers

Linear programming of vehicle routing

Need help for linear programming of vehicle routing problem. In vehicle routing problem (VRP), a vehicle will serve a set of nodes such that the total travelling cost is minimized. My decision variable is:Xij=1 if node j is visited after node i. The…
2
votes
1 answer

CPLEX C++: How to change parameters during optimization

I'm trying to modify the way Cplex does its branch & bound during optimization, using it's C++ API. What I actually want to do : -Set parameters before calling the solve() method. For example, using cplex.setParam(IloCplex::NodeSel, 0); tells Cplex…
Yoctoboy
  • 322
  • 3
  • 13
2
votes
1 answer

Getting the dual formulation in CPLEX concert technology

I have seen the answer to this similar question but it does not answer my question. Is there any way to get objective function and constraints of the dual formulation directly within your algorithm rather than writing them into a DUA file and then…
rasul
  • 1,009
  • 9
  • 14
2
votes
0 answers

How to draw conclusions of performance comparisons between CPLEX, GuRoBi and SAS solvers

Are there guidelines to estimate beforehand which solver should be used for a mathematical optimization project? Specifically this leads me to the following sub-questions: How do performance benchmarks translate to probable or even possible…