Open 4er4er4er opened 11 months ago
solution to p-l approximation
can be difficult. First, the default behavior may change in future. Second, user might have .global suffixes.What about compacting solution check warnings? It can be a table as follows, with the lines appearing only when there are violations of the corr. type:
WARNING: Solution check violations
Type Max MaxRel [Name]
Var Bounds ..............
Linear Cons ..............
Nonlinear Cons ..............
Logical Cons ..............
Expression 'exp' .............
Expression 'numberof' ............
Objective(s) ...............
Nonlinear Cons* ..............
Logical Cons* .............
Nonlinear Obj(s)* ..............
*: AMPL may evaluate constraints/objectives differently
than the solver, see mp.ampl.com/solution-check.html.
Docu enhancement: https://mp.ampl.com/solution-check.html#warnings-format now contains a list of expressions.
But ideally we should have this list somewhere in the modeling guide?
@4er4er4er @fdabrandao I am experimenting with compact format #200 which reports the following for the above example:
Gurobi 11.0.0: optimal solution; objective 0.4260218562
425 simplex iteration(s)
48 branching node(s)
------------ WARNINGS ------------
WARNING: "Tolerance violations"
Type MaxAbs [Name] MaxRel [Name]
objective(s) 2E-04 5E-04
Documentation: mp.ampl.com/modeling-tools.html.
WARNING: "Tolerance violations (solver model)"
Type MaxAbs [Name] MaxRel [Name]
expr ':exp' 2E-03 9E-04
Let me know any comments.
Changing once more as follows:
WARNING: "Tolerance violations"
Type MaxAbs [Name] MaxRel [Name]
objective(s) 2E-04 5E-04
* expr ':exp' 2E-03 9E-04
*: Using the solver's aux variable values.
Documentation: mp.ampl.com/modeling-tools.html.
Gurobi 10 and 11 give somewhat different results for piecewise-linear approximation of this simple test problem:
Gurobi 10 with
nonconvex=2
reports:Since this is a feasible solution to a minimization of a piecewise-linear approximation, it's expected that the objective will be greater than the true solution. But it only differs by 1 in the 7th digit from the "true" objective value of 0.4262087102 returned by Gurobi 11 with
funcnonlinear=1
and also by Knitro.Gurobi 11 with
funcnonlinear=-1
reports the following:So the result has changed. Maybe that is OK, but here are two questions to consider:
Gurobi uses significantly fewer nodes and simplex iterations, but returns an objective value that is only correct to 4 places. Can this be explained by the change in the default behavior of FuncPieces previously mentioned by Gleb?
Is the long warning appropriate for the piecewise-linear case? In other situations, this kind of message warns that the solution may be incorrect, whereas here Gurobi has correctly found a solution to the p-l approximation that the user requested. If MP can tell when a p-l approximation has been solved, then an alternative to the warning would be to adjust the solve result message to something like this:
Gurobi 11.0.0: optimal solution to p-l approximation; objective 0.4260218562