PATHSolver.jl icon indicating copy to clipboard operation
PATHSolver.jl copied to clipboard

Support MOI.SolveTimeSec

Open kamilkhanlab opened this issue 3 years ago • 3 comments

According to this example in JuMP's documentation, JuMP.solution_summary(model) may report the following information:

  • CPU time required by a completed optimization run
  • the identified solution (if any)
  • and numbers of different types of iterations.

Could PATHSolver.jl's JuMP.solution_summary report this information as well? This would be helpful when performing quick one-off experiments or perturbations in the REPL. (Currently only the termination status is reported.)

kamilkhanlab avatar Jul 25 '22 00:07 kamilkhanlab

  • Solve time means implementing MOI.SolveTimeSec, which is easy.
  • For the solution, you need to use solution_summary(model; verbose = true). PATHSolver should already report that?
  • For the iterations, we can really only report the number of simplex or barrier iterations, which PATH doesn't use. So I don't know what we should put here.

odow avatar Jul 25 '22 00:07 odow

  • You are correct about verbose=true -- that's good to know. (Since PATH only solves constraint satisfaction problems, I'd suggest that the optimal solution is more important than the optimal objective value even without verbose=true, but that is just my opinion.)
  • Regarding iterations, if we run the example listed in the repo's README without setting "output" => "no", then the solver produces ~150 lines of output, ending with:
     Major Iterations. . . . 103
     Minor Iterations. . . . 134
     Restarts. . . . . . . . 2
     Crash Iterations. . . . 3
     Gradient Steps. . . . . 7
     Function Evaluations. . 301
     Gradient Evaluations. . 109
     Basis Time. . . . . . . 0.000374
     Total Time. . . . . . . 0.014600
     Residual. . . . . . . . 4.965068e-16
    
    Perhaps JuMP.solution_summary could report the residual, and the numbers of function evaluations, major iterations, and restarts.

kamilkhanlab avatar Jul 25 '22 00:07 kamilkhanlab

I'd suggest that the optimal solution is more important than the optimal objective value even without verbose=true, but that is just my opinion.

The primal solutions are hidden behind verbose=true because it's common for JuMP problems to contain 10,000+ variables, so we don't want to print them all by default.

could report the residual, and the numbers of function evaluations, major iterations, and restarts.

solution_summary has to work independently of the solver. So we don't want to add lots of solver-specific attributes like the number of restarts.

We can add the solve time, but that's about it.

odow avatar Jul 25 '22 00:07 odow