HiGHS does not return the MIPgap


I am working on a MILP minimization problem. I used HiGHS as my solver and set the runtime to 300 seconds. Unfortunately, although the problem cannot be solved with the pre-set time limit, HiGHS did not provide me a feasible solution nor the MIPgap. It tells me that my gap is infinite. Please kindly take a look at the screenshot in the attachment below.

I tested out other solvers like Gurobi and Gurobi not only provided me with a feasible solution, Gurobi also provided me a MIPgap. My question is why didn’t HiGHS provide me with a MIPgap as well?

Thank you very much for reading my questions.

All the best,

Screenshot 2023-09-06 at 11.49.46 PM|489x500

“Primal bound inf” in the listing indicates that HiGHS was unable to find a feasible solution before it was terminated by the 300 second time limit. Since the gap is the difference between the best feasible solution and the best bound, when there is no feasible solution, there is also no meaningful gap.

Solvers like Gurobi and HiGHS include several algorithms for finding feasible solutions. It may be that for your problem, the algorithms in Gurobi are faster than the ones in HiGHS, and so you need to give HiGHS more time to find a feasible solution. Or, it may be that for your problem, the algorithms in Gurobi are better than the ones in HiGHS, and they can find a feasible solution when HiGHS can’t.

If you can post the complete logs of your HiGHS and Gurobi runs, it may be possible to say more, based on a comparison of them. For long log listings, it works best to copy each listing to a file and then upload the files.


Thank you very much for your detailed response!

I have attached the log files for both Gurobi and HiGHs. Could you please kindly take a look? Thank you very much.

All the best,
logFiles.zip (5.4 KB)

The HiGHS log shows that when it reached the time limit of 300 seconds, it had still not found any feasible solution to the problem. This is indicated by the BestSol value “inf” in all lines of the log, and by “Primal bound inf” in the Solving report at the end.

The Gurobi log shows that it did find a feasible solution. This is indicated by the Incumbent value 6.871417e+10 that appears in the log lines, and by the message “Gurobi 10.0.1: optimal solution; objective 6.87141744e+10” at the end.

So, these logs basically confirm what I described previously: Gurobi handles this problem better than HiGHS. Gurobi can find a feasible solution in a fraction of a second, while HiGHS is still searching after 5 minutes.

Although Gurobi is successful, it warns that this may be a hard problem to solve:

Coefficient statistics:
  Matrix range     [1e+00, 2e+04]
  Objective range  [1e+00, 1e+11]
  Bounds range     [1e+00, 1e+11]
  RHS range        [1e+00, 3e+04]
Warning: Model contains large objective coefficients
Warning: Model contains large bounds
         Consider reformulating model or setting NumericFocus parameter
         to avoid numerical issues.

If you can find a way to reformulate your problem so that it has smaller objective coefficients and bounds, then maybe HiGHS will give better results for it.

1 Like