Skip to content

Now clearing column and row name hash before solving model - #3335

Merged
jajhall merged 10 commits into
latestfrom
fix-3316
Oct 1, 2026
Merged

jajhall merged 10 commits into
latestfrom
fix-3316

Conversation

@jajhall

@jajhall jajhall commented Sep 29, 2026 •

Copy link
Copy Markdown
Member

Description

As exposed by #1819, retaining the name hashes generated when adding names using addColName/addRowName can lead to serious performance regression, so they are now cleared before solving any model

Checklist

  • I have read the contributing guidelines
  • This PR targets the latest branch
  • Tests are passing
  • Documentation was updated where relevant
  • This PR is not primarily AI-generated (per the AI contributions policy in CONTRIBUTING.md)

Related issue

Closes #1819 and #3316

@Opt-Mucca Opt-Mucca left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick sanity check: This doesn't cause any down-stream problems if someone were to add columns or rows with duplicate names to a model after solving it?

@jajhall

jajhall commented Sep 29, 2026 •

Copy link
Copy Markdown
Member Author

Quick sanity check: This doesn't cause any down-stream problems if someone were to add columns or rows with duplicate names to a model after solving it?

I had good reason to assume that it would be OK, but I'll check

@jajhall

jajhall commented Sep 29, 2026

Copy link
Copy Markdown
Member Author

Quick sanity check: This doesn't cause any down-stream problems if someone were to add columns or rows with duplicate names to a model after solving it?

I had good reason to assume that it would be OK, but I'll check

It's OK, but I've found something that can be improved!

@jajhall

jajhall commented Sep 30, 2026

Copy link
Copy Markdown
Member Author

Refactored the struct HighsNameHash which is used to identify duplicates in HighsLp::col_names and HighsLp::row_names before writing out model files. Fixes a bug when a duplicate name is overwritten, and now keeps track of whether a name is still duplicate as names are modified.

Hence Highs::passColName and Highs::passRowName can identify when the name passed is a duplicate of an existing name. The name is accepted, but HighsStatus::kWarning is returned.

…cate; removed reference to ".ems" in logging "Please specify filename in .mps|.lp|.ems format"!
@jajhall

jajhall commented Oct 1, 2026

Copy link
Copy Markdown
Member Author

Only failures in tests are unrelated to this PR

@jajhall
jajhall merged commit 7e5e622 into latest Oct 1, 2026
553 of 563 checks passed
@jajhall
jajhall deleted the fix-3316 branch October 1, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants