Skip to content

Remove continuous singletons from double-sided rows#2962

Open
Opt-Mucca wants to merge 17 commits into
latestfrom
zero-obj-singleton-double-sided-row
Open

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

Conversation

@Opt-Mucca

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

Copy link
Copy Markdown
Collaborator

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

codecov Bot commented Apr 10, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 92.50000% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.00%. Comparing base (dd33e6e) to head (2239269).
⚠️ Report is 30 commits behind head on latest.

Files with missing lines Patch % Lines
highs/presolve/HighsPostsolveStack.h 70.58% 5 Missing ⚠️
highs/presolve/HighsPostsolveStack.cpp 93.44% 4 Missing ⚠️
highs/lp_data/HighsModelUtils.cpp 70.00% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2962      +/-   ##
==========================================
+ Coverage   72.94%   73.00%   +0.05%     
==========================================
  Files         426      426              
  Lines      102185   102473     +288     
  Branches    16443    16501      +58     
==========================================
+ Hits        74540    74808     +268     
- Misses      27369    27389      +20     
  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

jajhall commented Jun 5, 2026

Copy link
Copy Markdown
Member

@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

jajhall commented Jun 5, 2026

Copy link
Copy Markdown
Member

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

@jajhall jajhall marked this pull request as ready for review June 14, 2026 13:25
@jajhall

jajhall commented Jun 14, 2026

Copy link
Copy Markdown
Member

HPresolve::redundantSingletonColDoubleSidedSlack is now renamed HPresolve::zeroCostSingleton, and handles zero cost singletons with any bounds. It's also applied to equations, which exposed a serious error in HPresolve::dualFixing. This error has been fixed.

zeroCostSingleton and dualFixing are also logged, and can be switched off.

@jajhall jajhall removed their request for review June 14, 2026 14:15
Comment thread highs/presolve/HighsPostsolveStack.cpp
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