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

How do I set the key for using the full version of CPLEX?

I have purchased a cplex subscription and received a key to use, but I can't figure out how to use it, no matter what I try I keep getting the "no key, go purchase cplex here" error. I'm using cplex via docplex in a jupyter notebook running in…
Threore
  • 33
  • 3
3
votes
1 answer

Can't derive dual values from a LP using CPLEX

I am trying to code a Bender's decomposition algorithm using CPLEX. To ensure that I code it correctly, I follow the numerical example from "Decomposition techniques in mathematical programming" by A.J. Conejo et al., p.247. However, my problem can…
3
votes
3 answers

How to set gap tolerance in cplex-python?

I want to set a gap value (GAP) such that the optimization process stops when the current gap will be lower than GAP. I have read the cplex-python documentation and I found that: Model.parameters.mip.tolerances.absmipgap(GAP) but I get the next…
3
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
  • 57
  • 5
3
votes
2 answers

Why am I getting an unallowed character error in Pyomo with CPLEX?

I am trying to use CPLEX with a simple Pyomo example: from pyomo.environ import * model = ConcreteModel() model.x = Var( initialize=-1.2, bounds=(-2, 2) ) model.y = Var( initialize= 1.0, bounds=(-2, 2) ) model.obj = Objective( expr=…
Jim
  • 75
  • 1
  • 7
3
votes
1 answer

Warm starting QP solver in CPLEX

I'm trying to figure out how to warm start the quadratic programming solver(s) for CPLEX. I am specifically interested in warm starting the QP solver for nonconvex quadratic programs terminating at first-order stationary points. I believe the…
ae0709
  • 304
  • 1
  • 9
3
votes
1 answer

Vehicle Routing with Pickup and Dropoffs with MIP

I am trying to solve a Vehicle Routing Problem with multiple pickups and dropoffs with multiple products carried by just one car. After solving this problem I am going to extend to multiple types of cars as well. One special setting is that it has a…
Josh Cho
  • 147
  • 1
  • 13
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,380
  • 1
  • 18
  • 35
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

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
  • 7
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
  • 421
  • 1
  • 5
  • 15
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…