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.
- 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.
- BendersOff
- BendersAuto
- BendersUser
- BendersWorkers
- BendersFull
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.
- Off
- Auto
- User
- Workers
- Full
.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
- Read in your model as usual. Optionally, read your annotations
from a formatted
.annfile.(For more about ANN files, see ANN: annotations for modeling elements in the reference manual File formats supported by CPLEX.) - 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:
or if you reply on CPLEX to decompose your model, type the command:set benders strategy 2set benders strategy 3 - Invoke the usual optimization command.