-
Notifications
You must be signed in to change notification settings - Fork 2
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
Runner: record more metrics #44
Comments
I'm running solver highs for this MIP problem mip_1.lp
command Note:
HighsOutput
SummaryThe output from HiGHS indicates that the solver successfully found an integer feasible solution for the MIP
This confirms that the solver was able to find an integer feasible solution, as indicated by the "Solution status: feasible" and "Termination condition: optimal". Additionally, the primal and dual bounds matching, with a 0% gap, confirms that the solution is optimal. glpkOutput
SummaryInteger Feasibility: Duality Gap: GurobiOutput
SummaryInteger Feasibility: Duality Gap: SCIPOutput
SummaryIn the SCIP solver output: Gap: 0% |
@FabianHofmann , if you still have some time this week, we would also love your review on this code: solver-benchmark/runner/run_solver.py Lines 98 to 102 in ffc342f
We added max integrality violation and duality gap to the metrics recorded for MILPs. But I'm not sure if we've done it correctly. Also not sure what's the best way to analyze or present this information on the website? Currently, we've added a table to the Benchmark Details page, so if you select a MILP benchmark then you can see these 2 metrics for each solver: Thanks! |
@siddharth-krishna thanks for pointing that to me. The function itself is well written. I see the potential issue that all values are checked and not only those which are integer variables. So this would only work if we have a pure integer problem. Should I make a proposal to fix this? |
Thanks, Fabian, that would be super helpful. If you don't have time you could also make an issue with pointers to what we need to do. 🙏 |
@siddharth-krishna I have tried to come up with a solution, but it is quite hard since at this stage where we don't have the properties of the variables, whether there are integer variables or not. The only thing I can think about is to try to extract this quantity in the linopy function. I will look further what we can do here. the problem files can be both in MPS and LP format right? |
Thank you. It would also be useful for us to be able to get stats on how many variables are linear/integer/binary from linopy, we can display this on the website too. Currently we are doing it like this: https://github.com/open-energy-transition/solver-benchmark/blob/main/benchmarks/size_measurement.py Yes, some of our benchmarks are MPS and some are LP. |
hey @siddharth-krishna, the code you sent seems working well. so if you have a linopy.Model n_continuous = sum(v.size for k, v in m.variables.continuous.items())
n_integers = sum(v.size for k, v in m.variables.integers.items())
n_binaries = sum(v.size for k, v in m.variables.binaries.items()) but if we only have a raw file we without the linopy model, the current approach is good. |
Since you've passed the models to the solver, they should all be able to return the model in code, including a statement of the type of each variable. Since this is only problem data, you can use HiGHS (say) to get this, whatever solver you are benchmarking. |
@FabianHofmann (and @danielelerede-oet) I am afraid the code in https://github.com/open-energy-transition/solver-benchmark/blob/main/benchmarks/size_measurement.py does not work for MPS files where the integrality of some variables is specified using lines such as:
@jajhall , how can I get the type of each variable using
|
[status, integrality] = h.getColIntegrality(col) |
For MIP, also check if they've found an Int feasible solution and then check duality gap -- measure of how well they've done.
For LP, if we use IPM, do we crossover to get a basic solution? What solution quality do we require? Vertex or optimal?
The text was updated successfully, but these errors were encountered: