Decision Optimization

Decision Optimization

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

 View Only
  • 1.  Manual Benders' decomposition in docplex

    Posted Wed March 20, 2019 07:56 AM

    Originally posted by: davidrey123


    Hi, I would like to implement a "manual" Benders' decomposition in DOcplex Python modeling API for a MILP. By "manual" I mean not using Benders' annotations or strategies (e.g. automatic Benders). One of the reason for this (besides curiosity) is that I would like to customize the way Benders' subproblem is solved, notably by solving possibly more than one optimization problem to generate hopefully stronger feasibility and optimality cuts.

    My goal is to solve a MILP and decompose it by keeping the integer variables in the master and the continuous ones in the subproblem (so the subproblem is an LP). If I solve the primal LP and it's feasible, I believe I can get dual prices of my constraints by the command "docplex.mp.model.dual_values(cts)" and use that to generate my optimality cut. However if the LP is infeasible, how can I get the dual rays to generate my feasibility cut? Browsing the forum, it seems that there may be a way to use Farkas' Lemma to achieve this but it's not clear to me how to do this in docplex. Any suggestions would be highly appreciated.

    Thanks,

    -David


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Manual Benders' decomposition in docplex

    Posted Mon March 25, 2019 03:30 AM

    I'm afraid that getting a dual ray is currenctly not supported in docplex.

    The CPLEX Python API allows getting a dual ray via Cplex.solution.advanced.get_ray(). So I can see two options:

    1. Implement your project using the CPLEX Python API instead of docplex (docplex builds on top of CPLEX Python API, so this is definitely posible).
    2. Stick with docplex but in order to get a ray get access to the low-level engine object to obtain the ray. In this thread Alex described how one can get a reference to the engine object and use that to query the engine's solution pool and map back variable indices to docplex variable objects. You can try something very similar with get_ray().

    Note that a ray is not available if presolved proved the model to be infeasible (this is independent of which API you use). Rays are only available if Simplex proved the thing infeasible. So frequently, in case of infeasibility, one has to disable presolve and re-solve (or disable presolve anyway) in order to get a ray at all.


    #CPLEXOptimizers
    #DecisionOptimization


  • 3.  Re: Manual Benders' decomposition in docplex

    Posted Mon March 25, 2019 05:59 AM

    Originally posted by: davidrey123


    Hi Daniel,

    Thank you for the detailed answer, option 1 will work for me.

    Cheers,

    -David


    #CPLEXOptimizers
    #DecisionOptimization