Skip to content

ZI round and shifting#2287

Merged
jajhall merged 77 commits intoERGO-Code:latestfrom
fwesselm:ZIRoundAndShifting
Apr 10, 2025
Merged

ZI round and shifting#2287
jajhall merged 77 commits intoERGO-Code:latestfrom
fwesselm:ZIRoundAndShifting

Conversation

@deryaozyurt
Copy link
Copy Markdown
Contributor

We have implemented ZI Round and Shifting heuristics in HiGHS and added 5 new options: mip_heuristic_run_RINS, mip_heuristic_run_RENS, mip_heuristic_run_rootReducedCost, mip_heuristic_run_ZIRound, mip_heuristic_run_Shifting. The ability to turn off the SubMIP using heuristics, namely RINS, RENS and RootReducedCost seems to be beneficial on some problems. By default ZI Round and Shifting heuristics are turned off to maintain the current HiGHS code behavior.

The heuristics code is added in HighsPrimalHeuristics.cpp with two new member functions of HighsPrimalHeuristics class. A new utility function (getInfeasibleRows) is needed and implemented in HighsMipSolverData.cpp. We also altered the function tryRoundedPoint in HighsPrimalHeuristics.cpp and added the aforementioned options to HighsOptions.h.

For ZI Round, we followed the algorithm description in Chris Wallace’s paper in Journal of Heuristics (Vol. 16, pp. 715-722, 2010) titled “ZI round, a MIP rounding heuristic”.
We mostly followed the Shifting algorithm described in Timo Berthold’s Diplomarbeit titled “Primal Heuristics for Mixed Integer Programs” with several alterations.

Note that MipTimerStart/Stop is not implemented for the new heuristics.

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 8, 2025

Codecov Report

Attention: Patch coverage is 96.43917% with 12 lines in your changes missing coverage. Please review.

Project coverage is 79.16%. Comparing base (9f8d397) to head (136c472).
Report is 104 commits behind head on latest.

Files with missing lines Patch % Lines
highs/mip/HighsPrimalHeuristics.cpp 97.62% 6 Missing ⚠️
highs/lp_data/HighsOptions.h 66.66% 5 Missing ⚠️
highs/mip/HighsMipSolverData.cpp 97.91% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2287      +/-   ##
==========================================
+ Coverage   79.10%   79.16%   +0.06%     
==========================================
  Files         343      343              
  Lines       83376    83694     +318     
==========================================
+ Hits        65951    66258     +307     
- Misses      17425    17436      +11     

☔ 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.

@jajhall jajhall self-requested a review April 9, 2025 08:00
Comment thread src/lp_data/HighsOptions.h
Comment thread src/mip/HighsMipSolverData.cpp Outdated
Comment thread src/mip/HighsMipSolverData.cpp
Comment thread src/mip/HighsMipSolverData.cpp Outdated
Comment thread src/mip/HighsMipSolverData.h Outdated
…into ZIRoundAndShifting

# Conflicts:
#	src/mip/HighsMipSolverData.cpp
Comment thread src/mip/HighsPrimalHeuristics.cpp
Comment thread src/mip/HighsPrimalHeuristics.cpp
Comment thread src/mip/HighsPrimalHeuristics.cpp
Comment thread src/mip/HighsPrimalHeuristics.cpp
Comment thread src/mip/HighsPrimalHeuristics.cpp
Copy link
Copy Markdown
Member

@jajhall jajhall left a comment

Choose a reason for hiding this comment

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

Since the MIP solver doesn't conform completely to the naming conventions, and HighsPrimalHeuristics::shifting and HighsPrimalHeuristics::ziRound are new methods owned by @fwesselm, I don't insist on the wholesale changes so that they conform completely to the naming conventions. However, outside these - particularly in places like HighsOptions.h, I feel that the conventions are important.

@fwesselm
Copy link
Copy Markdown
Collaborator

fwesselm commented Apr 9, 2025

Since the MIP solver doesn't conform completely to the naming conventions, and HighsPrimalHeuristics::shifting and HighsPrimalHeuristics::ziRound are new methods owned by @fwesselm, I don't insist on the wholesale changes so that they conform completely to the naming conventions. However, outside these - particularly in places like HighsOptions.h, I feel that the conventions are important.

@jajhall, thank you for reviewing this. I have tried to address your comments regarding code outside of HighsPrimalHeuristics::shifting and HighsPrimalHeuristics::ziRound.

@jajhall
Copy link
Copy Markdown
Member

jajhall commented Apr 9, 2025

I realise, @fwesselm, that I may not have pointed you to the convention that we use (99% of the time) https://google.github.io/styleguide/cppguide.html

@galabovaa
Copy link
Copy Markdown
Contributor

CI looks good, please ignore the documentation failing, this will fix itself once latest goes into master fot the upcoming release.

@jajhall
Copy link
Copy Markdown
Member

jajhall commented Apr 10, 2025

Thanks @deryaozyurt and @fwesselm!

@jajhall jajhall merged commit a179eb6 into ERGO-Code:latest Apr 10, 2025
118 of 119 checks passed
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.

4 participants