Forum Discussion

FICO's avatar
FICO
Community Manager
1 year ago

Xpress solver freezes when using addmipsol

I have run my code, which includes adding heuristic solutions at each leaf node of the branch-and-bound tree. The added solution is feasible and accepted by the solver. However, at a certain point, the solver stores the heuristic solution and then suddenly stops running until the time limit is reached. CPU usage also drops during this time.

I have adjusted some numerical tolerances, but it didn’t help. Then, I stored the problematic solution and added it at the beginning; it is feasible and accepted by the solver. However, the code still stops running at the same solution (around after 2 minutes). I have no idea why this is happening.

My code and instance are attached. Here is the log before it freezes:

User solution (_) stored.
 
User solution (_) accepted: Feasible solution.
 
[UserSolNotify] solution 'None' status=1
 
User solution (_) stored.

5 Replies

  • FICO's avatar
    FICO
    Community Manager

    Hi Montree,

    I could not reproduce the freeze using Xpress 9.5.4 or 9.6.0. Could you please let me know which Xpress version you are using, on which platform, and if possible, please also attach a log file showing the complete output of your program.

    Thanks,

    Chris

  • FICO's avatar
    FICO
    Community Manager

    Hi Chris,

    Thank you for your message. I'm currently using:

    • Xpress version: 9.5.4 (My license does not support version 9.6.0)
    • Platform: Python 3.12.3, running in the Spyder IDE
    • NumPy version: 1.26.4 (relevant due to random number generation in my code)

    I’ve attached the log file as requested, which stores the solution then freeze.

    Montree

  • FICO's avatar
    FICO
    Community Manager

    Thanks for the information. I have reproduced the problem and an engineer will look into it next week.

  • FICO's avatar
    FICO
    Community Manager

    Hi, sorry for the delay, this request went through several hands and now landed on my desk. I have a question: How do you know the solver freezes? From what I am seeing in the log file you shared, there is steady progress in the Branch-and-Bound search. The last log line happens at some 89k branch-and-bound nodes and reads:

      89181     .113081     .009942    10  2297    14  91.21%      1    90

    From what I read in your code, you (potentially) add a user solution at the beginning of every new node of the search tree (via the prenode callback). So, lots of log messages are to be expected. The solver needs to check the solution internally, which is what slows down the solver from your perspective. But I cannot see it freeze completely.

    I'll play around with your code and let you know what else I find out.

  • FICO's avatar
    FICO
    Community Manager

    Hi, I set the time limit to half an hour and observed that the number of nodes remained at 89k. This suggests that there might be a freeze occurring somewhere. I have refactored my code to avoid using global variables, and the problem has disappeared. I believe this might have been the cause of the freeze. Thank you for your investigation.