Questions tagged [opl]

Optimization Programming Language (OPL) is an algebraic modeling language to describe models of optimization and mathematical programming. It is part of IBM ILOG CPLEX Optimization Studio.

Optimization Programming Language (OPL) is a high-level, mathematical language for the description of optimization models, which produces substantially simpler and shorter code than general-purpose programming languages.

438 questions
1
vote
1 answer

CPLEX opl constraints that encode compatibility

The goal of the opl model below is to choose the freights with total minimum cost to fulfill all orders, I have a constraint where only compatible MaterialCategory could be allow to put on a freight. Currently the optimal solution is to use the…
william007
  • 17,375
  • 25
  • 118
  • 194
1
vote
1 answer

CPLEX opl constraints that count unique string

The goal of the opl model below is to choose the freights with total minimum cost to fulfill all orders, I have a constraint of the order on a freight must be delivered to <= 2 clientId. Currently the optimal solution is to use the third freight for…
william007
  • 17,375
  • 25
  • 118
  • 194
1
vote
1 answer

How to solve CPLEX Error 5002: 'co01#0#1' is not convex.->

I'm trying to solve mixed-integer linear programming with CPLEX 12.10 OPL and facing an error. I ran the configuration and get this error: -Exception from IBM ILOG CPLEX: CPLEX Error 5002: 'co01#0#1' is not convex.->. -Processing failed. Here is my…
1
vote
1 answer

Docplex return first feasible solution found

I'm trying to solve a NP-Hard problem using docplex and cplex and I need that docplex return the first factible solution founded and stop the search. In general, stop when find the nth best solution. Something like that: set limits solutions n
Sebastian Jose
  • 301
  • 2
  • 9
1
vote
1 answer

CPLEX execute block is not being run from VBA

I have a model written in OPL, that is called from VBA. Afterwards an execute block is made, but when the call from VBA is made, the execute block does not run. // Create Parameters: {string} G1 = ...; // Set of teams in first group {string} G2 =…
shau
  • 11
  • 1
1
vote
1 answer

How to avoid very small values for continuous decision variables in CPLEX OPL

I have a few continuous variables(decision variables). When the optimisation is run some variables get solution of very small decimal numbers like 0.00000123 etc. I do not want the variables to take such values, but I want to allow them to have 0…
Ranajit
  • 49
  • 6
1
vote
0 answers

Computation Speed differs between OPL and Docplex

I've got a problem at solving an MIP with Docplex. The computation speed for my problem differs between 35 and 120 seconds while it is solved within 5 seconds using the OPL version. The model formulation does not differ between Python and OPL. Does…
1
vote
2 answers

How can I resolve the conflict problem in my constraint

int n = 70; int f = 2; int q = 30; range I = 1..n; range J = 1..q; range K = 1..f; dvar boolean X[I][J][K]; dvar boolean h[I][J]; dvar float d1p[I]; dvar float d1n[I]; subject to { forall( j in J) C1_a: sum(i in I) X[i][j][1]…
Muktar
  • 11
  • 1
1
vote
1 answer

Is there a way to insert decision variable in index range without using Constraints Programming in CPLEX?

I have the following indexes: k: index for days: k ∈ {1, ..., K=365} i: index for tasks: i ∈ {1, ..., N=200} j: index for the j^th time of task i: j ∈ {1, ..., Fi} With F_i is a…
minh dang
  • 23
  • 4
1
vote
1 answer

Has anyone used Ford Fulkerson's algorithm in OPL?

I have a problem that can be modelise with a graph, need to implement it with opl and apply a maximization with Ford Fulkerson's algorithm. I didn't find anything made with opl...
pukito
  • 13
  • 2
1
vote
1 answer

CPLEX OPL Error- Sheet data not supported on this platform

I have a large OPL problem which in the last run has run for 9+ Hrs, the engine log says 32 solutions found. The last lines in the .dat file are SheetWrite. The results are not being written back to Excel and the error is : Sheet data not supported…
Ranajit
  • 49
  • 6
1
vote
1 answer

I can not reach the array' s previous iteration values in OPL Script

I have a MIP model in CPlex. In each iteration I use different .dat files and solve the problem. I hold the decision variable solution values in a multi dimensional array like "Array[iteration][i]", "i" is the decision variable's index and…
MerveIb
  • 17
  • 3
1
vote
1 answer

Proper way to use opl.set_input() of doopl for parameters (not tuple)

I'm trying to run the CPLEX .mod file within Python. An instructor on how to do this exists in the following link: How to run a .mod file (CPLEX) using python? But it seems that (maybe) only the tuple is sent from Python into CPLEX. In my case,…
1
vote
0 answers

Return the maximum value of a variable array C-plex

I have tried to return the maximum value of the pbefore[t] array using maxl function, but it didn't work. is there any possible way to do it? Thanks in advance. dvar float dvar float+ pbefore[t]; forall(h in Gwsystem,t in time) Gw == GW[h].Gwc*…
1
vote
1 answer

Defining a directory for calling CPLEX within Python

I want to run a .mod file written in the OPL language (CPLEX IDE) from Python. For this aim, I use the following commands: from doopl.factory import * with create_opl_model(model=model_file) as model_name: model_name.run() But of course, at…
1
2
3
29 30