1.Ways to manage solution status
a.Check the Status attribute to see the result of the optimization
代码:if m.Status == GRB.OPTIMAL: for v in m.getVars(): print v.VarName, v.X
b.Use SolCount attribute to see whether any solutions were found
代码:if m.SolCount > 0: for v in m.getVars(): print v.VarName, v.X
2.Catching exceptions in OO interfaces
代码:try: m = read(sys.argv[1]) m.optimize() for v in m.getVars(): print v.VarName, v.X except GurobiError as e: print "Error:", e
3.LP模型
LP does not allow strict inequality (< or >)



