Optimization Programming Language

Optimization Programming Language
ParadigmAlgebraic modeling, Constraint programming, Constraint logic
Designed byPascal Van Hentenryck
DeveloperIBM (originally ILOG)
First appeared1998 (1998)
Stable release
22.1.1 (within CPLEX Studio) / December 2022; 3 years ago (2022-12)
Typing disciplineStrong, static
OSWindows, Linux, macOS, AIX
LicenseProprietary
Websitewww.ibm.com/products/ilog-cplex-optimization-studio
Major implementations
IBM ILOG CPLEX Optimization Studio

Optimization Programming Language (OPL) is an algebraic modeling language for mathematical optimization models, which makes the coding easier and shorter than with a general-purpose programming language.

It is part of the CPLEX software package and therefore tailored for the IBM ILOG CPLEX and IBM ILOG CPLEX CP Optimizers. The original author of OPL is Pascal Van Hentenryck.[1]

Characteristics

OPL allows users to define models using high-level mathematical notation. Its primary features include:

  • Separation of Model and Data: OPL promotes a clean architecture where the optimization logic (stored in .mod files) is kept separate from the instance data (stored in .dat files).
  • Hybrid Modeling: It is one of the few AMLs that natively supports both Mathematical Programming (MP) and Constraint Programming (CP) within the same environment.
  • Scheduling Support: OPL includes specialized primitives for scheduling problems, such as interval variables, sequence variables, and cumulative functions.
  • Scripting: It includes IBM ILOG Script, a JavaScript-based language used for data pre-processing, controlling the solving flow (e.g., solving a sequence of models), and post-processing results.

Example

The following is a simple OPL model (.mod) for a Knapsack problem:

// Knapsack capacity, provided externally in the data file
int capacity = ...;

// Item index set
range Items = 1..5;

// Item parameters: one value and one weight per item in Items
int value[Items] =  [6, 7, 3, 9, 6];
int weight[Items] = [11, 7, 9, 13, 12];

// Decision variable: 
//   x[i] = 1 if item i is selected
//   x[i] = 0 otherwise
dvar boolean x[Items];

// obj: maximize total value of selected items
maximize obj: sum(i in Items) value[i] * x[i];

subject to {
  // total weight of selected items cannot exceed capacity
  sum(i in Items) weight[i] * x[i] <= capacity;
}

The associated data (.dat) file is

capacity = 10

Integration

While OPL is typically used within the CPLEX Studio IDE, it can also be deployed in production environments. IBM provides APIs (such as the Concert Technology) that allow OPL models to be called from Java, C++, .NET, and Python.

See also

References

  1. ^ Kevin Ruland (September 1999). "The OPL Optimization Programming Language". INFORMS Journal on Applied Analytics. 29 (5): 148–149. ISSN 0092-2102. Wikidata Q124605115.

Further reading

  • Van Hentenryck, Pascal (1999). The OPL Optimization Programming Language. MIT Press. ISBN 978-0262720304.


Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.