running time

S

Sin C. Ho

I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but the
next 1000 iterations use 0.02 min. and the next 1000 iterations also use
0.02 min. Every iteration does exactly the same thing, and I don't
understand how come the first 1000 iterations use less time than the
rest. I hope you guys can help me out.

Sin
 
V

Victor Bazarov

Sin said:
I implemented a neighborhood search algorithm using C++ and STL. A
strange thing is that the first 1000 iterations use 0.01 min., but the
next 1000 iterations use 0.02 min. and the next 1000 iterations also use
0.02 min. Every iteration does exactly the same thing, and I don't
understand how come the first 1000 iterations use less time than the
rest. I hope you guys can help me out.

Increase the number of iterations to one million to get better resolution.

V
 
S

Sin C. Ho

Victor said:
Increase the number of iterations to one million to get better resolution.

V
Actually, I set the total number of iterations to 100,000. The first
1000 iterations require less time than the next 1000 iterations'.

Sin
 
V

Victor Bazarov

Sin said:
Actually, I set the total number of iterations to 100,000. The first
1000 iterations require less time than the next 1000 iterations'.

How sure are you about that? What's your way of timing your one thousand
iterations (whether first or next)? What if you time 900 or 1200, how
much different will the reading be?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,199
Messages
2,571,045
Members
47,643
Latest member
ashutoshjha_1101

Latest Threads

Top