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

Using forall for a set in a Tuple

I am trying to do something like below. I want to get the sum of the continuous variable Xbdt for all BlockBelow corresponding to Pbd.pitblockSet : forall(i in Pbd.pitblockSet , d in DumpBlocks, t in TimePeriods ) { sum(j in BlockBelow[i] )…
Ranajit
  • 49
  • 6
0
votes
1 answer

CPLEX Error 5002: %s is not convex - Least Square Problem with binary formulation

first post on SO. I'm working on a quadratic optimization problem. I'm getting the following error: Aeq = beq = sostype =sosind = soswt = [] % for my specific problem The others paramers look like correctly define. Error using cplexmiqp CPLEX…
0
votes
1 answer

How to add SOCP constraints without a memory leak on C++?

I have asked this question before as "increasing solution time in a loop" here; https://www.ibm.com/developerworks/community/forums/html/topic?id=0ef4c99b-3bcc-4105-ac98-57867d5427da but the forum is currently not available. Later, I realized that…
Umur
  • 1
  • 2
0
votes
1 answer

Combining two tuples based on id in OPL

I have a tuple called blockType tuple blockType { key string id; int i; int j; int k; }; {blockType} PitBlocksType =…; \\read from excel A snapshot of the data is like below P1 1 1 2 P2 1 1 3 P3 1 1 4 P4 1 1 …
Ranajit
  • 49
  • 6
0
votes
2 answers

How to write if condition in CPLEX OPL

I am creating a set called BlockBelow as shown in the following code (this is part of a larger model). While doing so I get some blocks as empty - the data is such that it is likely to give empty sets for some blocks. However I want to do a check…
Ranajit
  • 49
  • 6
0
votes
1 answer

Getting error in using Tuple in CPLEX OPL to read data from a set in the tuple

I have a tuple for reading a set of paths. tuple Path { int id; string source; string dest; {string} pitblockSet; {string} roadPoints; // not used {string} dumpblockSet; {string} others; float dist; }; {Path} Pbd= {} // a set read using into…
Ranajit
  • 49
  • 6
0
votes
0 answers

raise PulpSolverError("PuLP: Error while trying to execute "+self.path) + CPLEX

I reveive the following error code (I blocked my name with XXX): File "/home/XXX/anaconda3/envs/pulposm/lib/python3.7/site-packages/pulp/pulp.py", line 1664, in solve status = solver.actualSolve(self, **kwargs) File…
0
votes
1 answer

How to read a tuple in CPLEX, OPL which has integer, string, and other sets

I am trying to read a tuple from excel. The tuple has integers, strings and sets. I have tried the following but am getting error as : Data element "Pbd" of type {Path} not supported for sheets. And the Processing fails. This is part of my .mod…
Ranajit
  • 49
  • 6
0
votes
1 answer

Get Constraint Label (not index) on CPLEX Log using PYOMO

I´m running a MIP model on PYOMO calling CPLEX as a Solver. I´m receiving the following log: Implied bounds make row 'c_e_x1835719_' infeasible. I would like to know which of my constraints c_e_x1835719 is representing. How should I accomplish…
Bruno
  • 87
  • 5
0
votes
1 answer

Method to get down and up objective valuses at each node in CPLEX concert C++?

I would like to compute strong branching with getStrongBranch function in CPLEX concert with C++. getStrongBranch(IloNumArray downobj, IloNumArray upobj, const IloNumVarArray var, IloInt itmax) The method like getObjValue reports the value of…
usercp
  • 9
  • 3
0
votes
1 answer

AMPL (cplex& gurobi): How to implement 'if statement' as constraint?

I need to implement an if-statement as a constraint. But, my code continuously gives an error. 'open_house[i]' is a binary variable (1 means 'open' and 0 means 'not open'). 'people_to_house[j,i]' is also a binary variable (if person-j is assigned…
user12554611
0
votes
1 answer

Can I run IloOplExec() Cplex function from c# code?

I found IloOplExec() function for Cplex on internet. But I can't use it in my C# code? I think it is for Java code. How can I use it in C#? Should I add a library or a class?
burak
  • 71
  • 6
0
votes
1 answer

CPLEX: How to get the real running time in a deterministic way? (Python)

I solved an MIP problem, with making the solving process sleep for 1 second every branch using BranchCallback (single thread). I noticed from the log that the system time measured in seconds changed every run, while the deterministic time measured…
Icarus
  • 25
  • 4
0
votes
1 answer

How get to bestbound and mipgap (CPLEX_CMD)?

I´m working with CPLEX_CMD because i Needed to use MIP_start. Before I used CPLEX_PY and the command that did these: a = prob.solverModel GAP = a.solution.MIP.get_mip_relative_gap () BestBound = a.solution.MIP.get_best_objective () How can I get…
Juan S. P.
  • 31
  • 5
0
votes
1 answer

How to increase number of Cplex solutions?

I have this cplex model that has 1 binay variable (x_i). Now I have 2 questions regarding its cplex solutions (I put them in one post because they are related). First: For my model I get 26 solutions but I know in reality there are much more…
Sana.Nz
  • 81
  • 11