Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to Set a Partial MIP Solution using setSolution()? #1808

Closed
jeffreydeankelly2 opened this issue Jun 20, 2024 · 11 comments
Closed

How to Set a Partial MIP Solution using setSolution()? #1808

jeffreydeankelly2 opened this issue Jun 20, 2024 · 11 comments
Assignees
Labels
enhancement New feature or request

Comments

@jeffreydeankelly2
Copy link

Is it possible to load a subset of "MIP starts" for a partial subset of the binary variables using setSolution() i.e., only setting the binary variables that are at one (1)?

FYI - this is confirmed available in CPLEX, GUROBI, XPRESS and COPT.

@jajhall jajhall self-assigned this Jun 20, 2024
@jajhall jajhall added the enhancement New feature or request label Jun 20, 2024
@jajhall
Copy link
Member

jajhall commented Jun 20, 2024

No, just a whole solution, with fractional values for any unknown binary variables

A more sophisticated "sparse" representation of the values of integer variables to be used has been suggested, and isn't hard to add

What's less obvious is how to make use of a partial MIP solution. Currently HiGHS will solve the MIP with these values fixed to try to identify an integer feasible solution. However, this will be inefficient if sufficiently few integer variables are set in a partial MIP solution

@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Jun 20, 2024 via email

@jajhall
Copy link
Member

jajhall commented Jul 11, 2024

I'm now working on this, but am struggling to find the Gurobi documentation for the sparse solution - not that it's difficult to design a specification. Could you (easily) point me to it?

@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Jul 11, 2024 via email

@jajhall
Copy link
Member

jajhall commented Jul 14, 2024

Closed by #1843

@jajhall jajhall closed this as completed Jul 14, 2024
@jajhall
Copy link
Member

jajhall commented Jul 14, 2024

I've added a check that if values are specified for fewer than 10% of the integer variables, then the sub-MIP isn't solved to get a feasible solution.

I've just realised that I ought also add start_node_limit to the options

@jeffreydeankelly2
Copy link
Author

jeffreydeankelly2 commented Jul 14, 2024 via email

@jajhall
Copy link
Member

jajhall commented Jul 14, 2024

OK thanks. I'll go back and add the start node limit, and allow any positive number of fixed discrete variables - maybe logging a warning, particularly if the start node limit isn't sensible

@jajhall jajhall reopened this Jul 14, 2024
@jajhall
Copy link
Member

jajhall commented Jul 15, 2024

Closed by #1844

@jajhall jajhall closed this as completed Jul 15, 2024
@guifcoelho
Copy link
Contributor

Hello @jajhall, can we expect this to be available on the next release (v1.7.3 I guess)? I'm really looking forward to this. Either way, thanks for the good work.

@jajhall
Copy link
Member

jajhall commented Jul 17, 2024

Yes, it's merged into latest, so will propagate to the next release

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants