Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Execution hangs after running HiGHS solve. #793

Open
5 of 15 tasks
christiansegercrantz opened this issue Feb 19, 2025 · 5 comments
Open
5 of 15 tasks

Bug: Execution hangs after running HiGHS solve. #793

christiansegercrantz opened this issue Feb 19, 2025 · 5 comments

Comments

@christiansegercrantz
Copy link
Contributor

christiansegercrantz commented Feb 19, 2025

Details for the issue

What did you do?

I tried running the HiGHS solver (using pulp.apis.HiGHS, highspy == 1.9.0 (fa40bdf)) on my project with the latest version of PulP from Github. The execution hangs after the solver has completed its work and never progresses forward in the code. I am unsure what information to provide to easier debug it, so please do ask for more. The solver used the following parameters:

solver = pulp.apis.HiGHS(
     gapAbs=100,
     timeLimit=60 * 5,
     threads=6
)
model.solve(solver)

What did you expect to see?

That the execution is completed and the model.solveoperation completed.

What did you see instead?

The solver hangs indefinately.

Useful extra information

The info below often helps, please fill it out if you're able to. :)

What operating system are you using?

  • Windows: ( version: ___ )
  • Linux: ( distro: ___ )
  • Mac OS: macOS Sequoia 15.3 (24D60)
  • Other: ___

I'm using python version:

I installed PuLP via:

Did you also

@pchtsp
Copy link
Collaborator

pchtsp commented Feb 19, 2025

can you share the model in some of the supported formats?
https://coin-or.github.io/pulp/guides/how_to_export_models.html

If it's a very big model, then it may be something wrong with post-processing, or memory, or anything, really.
Does it work correctly with a small instance of the model?

Also, if you put a shorter timeLimit, does it work? Do you see any log or output from the solver?

@christiansegercrantz
Copy link
Contributor Author

christiansegercrantz commented Feb 19, 2025

I doubt it's the size since It takes approx 4 seconds to solve. Additionally, the solver prints the solving report indicating it's ready:

Solving report Solving report Status Optimal Primal bound 505757

Dual bound 505757

Gap 0% (tolerance: 0.0198%)

P-D integral 0.757847382884

Solution status feasible

                505757 (objective)

                0 (bound viol.)

                0 (int. viol.)

                0 (row viol.)

Timing 4.04 (total)

                0.00 (presolve)

                0.00 (solve)

                0.00 (postsolve)

Max sub-MIP depth 1

Nodes 1

Repair LPs 0 (0 feasible; 0 iterations)

LP iterations 530 (total)

                0 (strong br.)

                21 (separation)

                17 (heuristics)

Unfortunately I can't provide the model since it contains data not to be shared. But I can provide more information if needed

@pchtsp
Copy link
Collaborator

pchtsp commented Feb 19, 2025

unfortunately, without a test instance it's going to be too hard to debug. If you can come up with a non-sensitive dataset, please share it. You can make up your own data or anonymize the data in your dataset.

@christiansegercrantz
Copy link
Contributor Author

I'm working on getting you a version but meanwhile it seems the problem might be caused by the duals since whenever I interrupt the solver after it hangs this is the line: constraint.pi = solution.row_dual[constraint.index] in highs_api.py:498

@christiansegercrantz
Copy link
Contributor Author

christiansegercrantz commented Feb 20, 2025

I think I found the culprit. It seems that this loop 1527a4f#diff-c1280fbe0804a30c1ff2760dd4265b6211c720b2b03801fab43d4dd4d56c5e29R488 is very slow (1000 constraints/11 seconds) and when you have a problem, like me, with ~0.5 mil constraints that makes it take approx 1.7h to loop through it. Can you try if this is enough information?

Edit: I will make a PR, I solved the problem most likely.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants