HiGHS icon indicating copy to clipboard operation
HiGHS copied to clipboard

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

Open jeffreydeankelly2 opened this issue 1 year ago • 2 comments

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.

jeffreydeankelly2 avatar Jun 20 '24 15:06 jeffreydeankelly2

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

jajhall avatar Jun 20 '24 15:06 jajhall

Thanks for the response.

A sparse load would be great. The "MIP starts" that I am referring to is to load only the active or non-zero binary and integer variable solutions.

The commercial solvers with MIP starts also require a MIP solve as you say so loading a previously found integer-feasible solution is the only use case I am referring to.

On Thu, Jun 20, 2024 at 11:14 AM Julian Hall @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/ERGO-Code/HiGHS/issues/1808#issuecomment-2180953595, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHONEFCO6UBETBVSFVGRN3ZILWW5AVCNFSM6AAAAABJUFI5QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCOBQHE2TGNJZGU . You are receiving this because you authored the thread.Message ID: @.***>

--


I M P L - " M a k i n g O p t i m i z a t i o n a n d E s t i m i z a t i o n S m a r t e r"

Jeffrey D. Kelly Industrial Algorithms Limited - i n d u s t r i @ l g o r i t h m s Email: @.*** Phone: (647) 917-4675 (IMPL) Making Industrial AI (Algorithms & Integration) Real!


This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately.

jeffreydeankelly2 avatar Jun 20 '24 15:06 jeffreydeankelly2

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?

jajhall avatar Jul 11 '24 14:07 jajhall

https://www.gurobi.com/documentation/current/examples/mip_starts.html

Hopefully this helps - the other commercial solves have this capability as well under "MIP Starts".

On Thu, Jul 11, 2024 at 10:32 AM Julian Hall @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/ERGO-Code/HiGHS/issues/1808#issuecomment-2223097654, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHONECIKMD6AMX2PHF4K4TZL2JQJAVCNFSM6AAAAABJUFI5QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRTGA4TONRVGQ . You are receiving this because you authored the thread.Message ID: @.***>

--


I M P L - " M a k i n g O p t i m i z a t i o n a n d E s t i m i z a t i o n S m a r t e r"

Jeffrey D. Kelly Industrial Algorithms Limited - i n d u s t r i @ l g o r i t h m s Email: @.*** Phone: (647) 917-4675 (IMPL) Making Industrial AI (Algorithms & Integration) Real!


This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately.

jeffreydeankelly2 avatar Jul 11 '24 14:07 jeffreydeankelly2

Closed by #1843

jajhall avatar Jul 14 '24 22:07 jajhall

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

jajhall avatar Jul 14 '24 22:07 jajhall

Hi Julian;

The only issue with a 10% minimum on discrete variables is that in the heuristics I find useful, we only keep the binary variables that are near or at one (1) for the MIP starts. Any binary start that is zero we leave open i.e., not part of the MIP start list.

Thus, given that MIP solutions of binary variables are naturally quite sparse, the 10% could be violated easily.

I think your node limit, iteration limit, time limit, etc. is more practical and I think that is what the other commercial solvers do.

Obviously not all sparse MIP starts are found to be integer-feasible within the MIP start limits.

I hope that helps.

All the best - Jeff

On Sun, Jul 14, 2024 at 6:32 PM Julian Hall @.***> wrote:

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

— Reply to this email directly, view it on GitHub https://github.com/ERGO-Code/HiGHS/issues/1808#issuecomment-2227503728, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALHONEB2FFSHZSAIVTAMICDZML37BAVCNFSM6AAAAABJUFI5QOVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEMRXGUYDGNZSHA . You are receiving this because you authored the thread.Message ID: @.***>

--


I M P L - " M a k i n g O p t i m i z a t i o n a n d E s t i m i z a t i o n S m a r t e r"

Jeffrey D. Kelly Industrial Algorithms Limited - i n d u s t r i @ l g o r i t h m s Email: @.*** Phone: (647) 917-4675 (IMPL) Making Industrial AI (Algorithms & Integration) Real!


This email and any files transmitted with it are confidential, proprietary and intended solely for the individual or entity to whom they are addressed. If you have received this email in error please delete it immediately.

jeffreydeankelly2 avatar Jul 14 '24 22:07 jeffreydeankelly2

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 avatar Jul 14 '24 23:07 jajhall

Closed by #1844

jajhall avatar Jul 15 '24 11:07 jajhall

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.

guifcoelho avatar Jul 17 '24 10:07 guifcoelho

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

jajhall avatar Jul 17 '24 13:07 jajhall