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.

1757 questions
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
  • 2,511
  • 2
  • 22
  • 40
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,046
  • 3
  • 29
  • 42
4
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…
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
  • 429
  • 3
  • 11
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
  • 115
  • 7
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
  • 141
  • 6
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?
4
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
  • 107
  • 5
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,207
  • 3
  • 14
  • 26
4
votes
1 answer

Building a linear program in Python with Cplex

I'm trying to solve a linear program with large number of variables and constraints. I need to dynamically generate the constraint matrices and build the lp in python. The only tutorial i can find on Cplex for Python is the official one from IBM,…
user3800276
  • 91
  • 1
  • 4
4
votes
2 answers

Weird result of CPLEX "cplexmilp" function in MATLAB

According to my previous question, I want to optimize an objective function using binary integer linear programming (all of variables are binary) as follows: Minimize f = (c1*x1) + (c2*x2) + MAX((c3*x3),(c4*x4)) + (c5*x5) Subject to: some equality…
oMiD
  • 302
  • 4
  • 20
4
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…
4
votes
3 answers

Force Python to be 32 bit on OS X Lion

I'm trying to use CPLEX within Python on Mac OS 10.7.5. CPLEX appears to only support a 32 bit python. I'm using this in a python shell to check if it's 32 bit: import sys,platform; print platform.architecture()[0], sys.maxsize > 2**32 I've tried…
sciencectn
  • 1,163
  • 1
  • 13
  • 25
4
votes
1 answer

No solution in CPLEX with very small change in inputs

I'm using CPLEX in C++ to solve a hub location problem, a MIP, and I've recently found a very precise set of inputs that CPLEX thinks is infeasible (i.e. CPXMIP_INFEASIBLE) even though the problem is certainly feasible. The problem appears to…
3
votes
1 answer

CPLEX Java Convex Quadratic Constraint (only PSD if x non-negative)

I have a quadratic problem with the variables e and a, both of which are non-negative. I have a constraint that reads a <= e (1 - a). When transformed, the matrix Q reads [[0,-1][0,0]] which is obviously neither positive nor negative semi-definite…
Layla
  • 103
  • 10