Decision Optimization

Decision Optimization

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

 View Only
  • 1.  CPLEX function for basis inverse

    Posted Mon July 25, 2022 10:22 AM
    I'm trying to reconstruct the final simplex tableau using CPLEX for the following problem

    \ENCODING=ISO-8859-1
    \Problem name:

    Maximize
    obj: 4 x1 - x2
    Subject To
    c1: x2 + x3 = 3
    c2: 2 x1 - 2 x2 <= 3
    c3: - 7 x1 + 2 x2 >= -14
    End

    Using the function print(problem.solution.advanced.binvarow()[0] + problem.solution.advanced.binvrow())[0], I get the following output

    [1.0, 0.0, 0.2857, 0.2857, 0.0, -0.1428]

    Thus, the coefficients of the first equation can be read from the elements of this array. For example,

    1.0 x1 + 0.0 x2 + 0.2857 x3 + 0.2857 x4 + 1.0 x5 + 1.428 x6 = 2.8571

    However, the order in which these equations appear have interchanged. This corresponds to the third constraint in the original model specification, but is the first row in the function outputs.

    I want to know if the original constraint correspond to this equation can be mapped easily, i.e., is there a way to know that this equation is associated with constraint c3?

    I can find the basic columns and find its inverse without using the above in-built CPLEX function, but I wanted to avoid calculating the inverse, especially for larger problems.
    #DecisionOptimization


  • 2.  RE: CPLEX function for basis inverse

    Posted Tue August 09, 2022 04:39 AM
    You cannot assume any given ordering of the basic columns in B^-1.
    The routine CPXgetbhead provides the ordering. One can then use CPXbinvrow, CPXbinvcol to retrieve the matrix B^-1. See https://www.ibm.com/docs/en/icos/20.1.0?topic=g-cpxxgetbhead-cpxgetbhead
    In python, it will be under solution.advanced.getbhead


    ------------------------------
    Vincent Beraudier
    ------------------------------