Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Hello, @Sim! I don't know about Gurobi, so perhaps its behaviour could be different, but at least with GLPK, you have the following possibilities:

  1. If M has a solution: The instruction M.solve() should show you the optimum value of the objective function. Additionally, you can write M.get_values(x), where x is the family of variables of the MILP, in order to get the values that produce the optimum.
  2. M is infeasible: Sage should show you the message "MIPSolverException: GLPK: Problem has no feasible solution".
  3. Timeout (which you have imposed): Given that you imposed the time restriction, it should be as easy as to add a print statement with a message such as "Time constraint exceeded!"

Concerning the option "terminated by some external factor", it is not clear to me what you mean by "external factor". However, any event I could think of that could fit this description, should be rare enough to not have to worry about it. (Perhaps you could elaborate on this or present a couple of hypothetical examples.)

I hope this helps!