Decision Optimization

Decision Optimization

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

 View Only
Expand all | Collapse all

Checking Infeasibilities with Python API

  • 1.  Checking Infeasibilities with Python API

    Posted Mon February 01, 2016 02:14 PM

    Originally posted by: cliffbu


    Hi, I'm trying to use the Python API to do a simple, cursory check on infeasibilities in my model, and receive a callback if the model was infeasible. When I run CPLEX from the command line I immediately get the error "Row 'X' infeasible, all entries at implied bounds". From the Python API, I want to get a callback when this error happens so I can exit. However, it it's not immediately infeasible (maybe numerical instability or it would take a long time to determine), I want to be able to get a call back after the root has been solved so I can go from there. I've tried using SolveCallback, SimplexCallback, etc, but none of them seem to give me this information when I face this error. Does anyone know the correct way?


    #CPLEXOptimizers
    #DecisionOptimization


  • 2.  Re: Checking Infeasibilities with Python API

    Posted Tue February 02, 2016 04:57 AM

    There is no callback that is invoked at the point at which infeasibility is proven. If infeasibility is proven during presolve ("Row 'X' infeasible, all entries at implied bounds") then Cplex.solve() will return immediately and the status will be set appropriately. So I don't think there is a need for a callback here.

    If you want to stop after the root node then just set CPX_PARAM_NODELIM to 0. Again, no need for a callback here, IMO.

    Using Cplex.solution.get_status() you can figure out why CPLEX stopped (infeasible, optimal, node limit hit, ...).


    #CPLEXOptimizers
    #DecisionOptimization