API for Benders algorithm

CPLEX implements Benders algorithm in all its application programming interfaces (API).

CPLEX offers an application programming interface for Benders algorithm, a cut-generating linear program (CGLP) in C, C++, Java, .NET, and Python. The Interactive Optimizer also supports Benders algorithm.

Callable Library (C API) for Benders

The routine CPXXbendersopt and CPXbendersopt implements Benders algorithm in CPLEX as a means to solve a linear program (LP) or mixed integer program (MIP) as a decomposed model consisting of master and workers defined by a partition of the original model.

Corresponding asynchronous, join, and multicast routines enable your applications to apply Benders algorithm to solve a decomposition of master and workers in parallel. See Benders Algorithm and Decompositions in the CPLEX Callable Library (C API) in the Callable Library (C API) Reference Manual for documentation of these routines.

Symbolic constants in the Callable Library (C API) support the parameter Benders strategy. See the documentation of that parameter in the CPLEX Parameters Reference Manual for more detail about the effect of these symbolic constants:
  • CPX_BENDERSSTRATEGY_OFF
  • CPX_BENDERSSTRATEGY_AUTO
  • CPX_BENDERSSTRATEGY_USER
  • CPX_BENDERSSTRATEGY_WORKERS
  • CPX_BENDERSSTRATEGY_FULL

C++ API for Benders

To use Benders features of CPLEX in your C++ application, optionally annotate your model; then set the parameter Benders strategy accordingly, and invoke optimization with IloCplex::solve.

The enumeration BendersStrategyType includes the following values to support your choice of Benders strategy in your C++ Application:
  • BendersOff
  • BendersAuto
  • BendersUser
  • BendersWorkers
  • BendersFull
See the documentation of the parameter Benders strategy for more detail about the effect of those values.

Java API for Benders

To use Benders features in your Java application, optionally annotate your model; then set the parameter Benders strategy accordingly, and invoke optimization with IloCplex.solve.

The class BendersStrategy includes the following values to support your choice of Benders strategy in your Java Application:
  • Off
  • Auto
  • User
  • Workers
  • Full
Use those values to set the Benders strategy parameter. See the documentation of the parameter Benders strategy for more detail about the effect of those values.

.NET API for Benders

To use Benders features in your .NET application, optionally annotate your model; then set the parameter Benders strategy accordingly, and invoke optimization with Cplex.Solve.

Python API for Benders

To use Benders features in your Python application, optionally annotate your model; then set the parameter Benders strategy accordingly, and invoke optimization with cplex.solve.

Interactive Optimizer commands for Benders

In the Interactive Optimizer, follow these steps:
  1. Read in your model as usual. Optionally, read your annotations from a formatted .ann file.(For more about ANN files, see ANN: annotations for modeling elements in the reference manual File formats supported by CPLEX.)
  2. By means of the Benders strategy parameter, specify the Benders strategy that you prefer. For example, if you supply annotations for CPLEX to use, type the command:
    set benders strategy 2
    or if you reply on CPLEX to decompose your model, type the command:
    set benders strategy 3
  3. Invoke the usual optimization command.