Change in computational time

1 view (last 30 days)
Rithul
Rithul on 9 Jul 2013
Hi,
I wrote a code for TSP using nearest neighbor search and improved the generated tour using 2-opt pairwise exchange, the number of cities were 401. The first time it ran the code MATLAB said elapsed time 8.1 hr (using tic-toc), however, I ran it a few times after that and the elapsed time always stays between 7-8 seconds, the final answer and plot are the same. I was wondering how this is possible, as a reduction from 8 hr to 8 sec is pretty large, does MATLAB retain memory of the previous result somehow?
Thank You, Rithul

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!