Skip to content

Support SC/SI variables#46

Merged
lovasoa merged 2 commits into
rust-or:mainfrom
GermanHeim:semi-vars
Jul 9, 2026
Merged

Support SC/SI variables#46
lovasoa merged 2 commits into
rust-or:mainfrom
GermanHeim:semi-vars

Conversation

@GermanHeim

Copy link
Copy Markdown
Contributor

This PR adds support for semicontinuous and semi-integer variables.
We add an Integrality enum (Continuous, Integer, SemiContinuous, SemiInteger) and methods to create semicontinuous/semi-integer vars, which take value 0 or fall within their bounds.

@GermanHeim

GermanHeim commented Jul 9, 2026

Copy link
Copy Markdown
Contributor Author

Hi @lovasoa, should I also bump highs-sys to v1.15.0 in this PR?

@lovasoa

lovasoa commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Yes, I think this warrants a version bump. Sorry for the delay.

For the pr itself: do you think a separate knob to add zero to the solution domain would be clearer ?

Something like

struct SolutionDomain {
   /// Allow only integers
   is_integral: boolean,
  
  /// Allow the variable to take the value 0 even if it's not in its [lower, upper] bounds
  allow_zero: boolean
}

@jajhall

jajhall commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

HiGHS v1.15.1 is current

@GermanHeim

Copy link
Copy Markdown
Contributor Author

I think allow_zero is redundant. We normally think of these as SC/SI vars, which the enum already represents directly. I'd probably keep the current API unless there's a strong preference for exposing an explicit allow_zero flag.

@lovasoa lovasoa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@lovasoa lovasoa merged commit 7228881 into rust-or:main Jul 9, 2026
2 checks passed
@GermanHeim

Copy link
Copy Markdown
Contributor Author

@lovasoa Just as a heads up, we are still using HIGHS v1.14.
Should we update to v1.15.1?

@lovasoa

lovasoa commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

we are declaring a minimal supported version of highs-sys of

highs-sys = "1.14.3"

unless I'm mistaken, this is already compatible with v1.15.1.

highs is just a library, its job is to declare the version range of its dependencies it's compatible with. It does not decide what precise version of highs-sys will be installed when the dependency resolution algorithm runs.

Your job is to maintain the cargo.toml up to date so that it does not lie about which versions of highs-sys we support.

@GermanHeim

Copy link
Copy Markdown
Contributor Author

Ah, understood.
I mistakenly thought highs-sys determined the version because we ship precompiled binaries, but that makes sense. Thanks for clarifying!

@GermanHeim

Copy link
Copy Markdown
Contributor Author

Build highs*
Not precompiled

I got confused with russcip

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