Examples

TAG

The examples are tagged with the Benders method, solver backends, problem type, etc, to enable filtering.

Basic Examples

In the basic scenario, you can use the built-in Benders decomposition methods provided by BendersLib. This approach is suitable for standard problems that align with one of the predefined Benders decomposition frameworks. BendersLib offers several implementation of the Benders variants and the necessary Benders cuts and cut generators.

Branch-and-check Method

Branch-and-check Method

Combinatorial Benders using Branch-and-check Method

Combinatorial Benders using Branch-and-check Method

Annotated Benders Decomposition

Annotated Benders Decomposition

Simple Classical Benders Example

Simple Classical Benders Example

Combinatorial Benders Decomposition

Combinatorial Benders Decomposition

L-shaped Method

L-shaped Method

L-shaped Method with Convex Recourse

L-shaped Method with Convex Recourse

Integer L-shaped Method

Integer L-shaped Method

Generalized Benders Decomposition

Generalized Benders Decomposition

Advanced Examples

For more complex problems that do not fit the standard Benders decomposition patterns, BendersLib offers an advanced usage mode. This mode provides the flexibility to customize subproblem solver and cut generator, which are the key components of the Benders algorithm. This feature is especially useful for implementing Logic-based Benders Decomposition, as it allows the subproblem to be any type of optimization problem without a standard method for formulating Benders cuts.

Stochastic Logic-Based Benders Decomposition

Stochastic Logic-Based Benders Decomposition

Logic-Based Benders Decomposition

Logic-Based Benders Decomposition

Combinatorial Benders Decomposition (IIS)

Combinatorial Benders Decomposition (IIS)

L-shaped Method by Logic-based Benders Decomposition

L-shaped Method by Logic-based Benders Decomposition

Integer L-shaped Method (IIS)

Integer L-shaped Method (IIS)

Expert Examples

The expert mode in BendersLib gives you full control through callbacks. Callbacks let you insert your own code into the Benders algorithm. You can change solver settings, define custom stopping rules, or implement enhancements. This is ideal for research or for solving complex problems that need a tailored approach.

Simple Callback

Simple Callback

Save All Feasible Solutions

Save All Feasible Solutions

Callback in Branch-and-check Method

Callback in Branch-and-check Method

Warm Start

Warm Start

Early Stop

Early Stop

Cut Normalization

Cut Normalization

Pareto-optimal Cut

Pareto-optimal Cut

Local Branching

Local Branching

Trust Region Method (Box Constraints)

Trust Region Method (Box Constraints)

Trust Region Method (Hamming Distance)

Trust Region Method (Hamming Distance)

Cut Management

Cut Management

Trust Region Method (L1 Norm)

Trust Region Method (L1 Norm)

Cut from Master Solution Neighbor

Cut from Master Solution Neighbor

Benchmarks

Linear Recourse (Gurobi)

Linear Recourse (Gurobi)

Linear Recourse (COPT)

Linear Recourse (COPT)

Facility Location (COPT)

Facility Location (COPT)

Integer Recourse (Gurobi)

Integer Recourse (Gurobi)

Integer Recourse (COPT)

Integer Recourse (COPT)

Facility Location (Gurobi)

Facility Location (Gurobi)

Computing IIS

This section contains examples demonstrating how to compute an Irreducible Infeasible Subsystem (IIS) using various solver interfaces.

SCIP IIS

SCIP IIS

Gurobi IIS

Gurobi IIS

CPLEX IIS

CPLEX IIS

Copt IIS

Copt IIS

CP Optimizer IIS

CP Optimizer IIS

Pyomo IIS

Pyomo IIS

OR-Tools IIS

OR-Tools IIS

Solver Usage

This section contains examples that demonstrate how to use the solver interfaces provided by BendersLib.

Gurobi

Gurobi

COPT

COPT

OR-Tools

OR-Tools

SCIP

SCIP

CP Optimizer

CP Optimizer

CPLEX

CPLEX

Pyomo

Pyomo

API Oriented

This section contains examples that demonstrate how to use the API provided by BendersLib.

Retrieve master and sub problems

Retrieve master and sub problems

Template for Customizing Benders Decomposition

Template for Customizing Benders Decomposition

Gallery generated by Sphinx-Gallery