[R] Repeated SANN values.

rkevinburton at charter.net rkevinburton at charter.net
Tue Apr 7 17:13:51 CEST 2009


I tried optim using the SANN algoithm. To start things out I tried the example of solving the "traveling salesman" problem as given in the documentation. The example works just fine. But if I comment out the line:

set.seed(123) # chosen to get a good soln relatively quickly

More often than not it doesn't converge to the optimum solution as shown in the example. Alos with trace on it seems that the algoritm is easily fooled by a local mimimum as once it gets close to the solution it seems to get "stuck" and repeatedly returns the same value: A sample run:

sann objective function values
initial       value 29625.000000
iter     5000 value 13972.000000
iter    10000 value 13501.000000
iter    15000 value 13501.000000
iter    20000 value 13501.000000
iter    25000 value 13487.000000
iter    29999 value 13487.000000
final         value 13487.000000
sann stopped after 29999 iterations

Not that familiiar with the algoritmn Is that just a drawback of the algorithm or can I adjust the anealling temperature (temp) or the maximum "temperature" (tmax) or even the mximum number of iterations to kick it out of what appears to be a local minimum? I am willing to sacrifice extra compute time for better accuracy.

Kevin




More information about the R-help mailing list