ASKSAGE: Sage Q&A Forum - RSS feedhttps://ask.sagemath.org/questions/Q&A Forum for SageenCopyright Sage, 2010. Some rights reserved under creative commons license.Thu, 12 Aug 2021 04:18:10 +0200Sage9.3 getting MILP model status after solve()https://ask.sagemath.org/question/58417/sage93-getting-milp-model-status-after-solve/I'm using Sage9.3 MixedIntegerLinearProgram. After attempting to solve a milp problem M using M.solve(), when the program stops it could be<br>
- M is solved with solution<br>
- M is infeasible<br>
- timeout (which I have imposed)<br>
- terminated by some external factor<br>
Is there a way (or function) to determine the status of M?
I'm using both GLPK and Gurobi, so would appreciate solutions for both solvers.
Thanks.SimThu, 12 Aug 2021 04:18:10 +0200https://ask.sagemath.org/question/58417/Execution time vs. Computation time in MILPhttps://ask.sagemath.org/question/30495/execution-time-vs-computation-time-in-milp/ Hi,
I am using GLPK in Sage 6.9 to solve MILP problem. I am also using the `Solver_parameter('timelimit')` to terminate the problem after the specficied time. According to [SageMath documentation](http://doc.sagemath.org/html/en/reference/numerical/sage/numerical/mip.html), `"timelimit" defines the maximum time spent on a computation. Measured in seconds.` However, I am a bit confused with this definition. This is because:
I am solving `the same problem` with `the same timelimit value` for `different input values (generated randomly using uniform distribution)` while I was printing `execution time` of each. I have noticed `different execution times` when I am giving `different inputs` (ranging from 1min, 5mins, to even 10mins).
Can some one please tell me how the `computation time` is calculated for timelimit? Why they are different even though I used the same problem with the same timelimit? Is it something related to the size of the input, as its only difference between them? Is there any relation between `computation` and `execution` times?
Cheers,
Aissan
Aissan DalvandiFri, 06 Nov 2015 03:24:44 +0100https://ask.sagemath.org/question/30495/solver_parameter('timelimit') doesnt workhttps://ask.sagemath.org/question/30420/solver_parametertimelimit-doesnt-work/Hi,
I have an MILP problem and trying to solve it with Sage, GLPK solver. As I want to terminate the problem before getting the optimum answer, I am using the `p.solver_parameter("timelimit", 60)`. I have also used
try:
p.solve()
except MIPSolverException:
b = p.get_backend()
print('best known opjective bound', b.best_known_objective_bound())
However, the solver doesn't stop!!! It keeps runing. I guess the `time limit` part doesn't work.
Its interesting that the `p.solver_parameter("time limit")` its affected, as I am printing its value before passing the `p.solve()`. I have also tried `p.solver_parameter( backend.glp_simplex_or_intopt, backend.glp_intopt_only)` and printed the `p.solver_parameter("time limit_intopt")`. It's printing `60000` which is right.
I have no idea why it keeps running.
Could anyone help me with this issue?
Thanks in advance,
Cheers,
AissanAissan DalvandiTue, 03 Nov 2015 07:47:45 +0100https://ask.sagemath.org/question/30420/