Questions tagged [cplex]

Questions related to the commercial solver IBM ILOG CPLEX Optimization Studio.

Filter by
Sorted by
Tagged with
2
votes
1answer
42 views

Benders implementation on Cplex is very slow

I'm working on a location problem and I have an issue with the Benders decomposition. I'm using Cplex with Python. I coded a single cut and a multi-cut to compare. The single-cut implementation takes ...
1
vote
0answers
42 views

CPLEX keeps restarting in Pyomo

I tried running my model by adding the following settings to CPLEX. ...
5
votes
2answers
136 views

How to linearize a quadratic constraint to add it then via a callback function

Suppose we have a positive continuous variables $0 \le x \le UB$ where $UB$ is a known upper bound. How can we linearize the term $x^2$? Detailled problem: Suppose that via a callback we compute a ...
3
votes
1answer
118 views

CPLEX Python API Manual with References

I am currently attempting to code a model using the Python API. However, the IBM Site seems to not have one that is similar in formating and content depth such as those for C++ or Java (examples and ...
3
votes
1answer
65 views

Find a particular optimal solution

After writing an integer linear program in AMPL, I solved it using CPLEX. Now, I have some variables that must necessarily be 1, others that must necessarily be 0 and finally it is possible that some ...
0
votes
1answer
63 views

how can I use warm start in C#

I have been working on a MIP in C#. I want to reduce the gap, so I'm trying warm start. I use this code just before solve(). ...
2
votes
1answer
91 views

Problem with implementing squared terms in the objective function

I'm trying to implement either one of these objective functions, but I'm having a hard time with the squared terms. I'm attaching both so you can take a look at the structure and see if you can give ...
6
votes
1answer
124 views

CPLEX MIP warm start seems slow down the program?

I have been working on a combinatorial optimization problem which can be modeled as an integer linear programming. I implemented it as a c++ project in visual studio 2017 and CPLEX1271. With the hope ...
7
votes
1answer
139 views

Optimization software for ARM Architecture

Given that tomorrow Apple will likely announce the first ARM Macs (per bloomberg), I was wondering what the current status of ARM support in optimization software. For instance, does anyone know if ...
1
vote
2answers
202 views

Downloading and setting up CPLEX for Pyomo

I have just installed Anaconda and am intending to use Spyder as it is able to display variable, parameter values for debugging. After which, I am planning to use Pyomo to code my MIP model and invoke ...
2
votes
1answer
55 views

How to determine whether the solution is integer feasible in a CPLEX heuristic callback?

I am working with a MILP formulation of a routing problem using Concert CPLEX 12.10. And I am implementing a greedy heuristic that uses the variables fractional values to attempt to construct an ...
3
votes
2answers
119 views

Using R for coding Matheuristic for Research Publication

Given that R possesses superior data pre-processing and post-processing packages, I am thinking of coding a matheuristic using R for publishing in an academic research journal. However, I am unable ...
1
vote
1answer
66 views

Cplex giving different solutions for equivalent Linear problems

I'm trying to simplify a linear problem by removing "useless" variables and constraints. After simplifying my initial problem and solving both instances with Cplex, it seems like the results differ ...
2
votes
2answers
134 views

How to use tight upper and lower bounds to get to the optimal value via branch and bound?

I have algorithms that get me a tight upper (UB) and lower (LB) bound to a maximization binary integer program (a routing problem). My formulation is non-compact and requires the addition of sub-tour ...
2
votes
1answer
80 views

shortest path problem,I want to write constraints in closed form

the constraints in the photo ,I need to translate to the closed-form I don't know how can I do this. Can you help? I need to write the mod file and dat file in Cplex for this problem
3
votes
1answer
65 views

Why does the getTime() function from cplex concert returns wrong value?

I am running a MILP formulation (implemented in C++) with the Cplex Concert Technology 12.10, and I am trying to get the total elapsed time. So till the moment, I have tried three approaches: Be ...
1
vote
0answers
60 views

Ways to improve lower bounds while solving MIPs

What are the ways to improve lower bounds while solving a minimization problem (MILP)?
3
votes
1answer
150 views

Cplex : The cutting stock problem

The problem below aims to minimize the cutting leftovers from each cut : A company manufactures desks for kids gardens and primary schools, colleges and high schools. The leg of these deks all have ...
5
votes
3answers
195 views

Problem with binary decision variable constraints in VRP

I would like to create non-linear violation costs in my VRP. I already created my whole VRP with time windows in which I have these decision variable: ...
2
votes
1answer
79 views

Nested set in OPL/CPLEX

I'm trying to solve a scheduling problem using OPL/CPLEX. In the model, there are nine tasks in which each task has its specific precedence. the precedence relationship is as follows: ...
1
vote
1answer
69 views

ILOG Cplex out of scope

...
5
votes
3answers
407 views

How can I represent null or dashes in a cost matrix or incidence matrix in CPLEX?

In the image below, the cost matrix of customers and supplier has several dashes which indicates the impossibility of certain suppliers with certain customers. How can I represent these dashes in ...
1
vote
1answer
227 views

What is wrong with my linear programming model?

I tried solving this problem Here is my cplex code I have mentioned stored[month] as float+ but in the final result I get negative values. What is wrong with my model?
7
votes
1answer
74 views

Duals in CPLEX generic callback

When using a generic callback in the "relaxation" context, it is fairly clear how to get values of the primal variables in the LP relaxation (along with a bunch of other stuff), but I can't seem to ...
5
votes
1answer
362 views

Where can I find resources to learn mathematical modelling for real life operation research problems like combinatorial optimization?

I find it hard to form math models for real life operations research problems, how can I learn this? Any books, tutorials available?
2
votes
1answer
85 views

How to formulate logical or constraint in cplex?

How to write the following constraint in cplex? the cost for full truck load is $700 and the cost of fractional truck load is \$800 *fraction up to $700
0
votes
1answer
114 views

How to form math model to solve this problem using cplex

Hiring company has the following requirement within a year; week 1 to 5: 20 week 6 to 20: 40 week 21 to 40: 35 week 41 to 60: 55 week 61 to 80:75 week 81 to 100: 60 Training time for an ...
4
votes
1answer
147 views

How to read a solution file (.sol) in cplex python API?

I've been to trying to read a .sol file in cplex python API before solving the problem but couldn't find any command to do so. There are analogous commands for this ...
8
votes
1answer
146 views

Can Gurobi or CPLEX handle nonlinearly constrained problems?

Though my title is quite general (please feel free to edit), indeed, I wonder if the following models can be solved in Gurobi or CPLEX. Model 2 is just an alternative one to Model 1. Although we ...
4
votes
1answer
93 views

Constraint programming in OPL: intervals covering time slots

I am trying to model the following: There is a shop open from xx AM to yy PM. In each 30 min time slot, there have to be demand[timeSlot] = x employees present. E.g. the shop is open from 08am to ...
6
votes
2answers
231 views

Cplex 12.10: How can I solve an LP relaxation?

I have an IloCplex object which contains a MILP. Is there a way to obtain the objective value of its LP relaxation, without having to rewrite the entire model as ...
3
votes
1answer
68 views

Logical operation on an array in DOCplex

Here is a simple example of logical operation in docplex taken from here. Code below works fine. ...
3
votes
1answer
55 views

How to set combined stop condition in AMPL/CPLEX?

I would like to set a stop condition combined of a timelimit and a relative MIP gap. So I would like AMPL/CPLEX to look for the solution of my LP for an hour and if there isn't a solution stop if or ...
5
votes
3answers
227 views

No solution found from n MIP starts

Currently, I am working on the implementation of a MILP formulation with lazy constraints for an optimization problem, and I am using the MIP Start strategy. I am generating the integer feasible ...
6
votes
1answer
110 views

Optimal Energy Charging/discharging Scheduling Problem

I'm new to IBM CP optimizer. I want to make charging / discharging scheduling based on cost (value will change on time) and my objective function is $$\sum_{t=1}^{24}\sum_{j=1}^5x(1)^{(t,j)}x(2)^{(t,j)...
5
votes
1answer
60 views

Tolerance for equality in GAMS/CPLEX

Is there an option in GAMS that sets the tolerance for declaring two real numbers to equal? For example, how can I tell GAMS or GAMS/CPLEX that $0.999100 = 0.99909$? Thank you for your help!
6
votes
1answer
137 views

Negative reduced cost for basic variable

I am observing something unusual : after solving a linear program, some basic variables have negative reduced costs (instead of $0$) : ...
5
votes
1answer
59 views

How to formulate case distinctions in AMPLs objective function?

This is my first real optimisation problem I formulated and now trying to solve by using AMPL. The following objective function is from a linear 0-1 LP means all variables $x_i^b\in\{0,1\}$, with $i\...
8
votes
3answers
457 views

CPLEX, number of threads and solving time

Using CPLEX via its Python API, I encountered a "weird" behavior. For some instances, with a limited number of threads (10 in my tests), the instances cannot be solved after 10 days (afterwards, the ...
8
votes
1answer
179 views

Check which constraints are violated (Concert - Cplex Studio 12.10 - C++)

Currently, I am working on the implementation of a formulation for an optimization problem, at the moment I already have the MIP formulation implemented in C++ using Cplex studio 12.10 with the ...
10
votes
2answers
421 views

Solving multiple easy ILP instances

I have an application where I am solving millions of ILP instances that differ from each other only on one constraint. The instances, of course, are relatively easy to solve or otherwise this would be ...
11
votes
1answer
112 views

CPLEX allows manually inserted solutions to violate lazy constraints

I am using CPLEX 12.9 to solve a mixed integer linear programming problem. Some of my constraints are enforced through a legacy LazyConstraintCallback. Heuristic solutions are inserted through a ...
11
votes
1answer
249 views

k-means/k-medoids Clustering Implementation in CPLEX Java

I am trying to model a grouping algorithm as k-means clustering problem, by referring to the general definition as mentioned in Wikipedia. In my system, I have $N$ nodes that I want to group in $m$ ...
4
votes
1answer
217 views

CPLEX Python API

I am trying to run the following optimization problem at Python by using the CPLEX API: $$\min \{x_1 + x_2\ | \ x_1 \geq 3, x_2 \geq 2, 2x_1 + x_2 \geq 9\} $$ I just want to give a matrix of ...
3
votes
2answers
192 views

Problem with big-M in CPLEX OPL

I have a model for the no-wait flow shop scheduling problem, that utilizes the linear ordering variables, and there is a constraint with big-M. When I implement the model in ...
7
votes
2answers
291 views

How can I implement a user-written lazy constraint callback in concert CPLEX with C++?

I am trying to implement a user-written lazy constraint callback in concert CPLEX with C++. Although I know there exists a way to implement callbacks in concert CPLEX with C++ via macros, I am looking ...
4
votes
2answers
102 views

Can I export to .cpo file using OPL?

I have a model written in CPLEX OPL. Is there a way to export the model to .cpo extension? In Python ...
6
votes
0answers
175 views

Cplex is stuck after root node relaxation solution

I am solving an MIP through Benders decomposition (coded both generic and legacy callback versions), by employing Java with Cplex 12.9. For some of the instances, Cplex is stuck for two hours (time ...
9
votes
1answer
219 views

Integrating genetic algorithm (or other heuristic methods) with CPLEX

[Topic to discuss GA and CPLEX] I've seen some papers trying to integrate genetic algorithm with CPLEX, such as here and here. Although they integrated both, it is done in 2 different steps; that ...
7
votes
3answers
434 views

Constraint programming using solver: how to state the time limit of search?

Could someone give additional explanations about the TimeLimit of CPLEX for CPO? I am using CPLEX to solve a problem of assignment and scheduling in which each task needs to be assigned to a worker, ...