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

Add good_lp based (with highs solver) extractor #24

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

averyanalex
Copy link

This is a port of cbc extractor to good_lp rust library with highs ilp solver. It is faster and requires no runtime deps (highs links statically). Also good_lp based extractor is solver-agnostic and ilp solver can be easily changed.

Bench results:

cumulative time for ilp-cbc: 219968ms
cumulative time for ilp-highs: 145051ms
cumulative tree cost for ilp-cbc: 35474620331874
cumulative tree cost for ilp-highs: 35474620326221
cumulative dag cost for ilp-cbc: 118031
cumulative dag cost for ilp-highs: 118031

@TrevorHansen
Copy link
Contributor

TrevorHansen commented Dec 27, 2023

Nice work Alexander!

I don't know if now is the time to consider it, but I've made better cycle blocking function for the COIN-based ILP extractor:
better cycle blocking

For a similar run time it'll yield a dag cost of around 77k rather than the current 118k - much closer to optimal (it does need a timeout though because some extractions take >10 hours).

@mwillsey do you want to review this as is, or do you want to see the better cycle blocking for the highs ilp solver at the same time?

@averyanalex
Copy link
Author

Also I think there is no reason to leave an implementation that uses cbc directly, and if you want to keep cbc, then use good_lp for this. Then the implementation will be the same for cbc and highs.

So, maybe "merge" implementations, and cbc extractor will use good_lp?

@TrevorHansen
Copy link
Contributor

Yes. Sounds good to me, too.

The only caveat is that for a separate high-performance ILP extractor we'll need stuff like the ability to read the last feasible solution when it times-out, which means that we might need to use the solver directly.

@mwillsey
Copy link
Member

I think I had similar concerns last time I used good_lp (for the original ILP extractor in egg way back when). I couldn't figure out how to get timeouts and partial solutions to work. Does it have support for those things now?

@averyanalex
Copy link
Author

I think I had similar concerns last time I used good_lp (for the original ILP extractor in egg way back when). I couldn't figure out how to get timeouts and partial solutions to work. Does it have support for those things now?

good_lp + highs supports timeouts, but I haven't figured out yet if it's possible to get the latest solution.

@mwillsey
Copy link
Member

Okay, I think this PR will be gated on figuring that out then. A timeout isn't super useful in this scenario unless you can get a "best-so-far" solution out.

@mwillsey
Copy link
Member

I'm converting this to a draft until that's figured out.

@mwillsey mwillsey marked this pull request as draft January 12, 2024 18:36
@TrevorHansen
Copy link
Contributor

Okay, I think this PR will be gated on figuring that out then. A timeout isn't super useful in this scenario unless you can get a "best-so-far" solution out.

I was expecting the best-so-far to be super helpful and have implemented it in one of the ILP extractors. Surprisingly, I couldn't get it to help much. I've come around now, and think that it's possible that having the solver work 1/3 faster (which HiGHs seem to do) is going to exceed the advantage of being able to read the best-so-far solution. I'll get some data.

@averyanalex averyanalex marked this pull request as ready for review January 13, 2024 10:12
@averyanalex
Copy link
Author

Okay, I think this PR will be gated on figuring that out then. A timeout isn't super useful in this scenario unless you can get a "best-so-far" solution out.

I was expecting the best-so-far to be super helpful and have implemented it in one of the ILP extractors. Surprisingly, I couldn't get it to help much. I've come around now, and think that it's possible that having the solver work 1/3 faster (which HiGHs seem to do) is going to exceed the advantage of being able to read the best-so-far solution. I'll get some data.

Any updates on this? Are we really need best-so-far solutions?

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