Skip to content

Remove continuous singletons from double-sided rows#2962

Draft
Opt-Mucca wants to merge 6 commits into
latestfrom
zero-obj-singleton-double-sided-row
Draft

Remove continuous singletons from double-sided rows#2962
Opt-Mucca wants to merge 6 commits into
latestfrom
zero-obj-singleton-double-sided-row

Conversation

@Opt-Mucca
Copy link
Copy Markdown
Collaborator

@Opt-Mucca Opt-Mucca commented Apr 10, 2026

General idea: We currently have no explicit reduction for a column s, with 0 cost, and that only appears in a single double-sided row b_0 <= a^Tx + cs <= b_1. Dual fixing removes all cases where b_0 == -kHighsInf or b_1 == kHighsInf, but the column is left alone if b_0 and b_1 are finite. Removing the column may allow additional reductions to be made.

Motivation: I was playing around with an instance, trying to figure out why HiGHS wasn't making a reduction, and thought this would help (spoiler: it did not), but while doing so I stumbled upon an old TODO in the code with the exact suggestion.

@fwesselm Three major questions:

  • Do you think this is worth adding? I haven't performance tested this.
  • If so should this be kept behind a MIP-only flag?
  • I'm currently skipping the case where s has infinite bounds, but in theory we could handle that here. The issue is I'm not sure what to do with infinite values in postsolve.

Edit: Need to look into the failing tests (they're passing locally.....). Windows does not like this change at all.

@Opt-Mucca Opt-Mucca requested a review from fwesselm April 10, 2026 09:18
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 80.00000% with 24 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.94%. Comparing base (dd33e6e) to head (391fe61).
⚠️ Report is 1 commits behind head on latest.

Files with missing lines Patch % Lines
highs/presolve/HighsPostsolveStack.cpp 68.33% 19 Missing ⚠️
highs/presolve/HighsPostsolveStack.h 70.58% 5 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##           latest    #2962    +/-   ##
========================================
  Coverage   72.94%   72.94%            
========================================
  Files         426      426            
  Lines      102185   102300   +115     
  Branches    16443    16460    +17     
========================================
+ Hits        74540    74627    +87     
- Misses      27369    27397    +28     
  Partials      276      276            

☔ View full report in Codecov by Harness.
📢 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.

@fwesselm
Copy link
Copy Markdown
Collaborator

This is great, @Opt-Mucca! I would like to experiment with this a llittle more. Also, there is HPresolve::removeSlacks which handles a "similar" case. If you are OK with it, I would make some more changes (on top of your change).

@Opt-Mucca
Copy link
Copy Markdown
Collaborator Author

@fwesselm I was worried that I was missing something, so please make any changes you want.

@odow odow requested a review from jajhall May 12, 2026 08:38
@jajhall
Copy link
Copy Markdown
Member

jajhall commented Jun 5, 2026

@Opt-Mucca I've merge the fix for HighsPostsolveStack::ZeroObjSingletonContinuousCol::undo into this branch, and merged in latest. There's some checking code that prints diagnostic information in the event of errors that assert with debug, and this will disappear when some testing on larger MIPs has been done, and the maths has been looked at properly. I'd like to say that I'll have time to think about the latter in the next few days, but I won't.

TEST_CASE("issue-2962", is the example that previously yielded iterations after postsolve due to one of the ZeroObjSingletonContinuousCol being made basic in postsolve, leading to an incorrect number of basic variables.

@jajhall jajhall marked this pull request as draft June 5, 2026 23:14
@jajhall
Copy link
Copy Markdown
Member

jajhall commented Jun 5, 2026

This is now draft until the maths has been checked and the error-checking code has been removed

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.

3 participants