Questions tagged [cplex]

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

Filter by
Sorted by
Tagged with
3
votes
1answer
80 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 ...
1
vote
0answers
46 views

I have a error on installing CPLEX 12.10 to Python 3.8 [migrated]

I am trying to install CPLEX studio 12.10 to Python 3.8. I'm using Visual studio code editor. Referring to https://www.ibm.com/support/knowledgecenter/en/SSSA5P_12.8.0/ilog.odms.cplex.help/CPLEX/...
5
votes
1answer
100 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
76 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
123 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
2answers
322 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 ...
1
vote
0answers
61 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 ...
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 ...
3
votes
1answer
108 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
45 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
33 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. ...
5
votes
2answers
142 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
126 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
72 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
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(). ...
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
132 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
166 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
529 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
73 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
127 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
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
138 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
83 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
63 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
159 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
198 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
100 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
417 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 ...
0
votes
1answer
232 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
86 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
382 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
100 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
141 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
215 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
158 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
97 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
316 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
80 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
57 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
295 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
111 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
62 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
216 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
61 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\...