Hello everyone,

I'm trying to obtain the time to find all integer solutions. What I need is that XPRES prints out or anyway returns the time elapsed since the execution started every time a new integer solution is found. Is there a way to do that? I know already of the gettime approach, but that seems to work only to obtain the whole time of execution (i.e. from the beginning until the execution stops becuase it has found the optimal solution). What I need is different since I need to have the time needed to find every solution from the beginning, not just the total time of execution.

Thank you very much for your help

I would suggest that you define an integer solution callback to display or save the time for every solution: with Mosel, this could be something like this (see also the example FICO Xpress Optimization Examples Repository: Mosel: Folio - Advanced modelling and solving tasks , for the same example with BCL see: FICO Xpress Optimization Examples Repository: BCL C: Folio - Examples from Getting Started / FICO Xpress Optimization Examples Repository: BCL Java: Folio - Examples from Getting Started ):

! Set a MIP solution callback

setcallback(XPRS_CB_INTSOL, "printsol")

! Solve the problem

starttime:=gettime

maximize(MyObj)

public procedure printsol

writeln(gettime-starttime, "sec. Solution number ", getparam("XPRS_MIPSOLS"), ". Objective value: ", MyObj.sol)

end-procedure