Skip to content

Flow cover cuts - #2496

Closed
Opt-Mucca wants to merge 44 commits into
latestfrom
flow-cover-cuts
Closed

Flow cover cuts#2496
Opt-Mucca wants to merge 44 commits into
latestfrom
flow-cover-cuts

Conversation

@Opt-Mucca

@Opt-Mucca Opt-Mucca commented Aug 13, 2025

Copy link
Copy Markdown
Collaborator

This adds the lifted simple generalised flow cover cut from https://link.springer.com/content/pdf/10.1007/s101070050067.pdf

Currently a flow cover cut is only generated for HighsPathSeparator. I've been playing around with enabling it for HighsTableauSeparator, but can't decide if that has some performance loss. I've avoided doing anything for mod-k and conflicts because they already have a "dont-spend-much-time" cut flag attached to them.

The general workflow of how the cut is generated (and which bits of the code does what):

  • preprocessSNFRelaxation -> check whether the aggregated row can be used for a flow cover
  • initSNFRelaxation -> initialise some data structures
  • transLp.transformSNFRelaxation -> create the single-node flow relaxation (SNFR). That is, turn \sum c_i x_i + \sum a_i y_i <= a_0 (x_i binary, y_i real non-neg) into \sum_{j \in N+} y'_j - \sum_{j \in N-} y'_j <= b, where y'_j <= u_j x_j.
  • computeFlowCover -> Get sets C+ subset N+ and C- subset N- with sum_{j in C+} u_j - sum_{j in C-} u_j = b + lambda, lambda > 0 (C+ and C- are then the "flow cover")
  • separateLiftedFlowCover -> compute the actual cut (half of the code is creating data for the lifting function and functions for determining coefficients related to the lifting function)
  • transLp.cleanup -> Remove slack, small coefficients, and calculate the efficacy

My smaller performance runs are showing a nice improvement on reducing the number of nodes, but it's still slightly slower than the baseline w.r.t. time. I'd say it's too heavily swayed by outliers currently. This needs to be more rigorously tested performance-wise before being merged.

I opened the PR to get any feedback from a design perspective, and in case anyone wanted to contribute. I also need to test whether or not this is helpful for the energy instances specifically.

Potential TODO: I am currently just taking the bestVlb or bestVub that is already stored for transformSNFRelaxation. Such a variable bound does not necessarily satisfy the requirements to be used in transformSNFRelaxation though, and could be blocking a candidate. It might be well worth it to either change the function that gets bestVlb / bestVub or to create a second search.

Edit: And more checks for correctness.... Although they do pass locally!

@codecov

codecov Bot commented Aug 13, 2025

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.25926% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 79.93%. Comparing base (313b07a) to head (ec6d597).
⚠️ Report is 46 commits behind head on latest.

Files with missing lines Patch % Lines
highs/mip/HighsTransformedLp.cpp 91.48% 27 Missing ⚠️
highs/mip/HighsCutGeneration.cpp 98.57% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2496      +/-   ##
==========================================
+ Coverage   79.48%   79.93%   +0.44%     
==========================================
  Files         346      346              
  Lines       85869    86645     +776     
==========================================
+ Hits        68251    69256    +1005     
+ Misses      17618    17389     -229     

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

@Opt-Mucca Opt-Mucca closed this Aug 28, 2025
@Opt-Mucca

Copy link
Copy Markdown
Collaborator Author

Closing this because it's close to finished, and I don't want to spam everyone with notifications for minor performance changes as I experiment. I plan to open a non-draft PR in the next few days.

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.

1 participant