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

CPLEX/OPL model for transshipment (network flow)

I am pretty new to CPLEX. I searched for some solution for the last couple of days, but I could not find. SO,in addition to my production transportation model, I want to add something that allows transshipment between warehouses. So in addition…
jen p
  • 1
  • 2
0
votes
1 answer

CPLEX and MOSEK with YALMIP gives different results

I am solving an optimization problem using MATLAB with YALMIP which is similar to a unit commitment problem. This is a Mixed Integer Linear Programming problem. I am considering two decision variables --> P and T_room I formulated the problem in…
0
votes
1 answer

Rectangle scheduler using CPLEX constraint programming

I need to schedule a set of rectangles in a big rectangle (named bin) using the constraint programming. As I'm using CPLEX, i found out the square sched example (I'm in fact new to CPLEX and PPC). When I have adapted the example for rectangle case,…
0
votes
1 answer

CPLEX OPL - How to read a set of variable length from Excel

I want to read a tuple from my Excel file for my OPL model in CPLEX, which has the following format: tuple A { string a; int b; {string} c; } The set {string} c of each tuple element is of variable length. How can I read this via…
0
votes
1 answer

Fixing vs removing variables in a CPLEX problem

I am working with C API of CPLEX. I have a bunch of optional binary variables (which can constitute any percentage of the total number of variables). I tried solving my BIP model both ways: (i) fixing them to 0 and (ii) not having these variables…
0
votes
0 answers

mathematical programming to optimize machine utilization?

I have to optimize this (see image) but I have to do it with respect to lambda (use of machines) and b (batch sizes), I'm using intellij idea using the cplex library, but I get an error: CPLEX Error 5002: 'q1' is not convex , I don't know how to…
0
votes
1 answer

Cplex: cannot get value for decision variables

I'm solving a hospital staff scheduling problem in Cplex and I'm new for Cplex. But Cplex cannot configure answers of decision variables. I think maybe it's about my model design problem. It's a long model. Very appreciate if I can get…
0
votes
1 answer

CPLEX maximization of revenue

I'm working on a project on cplex and this is the case: it's a chemical plant where's produced and sold 2 final products there are 3 reactors and each reactor can perform different tasks, one at a time the objective function maximizes the total…
0
votes
1 answer

Cplex: How to write constraints for designated string

Please help me write constraint in Cplex. I'm solving a staff scheduling problem. I have following sets: {string} I=...; // set of all physicians {string} E=...; // set of experience levels {string} K=...; //type of shifts {string} A=...;//work…
0
votes
1 answer

Solving a Convex and Linear Program

Hello all, I am very new to optimization. What could be the best approach to solve this problem? I have used cplex to solve these ending up in the bay. Can any one guide me for possible solution using matlab. The code I used in Cplex dvar…
0
votes
2 answers

ILOG CPLEX / OPL dynamic Excel sheet referencing

I'm trying to dynamically reference Excel sheets or tables within the .dat for a Mixed Integer Problem in Vehicle Routing that I'm trying to solve in CPLEX (OPL). The setup is a: .mod = model, .dat = data and a MS Excel spreadsheet I have a 2…
anonymthe
  • 27
  • 4
0
votes
2 answers

Conditional Statement with Decision variables and Multiple relations

This is from CPLEX. I tried doing this but getting no results. Basically my model need a forall statement with these two conditions using decision variables and multiple relations under that. All the equality constraints. Can anyone explain what is…
0
votes
1 answer

How do I Implement "Continuous with Minimum or Nothing" Variables in DocPlex?

I have a 5-20 variables in my problems, and generally for 3-6 the allowable solution space is either continuous down to a minimum value or exactly zero. For example, in one problem the first variable (x0) can be either be between 250-1000 or it can…
rhaskett
  • 1,864
  • 3
  • 29
  • 48
0
votes
1 answer

CPLEX Python API how to multiply a decision variable with a dummy in the objective function?

I am trying to add a multiplication of variables to the objective function. I have x_t which is an integer and I have a binary variable w_t_1. I want to have in the objective function -1200 * w_t_1 * x_t. How can I do it? I couldn't find anything in…
0
votes
1 answer

How to use atan (tan inverse) in OPL. I have tried Math.atan and Opl.atan

I want to get the tan inverse of a function. The rest of the function works ok but as soon as I add the atan part I get error. I am now trying with a small expression float a = Math.atan(1); But still I get an error: syntax error, unexpected '(' …
Ranajit
  • 49
  • 6
1 2 3
99
100