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

Passing CPLEX Parameters to CVXPY

How do i pass tolerances and other parameters through CVXPY when using the CPLEX solver? from cvxpy import Problem, Minimize from cvxpy.settings import CPLEX costs = ... constraints = ... prob = Problem(Minimize(costs),…
rhaskett
  • 1,864
  • 3
  • 29
  • 48
3
votes
1 answer

What constraints make my problem infeasible?

I'm using CPLEX 12.8 for modelling my thesis project and I have a problem that I cannot solve. I get the following output: CPLEX 12.8.0.0: integer infeasible. 1828 MIP simplex iterations 316 branch-and-bound nodes No basis. Is there any way to…
3
votes
1 answer

Benders.Strategy using Java and opl

I'm solving a mathematical model using Java however when i tried to call the Benders Strategy i keep receiving this error: Exception in thread "main" java.lang.IllegalArgumentException: No enum class ilog.cplex.cppimpl.IloCplex$IntParam with value…
3
votes
1 answer

Constraints Added by docplex.mp.model.add_if_then Cause Read Error by CPlex

I'm using docplex to build up a mixed integer program which is then solved via cplex. However, upon trying to solve the MIP I receive the following error: CPLEX> read plan.lp CPLEX Error 1434: Line 184224: Couldn't convert '1<->' to a number. No…
3
votes
1 answer

Error due to iostream.h in CPLEX

I have successfully installed CPLEX 12.8.0 on my Mac, which runs High Sierra. I used the R package cplexAPI, which actually uses the C API behind the scene, for a linear programming problem, and it worked totally fine. Now I want to use the C++ API;…
Lambda Moses
  • 433
  • 5
  • 14
3
votes
1 answer

Java+CPLEX Unknown Object Exception in LazyConstraintCallback

I'm quite new to CPLEX+Java. I try to implement a variant of an Orienteering Problem and a Pickup and Delivery problem. I would like to use a LazyConstraintCallback to ensure Subtour Elimination in Integer Solutions. Due to the orienteering…
Layla
  • 125
  • 10
3
votes
1 answer

ValueError invalid matrix input type -- in Python Cplex

I am working with cplex in python, however, I get the following error (in line 144): Traceback (most recent call last): File "objectivefunction_D.py", line 144, in names = constraint_names) File…
aeengineer
  • 85
  • 1
  • 9
3
votes
0 answers

Cplex netbeans unresolved inside include (#include "ilcplex/ilocplex.h")

I have an error when I run my code at #include "ilcplex/ilocplex.h" #include "ilcplex/ilocplex.h" ILOSTLBEGIN /* * */ int main(int argc, char** argv) { IloEnv env; IloModel model(env); IloNumVarArray x(env); for(int i = 0; i…
A.JO
  • 235
  • 4
  • 14
3
votes
1 answer

Return current best solution CPLEX Python API

Due to MIP problems which take long computation time, how do I instruct cplex to return current best solution when the computation time takes longer than, an hour for example, and the relative gap is at 5% for example? Individually, I believe I can…
Stanley Gan
  • 481
  • 1
  • 7
  • 19
3
votes
2 answers

multi-capacities Knapsack in CPLEX

I came cross Knapsack problem, where the maximum number of multiple items from a set of items need to be placed into one bin by minimizing the cost. I am able to solve the optimization problem in CPLEX. However, I am finding difficulties in…
3
votes
1 answer

Gurobi or CPLEX? Quadratic indefinite objective - quadratic positive-semidefinite constraints

I want to minimize a quadratic objective function subject to a set of linear and quadratic constraints. The quadratic objective function is indefinite (non-convex). The quadratic constraints are positive-semidefinite (convex). The variables are…
user436994
  • 601
  • 5
  • 15
3
votes
1 answer

advantages of cplex in pyomo versus cplex in python

I've been using GAMS for a long time, but I cannot use all the functionality of CPLEX under GAMS. Can you do that using Pyomo? or using CPLEX directly in Python? Thanks!
Salva
  • 109
  • 1
  • 9
3
votes
1 answer

How to write the CPLEX solution to excel

I have a MIP problem giving me 3 solutions in CPLEX. How do I take one of those solutions and export it to an excel file? I tried the following so far: This is what I typed in CPLEX command prompt window read try optimize display solution…
DD1
  • 33
  • 4
3
votes
1 answer

How to warm-start pyomo with cplex?

I am currently using cplex with pyomo from the command line using pyomo -solver=cplex model.py data.dat the results are saved in the file results.json. How can I start cplex again using the previous results as a starting solution?
algor207
  • 131
  • 3
3
votes
1 answer

Cplex best current solution

I'd like to get informations about my cplex problem during solve. My first idea was to use an IloCplex.IncumbentCallback but it's not compatible with dynamic search, and I get better results with dynamic search. So I'm looking for a way to get…
jaudo
  • 2,022
  • 4
  • 28
  • 48