Skip to content

LP KKT check - #2815

Merged
filikat merged 6 commits into
latestfrom
lp-kkt-check
Feb 6, 2026
Merged

filikat merged 6 commits into
latestfrom
lp-kkt-check

Conversation

@jajhall

@jajhall jajhall commented Feb 6, 2026

Copy link
Copy Markdown
Member

The code to perform the LP KKT check is now in lpKktCheck in HighsSolution.cpp. When no basis is available, lpNoBasisKktCheck can be called.

Method computes the KKT measures in a HighsInfo instance, where the relative measures are calculated using the norm of "active" costs and bounds: these correspond to

  • costs where the squared dual is less than the dual feasibility tolerance
  • lower/upper bounds where the residual with respect to a bound is, when squared, less than the primal feasibility tolerance

On entry, if model_status is HighsModelStatus::kOptimal then

  • any KKT failures are logged
  • if the relative KKT errors are more than max_allowed_tolerance_relative_violation (currently 100) times the corresponding tolerance, then model_status is set to HighsModelStatus::kUnknown

Finish this later!

@codecov

codecov Bot commented Feb 6, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 57.32218% with 102 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.25%. Comparing base (9409bbd) to head (71d0157).
⚠️ Report is 8 commits behind head on latest.

Files with missing lines Patch % Lines
highs/lp_data/HighsInfo.cpp 0.00% 73 Missing ⚠️
highs/lp_data/HighsSolution.cpp 81.98% 29 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           latest    #2815      +/-   ##
==========================================
- Coverage   80.33%   80.25%   -0.08%     
==========================================
  Files         348      348              
  Lines       86084    86159      +75     
==========================================
- Hits        69152    69151       -1     
- Misses      16932    17008      +76     

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

@filikat
filikat changed the base branch from master to latest February 6, 2026 11:42
@filikat

filikat commented Feb 6, 2026

Copy link
Copy Markdown
Collaborator

Thanks, this looks fine. I may need to switch off logging if I call this function to check the solution within HiPO, but we'll figure that out later.

Finish this later!

Should we leave it as a draft, or merge it already?

@filikat
filikat merged commit 980d454 into latest Feb 6, 2026
391 of 393 checks passed
@jajhall
jajhall deleted the lp-kkt-check branch February 8, 2026 14:51
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.

2 participants