I have applied the simulated annealing algorithm (in Java) to a personal project that I am working on, but was wondering if the SA algorithm would perform slightly better on the same dataset if written in another language (i.e. C++, Python, etc).
The dummy dataset that I have created consists of five thousand users’ names, postcodes and dates of birth.
The SA algorithm is applied to the dataset in order to extract many different pieces of information.
At present, my most recent test is attempting to get the SA algorithm to detect all users whose birth dates fall within one week of each other (in any given year). Now, the SA algorithm works very well indeed; however, as I am a perfectionist, I would like to achieve slightly faster results and want to know if anybody has had any good experiences with SA producing excellent results on a similar-sized dataset, but written in other languages?
At the moment, the SA algorithm takes just under five seconds to perform a successful search.
I would write it in Java
prints
Often the algorithim you use is more important than the choice of language.
EDIT: In answer to your original question, could you make this faster in C++ with the same algorithim? I would guess yes, but not by alot.
To speed it up further you could use multiple threads.
prints
which implies an average of about 31 ns per search.