Skip to content

Conversation

@Opt-Mucca
Copy link
Collaborator

This PR sorts rows via their fractionalActivity in HighsPathSeparator when considering which row to add to the aggregation.
High level overview: The separator tries to find a continuous column to aggregate out, and to do so finds an additional row that also contains that continuous column. Which row to use is non-obvious.

The old method:

  • No sorting. Given the array of rows, each time you want to select a new row, scan through the array starting at a random point.

The new method:

  • Sort rows via their fractional activities. Scan through them in order each time.

Pros:

  • More informed ordering. Should prioritise rows that can generate good cMIR cuts.
  • Randomly selecting a starting point to scan through the array already kind of enforced a priority. That is, array[i-1] is checked before array[i] in all cases aside from starting the scan at i.

Cons:

  • Losing some inherent diversity that a random algorithm provides. It's now more likely that we'd aggregate similar rows each time, which could lead to many duplicate cuts.

This should only be merged after doing a performance run.

@Opt-Mucca Opt-Mucca requested a review from fwesselm December 1, 2025 09:36
@codecov
Copy link

codecov bot commented Dec 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.37%. Comparing base (e4632db) to head (85ab358).
⚠️ Report is 173 commits behind head on latest.

Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2674      +/-   ##
==========================================
+ Coverage   81.20%   81.37%   +0.16%     
==========================================
  Files         349      349              
  Lines       85465    85957     +492     
==========================================
+ Hits        69406    69950     +544     
+ Misses      16059    16007      -52     

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

Looks good, @Opt-Mucca. I will try to qualify as soon as possible.

@jajhall
Copy link
Member

jajhall commented Dec 12, 2025

It would be better to maintain the use of fractionality(T input, T* intval = nullptr) in HighsLpUtils.h

@Opt-Mucca Please make this modification so we can merge this PR

@Opt-Mucca
Copy link
Collaborator Author

@jajhall Can do.
As a heads up: @fwesselm tested and the current change is slightly performance negative (does solve an instance or two more but pretty sure that's noise). This is on my list to look into again as the current approach is noisy and can't be impossible to beat. (TLDR: I'd like this to be performance positive before it's merged)

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