GraphHopper.com | Forum | GitHub | Maps | Blog

Is there algorithm time limit?


#1

Is there a way to limit number iterations by time?


#2

Yes there is. Besides setting the maximum number of iterations, jsprit supports three types of premature termination. Check them out here:


#3

Perfect. Thanks a lot.
What is the variation coefficient termination?


#4

If the coefficient of variation of the solutions obtained in the past X iterations is smaller than a specified threshold, the algo will terminate.

You can check out the implementation here:


#5

In which case changing of this value can be useful?


#6

In the case of dynamically terminating a solution. You might decide that if the last 100 iterations amount to nothing but bashing your head against the wall, you might as well terminate. This termination criteria requires no assumptions on your part re: how many iterations are needed or how long an algorithm should run.

So, one solution may terminate after 2 minutes and 1000 iterations, another after 30 secs and 1500 iterations. Clearly, those problems will be of drastically different size and constraint complexity, but both were terminated when the last 100 iterations were detected as not giving any real improvement. They terminated when they were considered “solved”.


#7

Thanks for your reply


#8

Are there recommended values of number of solutions and threshold?