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

solution summary to report the number of cuts applied to a problem with discrete variables #3126

Closed
hdavid16 opened this issue Nov 4, 2022 · 8 comments

Comments

@hdavid16
Copy link
Contributor

hdavid16 commented Nov 4, 2022

It would be nice if solution_summary also reported the number of cuts applied to a MIP. It currently reports the relative gap and number of nodes explored. I'm not sure how difficult it would be to report the number of cuts, but this might be a nice statistic to have.

@odow
Copy link
Member

odow commented Nov 4, 2022

Can you point to ways to access this information in multiple solver APIs?

Before adding this to JuMP, we'd need to add this as a new MOI attribute.

@odow
Copy link
Member

odow commented Nov 4, 2022

I don't see a way to access this in Gurobi, https://www.gurobi.com/documentation/9.5/refman/attributes.html, which I think means "no." (We typically use Gurobi as a reference for "is this something generalizable across MILP solvers?")

@hdavid16
Copy link
Contributor Author

hdavid16 commented Nov 4, 2022

@hdavid16
Copy link
Contributor Author

hdavid16 commented Nov 4, 2022

Gurobi callbacks seem to allow accessing this using MIP_CUTCNT:

https://www.gurobi.com/documentation/9.5/refman/cb_codes.html

@odow
Copy link
Member

odow commented Nov 6, 2022

I don't know how feasible this is to implement. For CPLEX, we'd have to loop over every cut type, and for Gurobi, it looks like it reports the number of cuts at the particular node in the tree, so you'd have to figure out how to count the number of cuts in the optimal solution, or potentially the number of cuts that were applied at any node in the tree?

When is the number of cuts a useful statistic?

@hdavid16
Copy link
Contributor Author

hdavid16 commented Nov 7, 2022

I see. I find that the number of nodes explored and the number of cuts applied gives a good indication of the amount of work required to solve the problem. I was hoping reporting the number of cuts would require similar effort to reporting the number of nodes explored. I can also just continue with my current approach which is to parse the optimizer log to get the number of cuts.

@odow
Copy link
Member

odow commented Nov 7, 2022

If you know the particular solver you are supporting, just write the solver-specific code. But this seems hard to do in general (we can't easily get values out of Gurobi's callback).

@hdavid16 hdavid16 closed this as completed Nov 7, 2022
@odow
Copy link
Member

odow commented Nov 7, 2022

If I see someone else ask for this in future, we can re-open and reconsider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants