Questions tagged [cplex]

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

Filter by
Sorted by
Tagged with
2
votes
0answers
26 views

Bioinformatics / Genomics Optimization Problems?

I am a third year bioinformatics student and would like to apply my knowledge from an introductory course in Optimization Methods to some problems in the field of genomics or bioinformatics. Do you ...
1
vote
1answer
29 views

Get array of sequences for array of interval arrays in OPL

So I want to define multiple sequences (an array of them). I have this: ...
5
votes
2answers
83 views

how to determine differents gap rate?

I found in the literature different gaps: a gap between a random solution and an exact solution a gap between the exact solution and a lower bound a gap between the exact solution and a lower bound a ...
5
votes
0answers
100 views

Obtaining the system of irredundant inequalities from a set of inequalities using CPLEX

Given a linear system of inequalities $Ax \geq b$, I would ideally like to compute the irredundant set for those set of inequalities. I know how to do so mathematically, but I was wondering if there ...
2
votes
2answers
160 views

implementation of heuristics using C++ to solve operations research problems

can anyone suggest some good books with the implementation of heuristics and matheuristics using C++ to solve operations research problems especially routing problems such as TSP and VRP. also, I need ...
16
votes
4answers
2k views

What are the advantages of commercial solvers like Gurobi or Xpress over open source solvers like COIN-OR or CVXPY?

I come from an ML background, and occasionally have to dive into the OR world. I am trying to figure out whether I need to purchase a commercial solver license for a certain problem set. In the ML ...
4
votes
1answer
99 views

MILP Minimum set Vertex cover coding by Python or MATLAB?

As a following up for my question for modeling a simple moded of the minimum set vertex cover problem, which is shown next. I would like to have your help in modeling this problem using Python or ...
3
votes
1answer
106 views

How do I interpret the CPLEX Optimization Studio MIP gap output?

I'm having difficulties understanding my FlowControl output compared to what the Engine Log shows me. My output from the FlowControl into the Scripting Log (yellow marks) is ...
0
votes
1answer
154 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 ...
5
votes
1answer
104 views

Add robustness of AMPL code through file name

I want to add robustness to my AMPL code, here is what I am actually doing: In my script I use a .txt file that contains all my parameters, lets call it "instance.txt". I want to print my ...
1
vote
2answers
80 views

Issue with number of threads on Cplex

I'm solving a bunch of similar problems and I want to compare them. To do so, I need everything to run on one thread. Even by setting the number of threads to 1, the model still runs on 8 threads. Has ...
1
vote
0answers
47 views

Making distinct modifications on a model

How can I apply different modifications separately on a model? The example in CPLEX documentation shows how to make modifications on a single solved model. However, unlike this example, I want to make ...
3
votes
1answer
124 views

Implementation of Local Branching

I've been recently reading some papers where the authors use local branching specifically in Benders Decomposition (see for reference). Although I understand up to some extend how the algorithm works, ...
2
votes
1answer
72 views

Can CPLEX output LP solution with primal variables only?

CPLEX writeSolution method outputs both primal and dual variable values of a LP. I know how to parse through the solution file to extract specific primal variable ...
2
votes
2answers
323 views

How can I identify the reason that makes a MILP model hard for solvers such as CPLEX?

I'm solving a MILP model whose native lower bound (via linear relaxation) is very poor. We could provide a lower bound by providing a given value (derived based on the problem itself). I know that ...
7
votes
2answers
367 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 ...
3
votes
1answer
127 views

Semi continuous constraints in CPLEX Python

I have a semi-continuous optimization problem reformulated as a MIQP optimization problem. My objective has a quadratic form $x^{T}Qx$ and my $x_{i}$ are such as $x_{i} \in [m,M] \cup \{0\}$. ...
2
votes
0answers
47 views

how to convert type of variable in CPLEX

I have an Integer Linear Problem which is solved quickly when I change my variable type to double. now I'm developing a fix and relax algorithm and I used conversion to change data type which takes a ...
3
votes
1answer
34 views

How can I change decision variable type in Concert Technologies (with Java)

I have a MILP model with continuous variables ($y_{ij}$) and binaries ($x_{ij}$). I am using Java and cplex 12.8 for implementation. Is there a way by which - using the Java-cplex API - I would be ...
3
votes
1answer
73 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
43 views

CPLEX keeps restarting in Pyomo

I tried running my model by adding the following settings to CPLEX. ...
6
votes
1answer
134 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 ...
5
votes
2answers
149 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
133 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 ...
0
votes
1answer
67 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(). ...
3
votes
1answer
75 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 ...
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 ...
11
votes
2answers
339 views

CPLEX Auto-Benders: How do I get the number of optimality and feasibility cuts?

I am using CPLEX's 12.9 auto-Benders decomposition feature (from the CPLEX Java API). Following the documentation I let CPLEX decide the decomposition strategy as ...
8
votes
1answer
207 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
722 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 ...
3
votes
2answers
131 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 ...
2
votes
1answer
85 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 ...
9
votes
1answer
271 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 ...
1
vote
1answer
69 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
144 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
85 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
99 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
66 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
161 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
200 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
115 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: ...
6
votes
2answers
354 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 ...
1
vote
1answer
71 views

ILOG Cplex out of scope

...
5
votes
3answers
427 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 ...
7
votes
1answer
94 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 ...
0
votes
1answer
233 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?
5
votes
1answer
384 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
103 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
4
votes
1answer
255 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
167 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 ...