Decision Optimization

Decision Optimization

Delivers prescriptive analytics capabilities and decision intelligence to improve decision-making.

 View Only

Extracting LP Files for Each Iteration of the Benders Algorithm in CPLEX via CVXPY

  • 1.  Extracting LP Files for Each Iteration of the Benders Algorithm in CPLEX via CVXPY

    Posted Thu December 12, 2024 09:20 AM

    Hello Community,

    I am working on a transmission planning problem and employing the Benders algorithm implemented in CPLEX through CVXPY. I aim to extract the LP file (or model representation) generated at each iteration of the algorithm. However, is this feasible directly through CVXPY, or how to achieve it?

    Currently, I am using the following code snippet in CVXPY to enable the Benders algorithm in CPLEX automatically:

    UnitC = cvx.Problem(Objetive,res)
    UnitC.solve(solver=cvx.CPLEX, verbose = True, cplex_params = {"benders.strategy": 3}, cplex_filename = "model.lp")

    My specific questions are:

    1. Is there a way to configure CPLEX from CVXPY to export the LP file for each iteration of the Benders algorithm?
    2. Alternatively, is it possible to extract and store information from each iteration (e.g., variables, active constraints, etc.) during the execution?

    Any examples, documentation, or advice would be greatly appreciated. Thank you in advance!



    ------------------------------
    Mauricio Aguirre Velasco
    ------------------------------