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

How do I switch the max function from CPLEX OPL to Docplex?

I have the following restriction implemented on CPLEX OPL. forall (i in N) forall (j in M) forall (k in 1..i) sum(z in 1 ..i)(p[z]*(x[z][j][k]+y[z][j][k])) + (t[k]*max(z in 1 ..i)(x[z][j][k]+y[z][j][k]))<= d[i]; …
2
votes
0 answers

How can I solve the CPLEX directory issues in R

The problem is that, am trying to install a package cplexAPI using the code install.packages("cplexAPI") "C:/rtools40/mingw32/bin/"gcc -I"C:/PROGRA~1/R/R-40~1.5/include" -DNDEBUG -g -D_R_=1 -DUSE_R=1 -I"\cplex\include" -O2 -Wall …
2
votes
1 answer

PULP - How to get the CPLEX solver status instead of the LpStatus stauts?

I'm using the CPLEX solver via PULP in Python. When I solve a problem with time limit, CPLEX prints to the screen the code 107 which means "Time limit exceeded, but integer solution exists". However, if I print the status of…
Miguel
  • 401
  • 5
  • 13
2
votes
1 answer

Defining tuple in CPLEX

I want to define a tuple in a CPLEX .mod file. There is a main block in the .mod file. When I try to define the tuple inside the main block, an error occurs like: Scripting parser error: missing ';' or newline between statements. This is shown in…
2
votes
0 answers

Cplex solution pool generates duplicate solutions

I put this question on IBM forum, since nobody responded I am going to ask here. I have an MIP model written with docplex and a solution pool that populates a massive number of solutions. My problem is, when my solution pool finishes most of the…
Sana.Nz
  • 81
  • 11
2
votes
1 answer

Java CPLEX Concert UnsatisfiedLinkError

I am trying to use cplex in java using eclipse IDE on Ubuntu 16.4 and I am getting an exception "UnsatisfiedLinkError" as follows Does anybody have an idea how to overcome this exception? Exception in thread "main" java.lang.UnsatisfiedLinkError:…
daoud
  • 25
  • 4
2
votes
0 answers

why 'target_link_libraries' command is not working? (cplex)

I tried to compile an project with cmake command(all implementation is written by other people. my job is just compile and run.) error messages after cmake -- The C compiler identification is GNU 9.3.0 -- The CXX compiler identification is GNU…
2
votes
1 answer

all entries at implied bounds CPLEX

I have a set of cars with scheduled time originaltime[cars] to arrive at destination. However, based on the sequence of arrival, they have to be some time apart (given by data input separate[cars][cars]). My objective is to minimize the delay of…
gawdzilla
  • 45
  • 7
2
votes
1 answer

sensitivity analysis in docplex

how can I do sensitivity analysis in docplex (python)? Suppose we have this model: Max z= 3*x+2*y; st: 2*x+y<=8; x+2*y<=6; I use docplex in python for solve the model: from docplex.mp.model import Model tm = Model(name="MyModel") x =…
AComputer
  • 519
  • 2
  • 10
  • 21
2
votes
0 answers

I can't install solvers in virtual environment

I want to work with a package using Jupyter notebook. First, I need to create a virtual environment, which I've done, and then install Gurobi and CPLEX there. Using these commands: conda install -n virtualenvname ibmdecisionoptimization cplex for…
2
votes
2 answers

pulp.solvers.PulpSolverError: PuLP: cannot execute cplex

I am trying to solve an MIP using PuLP on a Mac. I have already added the directory '/Applications/CPLEX_Studio1210/cplex/python/3.7/x86-64_osx', to my PYTHONPATH. But whenever I try prob.solve(CPLEX_CMD()), I receive the following error…
2
votes
1 answer

how to set a four dimension variable in docplex with C#?

how to set a three or four-dimensional variable when calling cplex in C#? using ILOG.Concert; using ILOG.CPLEX; The following is two -dimensional: INumVar[][] EndTime = new INumVar[NumEMU][]; for (int i = 0; i < NumEMU; i++) …
Justin Shi
  • 21
  • 2
2
votes
2 answers

How to add quadratic constraints to the model by using DOcplex (python)?

Take this quadratic constraint as example: (-x1^2 + x2^2 + x3^2 <= 0) Note that in the CPLEX Python API, the above constraint is formalated as follows: m.quadratic_constraints.add( quad_expr=[["x1", "x2", "x3"], ["x1", "x2", "x3"], [-1, 1, …
aniuniu
  • 23
  • 3
2
votes
1 answer

CPLEX generic callbacks, node LP for cut separation

I am setting up a branch-and-cut algorithm using the generic callback framework through the C API of CPLEX 12.10. At each node, the separation problem is based on the current node LP and detects locally valid cuts, that if violated are added for…
2
votes
2 answers

How to connect cplex and pyomo?

opt = SolverFactory('cplex', executable="/Applications/CPLEX_Studio_Community129/cplex/bin/x86-64_osx/cplex") If using the executable option (as above), it works. If not, we get the following error: ApplicationError: No executable found for solver…
chenglong0931
  • 33
  • 1
  • 3