Return solve time of intlinprog
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
Does intlinprog return the solve time of a MILP? I can't seem to find this in the documentation--the solve time is not one of the fields returned by the output struct. I realize that this information is displayed during the solve process, but I'd like to access it programmatically after a solution has been found.
(I'm aware that I can wrap the intlinprog call in tic / toc. But this seems redundant when intlinprog is itself tracking the solve time. There also seem to be issues with using tic / toc in a parfor loop, which I am planning on using.)
0 comentarios
Respuestas (1)
Ninad
el 22 de Sept. de 2023
Hi James,
As per my understanding you would like to find the solve time of a MILP problem solved using ‘intlinprog’ in MATLAB, without relying on ‘tic’ and ‘toc’.
The ‘intlinprog’ function in MATLAB does not explicitly track the solve time. It does not provide an output field specifically dedicated to the solve time. Instead, ‘intlinprog’ relies on the underlying solver to handle the solve process and track the time internally.
You may use the ‘datetime’ function for the same if you are dealing with ‘parfor’ loop.
It returns an array that represents points in time. You can note the time at the begin of thread and note the time just prior to ending the thread and then use simple arithmetic operation to note the runtime of each thread.
I have attached a dummy code in the ‘solveTime.m’ file that uses the ‘datetime’ function to calculate the runtime of each thread created using a ‘parfor’ loop.
You may find detailed documentation for the ‘datetime’ function here: https://in.mathworks.com/help/matlab/ref/datetime.html
I hope this helps.
Thanks,
Ninad.
0 comentarios
Ver también
Categorías
Más información sobre Statics and Dynamics en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!