google / or-tools

Google's Operations Research tools:
https://developers.google.com/optimization/
Apache License 2.0
11.14k stars 2.11k forks source link

Add support to the HiGHS solver MathOpt #3116

Closed SanPen closed 5 months ago

SanPen commented 2 years ago

Hi,

HiGHS is a magnificent open-source solver that's able to run in parallel, clearly beating CBC in some of the tests I've done in python.

Is there any plan to integrate it into or-tools? (C++)

If not, I'd like to do it myself since the interface looks similar to CBC's. What would be the right way to start?

thanks, Santiago

Mizux's EDIT(to have task list need to edit the first message...):

note: my dev will be in [mizux/highs] (to create) branch and regularly rebased on top of [master]

lperron commented 2 years ago

Yes, but we do not have the time to write the interface for it. So we will wait from some contribution for it.

lperron commented 2 years ago

You can copy the cbc_inteface.cc file

Mizux commented 2 years ago

Todo list:

gregy4 commented 2 years ago

Any news about support of highs solver ? Do you work on it, SanPen ? Latest version 1.2.2 solved one of my unsolvable mip problems by any open source solver (I maybe tried them all) including scip. Since optimal solution was found under 3 seconds, I was very satisfied and maybe there’s time to think about usage of mip solver in some cases for me.

SanPen commented 2 years ago

My process was the following:

So, essentially I thought that fighting a code that I don't understand would be far more complicated than building everything from scratch, so I made my own solver interface with matrix-variable operations embedded.

If we find time to do a gathering with the authors and get dummy-proof guide, I might write the Highs interface, otherwise it is too much for me.

jajhall commented 2 years ago

Having first got in touch with @lperron in August of last year, the HiGHS team is now in a position to contribute to writing an OR-Tools interface to HiGHS. Not only will this get around the "not open-source to industry" issue of SCIP, but it will give OR-Tools a better MIP solver than SCIP - see http://plato.asu.edu/ftp/milp.html

That said, I'm interested to read about the experiences of @SanPen and @Mizux on this page, and it would be great if you were able to feed your knowledge into the process.

lperron commented 2 years ago

Hi,

first, thank you all for this discussion.

Here is some context/roadmap.

About OR-Tools interface:

model_builder is available in Python, Java. I need to write the C# layer, and export the C++ layer to or-tools. math_opt is available in C++. Python is being worked on, but we are waiting on bugfixes to export it to or-tools. Java will come later. C# may never come.

I would love to import HiGHS in or-tools (and drop CBC/CLP).

There are 4 parts to it:

I can ask Corentin (mizux) to look at the first 2. I will do the 3rd.

Julian, can you or somebody in your team implement the proto solver (one shot non incremental solve) when the first 3 items are done. There are multiple examples in ortools/linear_solver/*proto_solver.h/cc. We will obviously help you.

Thanks

Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53 00

Le jeu. 28 avr. 2022 à 11:11, Julian Hall @.***> a écrit :

Having first got in touch with @lperron https://github.com/lperron in August of last year, the HiGHS team is now in a position to contribute to writing an OR-Tools interface to HiGHS. Not only will this get around the "not open-source to industry" issue of SCIP, but it will give OR-Tools a better MIP solver than SCIP - see http://plato.asu.edu/ftp/milp.html

That said, I'm interested to read about the experiences of @SanPen https://github.com/SanPen and @Mizux https://github.com/Mizux on this page, and it would be great if you were able to feed your knowledge into the process.

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/3116#issuecomment-1111953437, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3INSEDFA56MC2V3ZB3VHJI2PANCNFSM5NULJT6A . You are receiving this because you were mentioned.Message ID: @.***>

jajhall commented 2 years ago

I've flagged up this exchange with @galabovaa and she will have a look at what's involved to implement the proto solver.

With your help, I'm sure that we'll make this happen

Mizux commented 2 years ago

Dev Note:

current state

see https://github.com/google/or-tools/tree/mizux/highs

To Fix/Patch

jajhall commented 2 years ago

Thanks. @galabovaa got Bazel to build HiGHS before, so can contribute. She's busy for the next couple of weeks, though

frederikgeth commented 2 years ago

This is a post to say hi and to confirm interest in this feature! We currently use CLP and GLOP through Java OR tools. We are grateful to everyone for all the existing contributions and excited about the opportunity to start using HiGHS soon. Let me know if there is an opportunity to help in testing.

jajhall commented 2 years ago

@galabovaa is now in a position to start work on an OR-Tools <-> HiGHS interface. Can't say how long it will take, but it's definitely happening!

igrqb commented 2 years ago

Awesome! Kudos for the great work :)

wxinix commented 1 year ago

any updates about ORTools + Highs?

jajhall commented 1 year ago

any updates about ORTools + Highs?

Progress has been made, and @galabovaa will continue now that highspy is available from PyPI

FernandoMotkraft commented 11 months ago

@Mizux Hello, I wonder if you folks are still working on this. I would like to move away from SCIP, due to speed on MIP, also due to potential memory leaks on SCIP. Do you folks still have plans to enable HiGHs within or-tools? Is there an approximate timing you could share?

lperron commented 11 months ago

We are, low priority though. Not in 9.8 (coming soon). Hopefully 9.9 Laurent Perron | Operations Research | @.*** | (33) 1 42 68 53 00

Le mar. 24 oct. 2023 à 16:16, FernandoMotkraft @.***> a écrit :

@Mizux https://github.com/Mizux Hello, I wonder if you folks are still working on this. I would like to move away from SCIP, due to speed on MIP, also due to potential memory leaks on SCIP. Do you folks still have plans to enable HiGHs within or-tools? Is there an approximate timing you could share?

— Reply to this email directly, view it on GitHub https://github.com/google/or-tools/issues/3116#issuecomment-1777311709, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUPL3MWEMQXICTHJBB2DTLYA7ESRAVCNFSM5NULJT6KU5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXG4ZTCMJXGA4Q . You are receiving this because you were mentioned.Message ID: @.***>

FernandoMotkraft commented 11 months ago

Thanks for the info @lperron

Mizux commented 11 months ago

It seems we already have Highs support for mathopt internally (i.e. blaze only), I need to export and clean it asap. But as Laurent say we want to release the incoming v9.8 this week first so we won't integrate it before v9.9 (ETA around Christmas)

FernandoMotkraft commented 11 months ago

That would be a nice Xmas present @Mizux :)

individ2016 commented 6 months ago

Hello! Any news about HiGHS integration? :)

Mizux commented 6 months ago

Currently cleaning HiGHs build system, the objective is to have HiGHS support working for 9.10 this week or next (finger crossed):

Mizux commented 5 months ago

Currently some math_opt tests fail when using HiGHs 1.7.0 (internally we still use 1.4.1) trying to understand what happen

jajhall commented 5 months ago

Currently some math_opt tests fail when using HiGHs 1.7.0 (internally we still use 1.4.1) trying to understand what happen

Happy to help you understand why, if you'll share HiGHS output

Mizux commented 5 months ago

Currently some math_opt tests fail when using HiGHs 1.7.0 (internally we still use 1.4.1) trying to understand what happen

Happy to help you understand why, if you'll share HiGHS output

@jajhall Thanks, I've create this issue with all information I have (i.e. the potential HiGHs commit), I'm trying to investigate...