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

IBM Watson CPLEX Shows no Variables, no Solution when solving LP file

I'm migrating an application that formerly ran on IBM's DoCloud to their new API based off of Watson. Since our application doesn't have data formatted in CSV nor a separation between the model and data layers it seemed simpler to upload an LP file…
Michoel
  • 834
  • 5
  • 16
5
votes
1 answer

CpoException: Can not execute command 'cpoptimizer -angel'. Please check availability of required executable file

I have CPLEX Optimization Studio installed on my Ubuntu machine and I am using the docplex model module with success. Now I have to use CpoModel from docplex.cp.model and I have the error: CpoException: Can not execute command 'cpoptimizer…
raisedbywolves
  • 111
  • 2
  • 6
5
votes
1 answer

Fast nonnegative quantile and Huber regression in R

I am looking for a fast way to do nonnegative quantile and Huber regression in R (i.e. with the constraint that all coefficients are >0). I tried using the CVXR package for quantile & Huber regression and the quantreg package for quantile…
Tom Wenseleers
  • 7,535
  • 7
  • 63
  • 103
5
votes
1 answer

how to get value of elapsed time after using CPLEX Python API

I'm using CPLEX python API to solve an optimization problem. The model is named DOT. When I run DOT.solve(), many information occur in the python console: Iteration log ... ... Network - Optimal: Objective = 1.6997945303e+01 Network time = 0.48…
user12345
  • 117
  • 8
5
votes
3 answers

Cplex Python how to avoid printing the output

after setting the objective function and constraints, i use prob.solve() print prob.solution.get_objective_value() actually, I just want to print the objective value, however, it displays a lot of information of cplex, Tried aggregator 1 time. LP…
5
votes
2 answers

CPLEX Python API performance overhead?

Update This question has been thoroughly discussed and updated on OR exchange, where I had crossposted it. Original question When I run CPLEX 12.5.0.0 from the command line: cplex -f my_instance.lp an optimal integer solution is found in 19056.99…
Aristide
  • 3,606
  • 2
  • 30
  • 50
5
votes
1 answer

CPLEX + YALMIP -- "Solver not found"?

I'm trying to get started with YALMIP, which is a Matlab interface to optimization solvers such as CPLEX. I have an objective function obj and constraints cons, and I've plugged them into Yalmip... options=sdpsettings('solver','Cplex'); %windows…
5
votes
1 answer

Optimal use of CPLEX Java for high-throughput

I am solving large optimization problems with CPLEX Java API. Currently I just IloCplex cplex = new IloCplex(); ... add lots of variables and constraints ... cplex.solve(); cplex.end(); This works great, but I repeat the process frequently where I…
Noah Watkins
  • 5,446
  • 3
  • 34
  • 47
4
votes
1 answer

Specify the sense of a constraint in CPLEX

I am writing a small wrapper around Gurobi and Cplex so that the models I write are solver independent. I'm very familiar with Gurobi but I'm very new to Cplex and I'm having trouble replicating certain api calls that I use very…
Connor
  • 545
  • 4
  • 20
4
votes
1 answer

CPLEX: Accessing strong branching values via python API

I am working on some advanced branching heuristics for mixed integer programming using CPLEX (12.9) by its Python (3.6) API. Part of the branching decisions should be based on the strong branching (SB) score of variables. While I can query the…
CharJ
  • 67
  • 5
4
votes
1 answer

PYOMO: How to create constraint relaxation? (Rewrite constraint from CPLEX in Pyomo)

I am trying to transfer a model written in GAMS using CPLEX solver to Pyomo. CPLEX has a feature allowing modelers to relax constraints & decision variables if a model is infeasible - FeasOpt (for Feasible Optimization). I am having trouble…
Steve
  • 135
  • 1
  • 10
4
votes
3 answers

CPLEX with Python API - how to make model formulating faster?

I turned to CPLEX, since I have quite a big linear problem to solve. If we use scipy.optimize.linprog notation: minimize: c^T * x subject to: A_ub * x <= b_ub and A_eq * x == b_eq, then my A_ub matrix has a shape of roughly (20000, 10000):…
Bi0max
  • 320
  • 2
  • 9
4
votes
1 answer

How to linearize the product of two float variables

I would like linearizate the product of two float variables. Suppose that a model has the product x * y, where x and y are float, with 0 <= x <= 1 and 0 <= y <= 1. How linearizate this product?
Ernando Gomes
  • 41
  • 1
  • 2
4
votes
1 answer

Adding constraints CPLEX Python API

The data that I am handling is not as simple as the ones in the documentation. As my variables basically depends on the data input file, I will use the following simple example to explain what I am trying to achieve. I have following constraints: x1…
Stanley Gan
  • 481
  • 1
  • 7
  • 19
4
votes
2 answers

How to install CPLEX with python?

I am trying to install cplex for python 2.7.9. I downloaded IBM ILOG CPLEX Studio Preview 12.6.1 32bit and I tried to install it from Pycharm (using the GUI and the install package button) but I got this error message: Figuring out CPlex…
Jika
  • 1,556
  • 4
  • 16
  • 27