Skip to content

Expand MIP debug solution capabilities#2490

Merged
jajhall merged 4 commits intolatestfrom
debugsol
Aug 20, 2025
Merged

Expand MIP debug solution capabilities#2490
jajhall merged 4 commits intolatestfrom
debugsol

Conversation

@Opt-Mucca
Copy link
Collaborator

This expands how the MIP debug solution can be used.

Previously: Presolve had to be disabled and the solution was removed if a restart occurred. The expected solution format was also SCIP's .sol format with anaonymised variable names.

Now: The expected solution format is a .sol file produced by HiGHS (of the original problem). The solution is then saved both in the original and transformed space when loaded in, and transformed appropriately at each restart and after presolve.

I guess this feature is not used by many people? It's not meant to public facing, and the code is hidden by a compiler flag. This makes is substantially easier to use, and has already been helpful.

I'm still not too sure on C++ that isn't doing MIP stuff. Opinions on how the .sol file is parsed are welcome.

@codecov
Copy link

codecov bot commented Aug 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (latest@54ba458). Learn more about missing BASE report.
⚠️ Report is 108 commits behind head on latest.

Additional details and impacted files
@@            Coverage Diff            @@
##             latest    #2490   +/-   ##
=========================================
  Coverage          ?   79.58%           
=========================================
  Files             ?      346           
  Lines             ?    85897           
  Branches          ?        0           
=========================================
  Hits              ?    68364           
  Misses            ?    17533           
  Partials          ?        0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Contributor

@galabovaa galabovaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Parsing with stringstream seems fine

Copy link
Collaborator

@fwesselm fwesselm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @Opt-Mucca, this looks good.

@Opt-Mucca Opt-Mucca changed the title Expand MIP debug solution capabilities Draft: Expand MIP debug solution capabilities Aug 11, 2025
@Opt-Mucca
Copy link
Collaborator Author

Opt-Mucca commented Aug 12, 2025

I've put "draft" in the title because for some instance I'm debugging it brought up a potential bug in presolve. I thought the debug solution was only intended to work after presolve, so I quickly disabled it with a commit, and now I need to investigate if there's actually a bug In presolve or the debug solution should just be disabled for this bit of the solve process.....

Edit: Was just an oversight by me. The commit a few days ago should have fixed the problem (ignore the debug solution until post-presolve)

@Opt-Mucca Opt-Mucca changed the title Draft: Expand MIP debug solution capabilities Expand MIP debug solution capabilities Aug 13, 2025
Copy link
Collaborator

@BenChampion BenChampion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't we reuse the existing parser code we have for .sol files? Or am I missing something that makes this problematic?

@Opt-Mucca
Copy link
Collaborator Author

The issue with the existing .sol parser is that it never worked for me without a fair bit of manual editing, and that was not sustainable for larger instances. There is a good argument for expanding this reader though as that would help with convenience (the argument against this would be we could always just load in the solution of format X and convert it to HiGHS style)

@jajhall
Copy link
Member

jajhall commented Aug 14, 2025

Shouldn't we reuse the existing parser code we have for .sol files? Or am I missing something that makes this problematic?

The existing parser code does (now) have a "sparse" option. The reason that the SCIP .sol format was used was so that the optimal solution from XPress could be used (by Leona) to check for cut violations.

@jajhall jajhall merged commit 98d5740 into latest Aug 20, 2025
307 checks passed
@Opt-Mucca Opt-Mucca deleted the debugsol branch December 15, 2025 11:17
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

Successfully merging this pull request may close these issues.

5 participants