Questions tagged [cplex]
Questions related to the commercial solver IBM ILOG CPLEX Optimization Studio.
115
questions
9
votes
1answer
302 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
71 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
154 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
101 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
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
170 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
140 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
73 views
5
votes
3answers
438 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
102 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
242 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
397 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
109 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
324 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
180 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
101 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 ...
3
votes
1answer
101 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.
...
6
votes
1answer
114 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
3answers
396 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 ...
5
votes
1answer
72 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!
5
votes
1answer
62 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\...
7
votes
1answer
324 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$) :
...
8
votes
3answers
581 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
315 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 ...
11
votes
1answer
310 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$ ...
9
votes
2answers
441 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 ...
4
votes
2answers
109 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 ...
4
votes
1answer
337 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 ...
11
votes
1answer
143 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 ...
4
votes
2answers
305 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
1answer
152 views
Program can't stop when using callback of usercut in CPLEX to solve a branch-and-cut problem
When I tried to use Java to call CPLEX and use callback functions to solve a VRP problem with branch-and-cut, some problems emerged.
I took out the subtour elimination constraint from the original ...
6
votes
0answers
249 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 ...
8
votes
3answers
518 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, ...
6
votes
1answer
137 views
Precedence constraints using binary variables - DOCPLEX
I would like to establish a precedence constraint to ensure the precedence relation of tasks. I have a set of tasks available, but required tasks are not always the same. It means, the tasks executed ...
9
votes
2answers
1k views
Python does not identify the academic version of CPLEX
Python does not identify the academic version of CPLEX.
I am using Linux, Ubuntu. I have Python 3.6. I installed CPLEX studio 12.9 (academic version installed via the file ...
5
votes
1answer
146 views
Scheduling with transition costs - DOCPLEX
I am dealing with a kind of scheduling problem. I have a set of tasks to be executed by a set of machines. It is known that different machines are able to execute the same task, but each machine can ...
12
votes
2answers
355 views
Debugging cplex model
I implemented a cplex model and I am convinced that the model should allow a better solution on a specific instance. However, when I impose the variable values of the solution onto the model, it ...
10
votes
1answer
129 views
How to access neighboring extreme points to an optimal extreme point of an LP?
Suppose that I have access to an optimal non-degenerate extreme point of an LP. I need to find some $\epsilon$-optimal extreme points. That is, a point $x$ where $c'x \le z^{*} + \epsilon$.
One way ...
14
votes
3answers
566 views
Using CPLEX “solution pool” to count feasible points
Some problems call for a count of the number of integer "lattice" points contained in a feasible region (rather than for locating the minimum or maximum objective function value in that region). See ...
8
votes
3answers
2k views
Python API and CPLEX
Note: See the EDIT below for one possible solution.
I apologize if this is not appropriate but I don't really have anywhere else to turn.
I was hoping that someone would be able to post how they ...
18
votes
2answers
3k views
How does a warm start work in LP/MIP?
Can someone explain how warm starts/ MIP starts work?
How do solvers like CPLEX/GUROBI use warm start with the Simplex algorithm?
I am interested in understanding how the entire warm start ...
10
votes
4answers
2k views
What do solvers like Gurobi and CPLEX do when they run into hard instances of MIP?
MIP is NP-Hard, so it is possible that an instance is very difficult and has multiple local minima that the search can get stuck in.
With a Metaheuristic Algorithm, the stochastic and approximate ...
9
votes
4answers
2k views
Why is there not a feasible solution for a MIP?
Is there a way to see why a solver (OR-Tools, CPLEX, Gurobi) cannot find a feasible solution when solving a MIP?
By that I mean, is there a possibility to show at which constraint and exact indices ...
11
votes
1answer
178 views
Specify the sense of a constraint in CPLEX
I am writing a small wrapper around Gurobi and Cplex so that the models I write are solver independent. I'm very familiar with Gurobi but I'm very new to Cplex and I'm having trouble replicating ...
10
votes
1answer
272 views
How to get solver time from CPLEX when using the NEOS server through Pyomo?
I've been using CPLEX on the NEOS server, via Pyomo, to solve a binary program I'm working on.
NEOS is amazing, but the documentation is somewhat lacking on the Pyomo side, so I haven't been able to ...
12
votes
4answers
1k views
Citing CPLEX 12.9
Simple question, but very hard to find an answer.
How can I cite version 12.9 of CPLEX? Shall I cite the very first CPLEX and indicate that I am using the version 12.9 of this, or shall I cite the ...
10
votes
2answers
692 views
How to get GAMS's solvers to work from Pyomo?
I want to run a model written in Pyomo language with CPLEX solver of GAMS.
However I get the following error:
...
7
votes
2answers
290 views
CP Framework/Solver for .Net Core
First I want to say that I'm very new to this field.
As far as I understand it, there are two different ways to use a Constraint Programming (CP) Solver:
Using the API from the Solver itself. For ...
10
votes
1answer
159 views
DOCplex adding columns
When using DOCplex to implement column generation, is it possible to add columns as an object, as opposed to creating a variable and then modifying the coefficients in the constraints?
Edit: In ...