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

GAMS Cplex Cuts

I am solving a MILP modelled in GAMS by using Cplex. I am allowing the solver to generate cuts. Is there a way to get the cuts generated by Cplex displayed? Thank you
Clement
  • 121
  • 4
2
votes
1 answer

Accessing branch-and-cut node id in generic Cplex callback

I have an optimization problem that is decomposed using Benders decomposition. I implemented a Cplex generic callback (in JAVA) that includes Lazy, User and Heuristic callbacks. Now, I need to add some cut management strategies e.g., limiting the…
hmd.pouya
  • 103
  • 7
2
votes
1 answer

How to use Continuous Variables for IF-THEN constraints on DOCPLEX (Python)?

I'm using DOCPLEX to build up a Mixed Integer Linear Programming (MILP) problem which is then solved via CPLEX on Python. However, upon trying to solve the MILP problem using IF-THEN constraints, I receive the following error: DOcplexException:…
2
votes
1 answer

LP / MILP (CPLEX) difficulties

I'm trying to solve an optimization problem with CPLEX. //Variables int n = ...; range time =1..n; //n definido em data dvar float+ c[time] in 0..0.9; dvar float+ d[time] in 0..0.9; dvar float+ x[time]; int beta[time]=...; float…
2
votes
2 answers

How to add new constraints in the scheduling problem at CPLEX?

I am a beginner at CPLEX and I am struggling to add more constraints in my project. The script works well when I have multiple origin and destination, and just one product I would like to do it with more products demand in each destination, and I do…
2
votes
1 answer

How can I run cplex program from c# code?

I have a cplex code that works in cplex ide. I want to run that program inside c# code. I added cplex libraries, but visual studio cannot understand it. using ILOG.CPLEX; using ILOG.Concert; but these are red underlined. How can I connect cplex…
burak
  • 71
  • 6
2
votes
1 answer

Best integer at root node Cplex with pyomo

I am using pyomo with CPLEX as solver. Is there any function to get the Best integer solution and the variables solution at the root node (LP relaxation) like the getValue and getBestObjValue?
CHE
  • 41
  • 3
2
votes
1 answer

Setting optimalitytarget parameter in python for cplex solver pyomo

i am trying to optimize a quadratic objective function in pyomo with cplex solver and i get this CPLEX Error 5002: objective is not convex. QP with an indefinite objective can be solved to local optimality with optimality target 2, or to global…
2
votes
3 answers

How to Implement Logical OR constraint in CPLEX Python

How can I implement a constraint like x[0,0] == 0 OR x[0,0] >= 2 in CPLEX Python MP? Seems like a job for semiinteger but semiinteger_var_matrix() is not available in the version of CPLEX Python I am using in Watson Studio DO environment. I could…
jch
  • 3,600
  • 1
  • 15
  • 17
2
votes
2 answers

How to generate some feasible solutions in CPLEX-PYTHON (Not docplex)?

I am working on my thesis about a variant form of Vehicle routing problem (VRP) using a linear mathematical programming approach. I have a well-tested model that I formulated but this model is solved in an acceptable computational time for at most…
2
votes
1 answer

How to use a solution from a model to solve another one

I'm solving an optimization problem in which I need the result from one model to be used as a restriction in another model. I'm using CPLEX with OPL language without any addon. I tried to save the values from one model into an Excel file and reading…
John
  • 37
  • 3
2
votes
2 answers

Pyomo: Minimize for Max Value in Vector

I am optimizing the behavior of battery storage combined with solar PV to generate the highest possible revenue stream. I now want to add one more revenue stream: Peak Shaving (or Demand Charge Reduction) My approach is as follows: Next to the…
2
votes
1 answer

Check new variable reduced cost with CPLEX

I am working on a Column Generation algorithm. After pricing the new variables and calculating the reduced cost, how can I add the new variable and check if my calculated reduced cost is correct according to CPLEX? When I add the new variable to the…
2
votes
1 answer

Error: cplex (default) cannot extract expression; OPL cannot extract expression AND change interface language

I'm a total beginner with CPLEX and OPL, so maybe someone can help me with the coding of a mixed integer programming model. I finished the model and the data. When I run the configuration I get 44 errors, including "opl cannot extract expression",…
tabacoben
  • 41
  • 2
2
votes
2 answers

CPLEX cannot solve an .lp file that Gurobi can

I am working with mixed integer quadratic programming (MIQP) on CPLEX 12.8.0, Python API. I generated a model to the .lp file. It turned out the model is integer infeasible. It is very weird, because I generated the exact same problem with Gurobi…