GAMS Java API - Tutorial and Examples
This example demonstrates a sequential implementation of a simple Benders decomposition method for a stochastic linear program. More...
This example demonstrates a sequential implementation of a simple Benders decomposition method for a stochastic linear program.
The underlying model implements a simple distribution system with stochastic demand data. The master and the subproblems are implemented with the GAMSModelInstance object which allows resolving the model with modified input without regenerating the model. A GAMSModelInstance has a fixed model rim, so this provides a challenge for Benders master problem because every iteration adds new constraints (the Benders cuts) to the master. We get around this limitation of GAMSModelInstance by initializing the GAMSModelInstance of the master with a fixed number of empty (i.e. non-binding) placeholders constraints and during the run of the algorithm turn these placeholder constraints into valid Benders cuts.