Forum Discussion

FICO's avatar
FICO
Community Manager
1 year ago

Question about the benders example

Hello,

I am an ordinary student studying optimization with Xpress.

First,​

I downloaded and ran the Python file from the xpress example to reference while implementing benders decomposition using the Python library. However, I noticed that the code did not yield a feasible result. To diagnose the issue, I added exception handling and ran the code, and I observed that within the preintsol callback function, problem.getCallbackSolution is not executing properly. Could this behavior be related to the issue mentioned in Release Note 9.5.3? If so, I would like to ask if there is an updated version available.

This may not be a major issue, but thank you for taking the time to read my lengthy question.

benders example url : https://examples.xpress.fico.com/example.pl?id=benders_decomp

Release notes url : https://www.fico.com/fico-xpress-optimization/docs/latest/relnotes/GUID-85032F3B-84B8-42A1-A4D4-A0A24FF0A648.html

3 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi,

    I checked the Benders example with Xpress 9.5.0 and 9.5.3 and I get an optimal solution in both cases. Which Xpress version are you using? Could you post your output logs?

    Thanks.

  • FICO's avatar
    FICO
    Community Manager

    Hello, I apologize for the late reply as I checked it late.

    The version of my license is v9.4.3.

    According to the output log, it appears that the solution could not be successfully derived.

    FICO Xpress v9.4.3, Hyper, solve started 15:51:48, Mar 11, 2025

    Heap usage: 389KB (peak 389KB, 85KB system)

    Minimizing MILP noname using up to 12 threads and up to 31GB memory, with these control settings:

    OUTPUTLOG = 1

    NLPPOSTSOLVE = 1

    XSLP_DELETIONCONTROL = 0

    XSLP_OBJSENSE = 1

    Original problem has:

         5 rows      9 cols      36 elements     4 entities

    Presolved problem has:

         4 rows      8 cols      26 elements     4 entities

    Presolve finished in 0 seconds

    Heap usage: 419KB (peak 427KB, 85KB system)

    Coefficient range          original         solved     

     Coefficients  [min,max] : [ 1.00e+00, 5.00e+00] / [ 2.50e-01, 1.25e+00]

     RHS and bounds [min,max] : [ 1.00e+00, 5.00e+00] / [ 2.00e-01, 1.25e+00]

     Objective   [min,max] : [ 1.00e+00, 9.00e+00] / [ 1.00e+00, 9.00e+00]

    Autoscaling applied standard scaling

    Will try to keep branch and bound tree memory usage below 23.9GB

    Starting concurrent solve with dual (1 thread)

     Concurrent-Solve,  0s

          Dual     

      objective  dual inf

     D 2.7200000  .0000000

    ------- optimal --------

    Concurrent statistics:

          Dual: 2 simplex iterations, 0.00s

    Optimal solution found

      Its     Obj Value   S  Ninf Nneg  Sum Dual Inf Time

       2     2.720000   D   0   0    .000000   0

    Dual solved problem

     2 simplex iterations in 0.00 seconds at time 0

    Final objective            : 2.720000000000000e+00

     Max primal violation   (abs/rel) :    0.0 /    0.0

     Max dual violation    (abs/rel) :    0.0 /    0.0

     Max complementarity viol. (abs/rel) :    0.0 /    0.0

    Starting root cutting & heuristics

    Deterministic mode with up to 1 additional thread

     Its Type  BestSoln  BestBound  Sols  Add  Del   Gap   GInf  Time

    a      7.600000   2.720000   1         64.21%    0   0

    q      2.800000   2.720000   2         2.86%    0   0

     *** Search completed ***

    Uncrunching matrix

    Final MIP objective          : 2.800000000000000e+00

    Final MIP bound            : 2.799990000000000e+00

     Solution time / primaldual integral :   0.21s/ 98.581380%

     Number of solutions found / nodes  :     2 /     1

     Max primal violation   (abs/rel) :    0.0 /    0.0

     Max integer violation   (abs  ) :    0.0

    The optimal objective is: 2.8000000000000003

    The first stage variables are: [1.0, -0.0, -0.0, -0.0]

    The second stage variables are: [0.0, 0.0, 0.0, 0.0, 0.6000000000000001]

    The objective of the second stage is: 1.8000000000000003

    FICO Xpress v9.4.3, Hyper, solve started 15:51:48, Mar 11, 2025

    Heap usage: 387KB (peak 387KB, 91KB system)

    Minimizing MILP noname using up to 12 threads and up to 31GB memory, with these control settings:

    PRESOLVE = 0

    OUTPUTLOG = 1

    MIPPRESOLVE = 0

    SYMMETRY = 0

    NLPPOSTSOLVE = 1

    XSLP_DELETIONCONTROL = 0

    XSLP_OBJSENSE = 1

    Original problem has:

         0 rows      5 cols      0 elements     4 entities

    Coefficient range          original         solved     

     Coefficients  [min,max] : [   0.0,    0.0] / [   0.0,    0.0]

     RHS and bounds [min,max] : [ 1.00e+00, 1.00e+00] / [ 1.00e+00, 1.00e+00]

     Objective   [min,max] : [ 1.00e+00, 7.00e+00] / [ 1.00e+00, 7.00e+00]

    Autoscaling applied standard scaling

    Will try to keep branch and bound tree memory usage below 23.9GB

    Entering Integer Callback.

    Integer solution found from heuristic. Checking subproblem.

    User interrupt (7) triggered.

     *** Search unfinished ***  Time:   0.00 Nodes:     0

     Solution time / primaldual integral :   0.00s/ 100.000000%

     Number of solutions found / nodes  :     0 /     0

    Could not solve the problem

  • FICO's avatar
    FICO
    Community Manager

    Hi,

    It looks like you are using a version of the example that is not compatible with Xpress 9.4. You could either upgrade to Xpress 9.5, or you can find the 9.4 version of the example here: https://www.fico.com/fico-xpress-optimization/docs/dms2024-03/examples/python/GUID-D58C7C57-35C7-3D28-83F9-F6A4EAA1412C.html.