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

Modeling the Objective Function in the CPLEX Java API

I#m trying to model the objective function sum(i in Sites,j in Sites, k in Routings)(c[i][j] * x[i][j][k]*TruckKmCost) in Cplex using java. IloLinearNumExpr expr = cplex.linearNumExpr(); for (int i = 1; i <= nbFarmer; i++) { …
nona
  • 84
  • 6
0
votes
1 answer

Import Data in cplex from excel (xlsx file)

I have an excel table and I want to put one column of this table in a vector in .dat file. Here is what I have : First solution with the complete path : SheetConnection sheet("C:\Users\Hor246\opl\Bushfire\month_01_omission.xlsx"); Value from…
0
votes
1 answer

CPLEX Barrier Method Iteration Limit

I am trying to solve a nonconvex-quadratic optimization problem on CPLEX, with setting optimality target to 2. Trying with different data sets I observed that the barrier method stops at the 500th iteration. I checked the settings, it is set to a…
0
votes
2 answers

What is the default location for saved cplex solutions

Running cplex/pyomo the solver found a solution and it reported saved somewhere though I closed before taking note, can't find over the web where is it stored. running windows, anyone?
ma7555
  • 362
  • 5
  • 17
0
votes
1 answer

Pyomo Integer Programming - Setting specific variables to fixed numbers heurestically

Using pyomo/cplex: Suppose I have a cost function that takes 25 integers to be solved, each integer could be from (0 to 4) The real model is more complex than this but I am trying to minimize the idea. model.x = Var(range(25), range(5),…
ma7555
  • 362
  • 5
  • 17
0
votes
1 answer

How to represent and read 4D array in Opl Cplex from Excel

How can I represent and read a 4D array from Excel to Opl Cplex? The 3D IBM array link is not helpful, trying to adapt to 4D does not work.
0
votes
1 answer

Linking CPLEX result to another CPLEX program

I'm working on an optimization problem at the moment and I'm trying to use the results I receive from the VRPTW for a bin packing problem. Does anyone now how to automatise that? Right now I'm typing in the results manually. Thanks for helping a…
nona
  • 84
  • 6
0
votes
1 answer

CPLEX - Overflow occured (OPL IDE)

enter image description here I am running a code with millions of decision variables and close to 60000 constraints. I added 7000 new constraints and am receiving this error - CPLEX Overflow occurred. I doubled the memory of the virtual machine…
0
votes
1 answer

How to display a solution with using timelimit in CPLEX for scheduling(CP)

Now I am trying to get a solution within a specific time-limit in my code. Actually, my problem(scheduling) is NP-hard. It spends lots of time to get a solution or out of memory. So, I set a time-limit in my code(60s) and I'd like to get a…
0
votes
2 answers

Deserialize xml with different format in C#

I hope you have a great day! I am now struggling to parse XML (especially for CPLEX Sol file formatted by XML) to C# class. I defined a class as shown below. [XmlRoot("CPLEXSolutions")] public class CplexSol { [XmlElement("CPLEXSolution")] …
Thomas J
  • 35
  • 9
0
votes
1 answer

Cplex how to use variables for indexing in constraints

I am trying to use decision variables Y to update index of decision variable X in constraint. However, it does not seem to work in Cplex. Any help is appreciated, thanks a lot in advance. Here is my code: // Parameters int Tmax = ...; int u[i][r][m]…
liu chao
  • 1
  • 2
0
votes
0 answers

Minimize percentage of delays with Docplex

I have a pandas dataframe like this: tail_n | flight_route | Percentage_delay _______________________________ 'N14125' | '(VB, MI)' | 0.1 | '(CC, SK)' | 0.5 | '(KF, KC)' | 0.3 'N351JB' | '(AZ,…
coelidonum
  • 523
  • 5
  • 17
0
votes
1 answer

CPLEX-OPL: New bound is 0 and no result when adding a new constraint

I tried to run a MILP (OPL) on CPLEX 12.8.0. After add this constaint to the model and run, engine log as showed and get no other reuslt. how do i fix this problem ? Thank you. EQ11 : // 1TruckPourAtSameCustomer&Time; forall(c in customer, m in…
Natdanai I.
  • 49
  • 1
  • 8
0
votes
1 answer

Minimum of two constraints

I want to write a minimum function in OPL. forall(p in P) sum(n in N)Q6[n][p]==(Max_Rema[p]*Dem[p]) forall(n in N)sum(p in P)Q6[n][p]<=sum(m in M)Q4[m][n]; I want that Q6 should be equal to minimum ofMax_Rema[p]*Dem[p] and sum(m in M)Q4[m][n],…
Manjot
  • 9
  • 4
0
votes
1 answer

Cplex: model formulation and programming method

I'm solving a hospital staff scheduling problem in Cplex. I'm new to cplex so really appreciate if I can get any help! Problem description: There is a set of doctors, working each day for "Day", "Evening" and "Night" period.There are also typical…
1 2 3
99
100