Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Your pseudo code is not simulated annealing. You are randomly jumping in search space without any aim. </p> <p>Your first question: </p> <blockquote> <p>In step 2 when performing swapping, currently I am swapping elements of the array. Is it correct? Or should I keep track of the previous solution and swap current element (i) with previous solution element? (This is just an idea).</p> </blockquote> <p>You should implement a function called perturb. This perturb should exchange your array values.Simulated Annealing , as its name implies uses concept of annealing. That means you start hot. Your perturb function changes values wildly.Then your solution starts cooling down that means your perturb function changes values only a little.</p> <p>See following <a href="http://www.sph.umich.edu/csg/abecasis/class/2006/615.19.pdf" rel="nofollow">presentation</a></p> <blockquote> <p>z Gradual cooling of liquid … </p> <ul> <li>At high temperatures, molecules move freely</li> <li>At low temperatures, molecules are "stuck"</li> </ul> </blockquote> <p>According to your solution , you get your randomness in following line.</p> <blockquote> <p>2) Perform random swapping of values in the 5D array above.</p> </blockquote> <p>Here is how you should implement Gradual cooling.</p> <ul> <li>2a) int MaxRandomValueToAddToArrayValues = 20; </li> <li>2b) How did I find 20, it is domain knowledge. According to your values and best solution 20 seems a good value.</li> <li>2c) Perform random swapping of values in the 5D array above using this boundary </li> <li>2d) gradually decrease MaxRandomValueToAddToArrayValues. For example for every 10 iteration you may decrease it by 0.1. </li> </ul> <p>Your second question: </p> <blockquote> <p>When using real values in the array how can I tell the system during execution that the previous solution was close to the max boundary </p> </blockquote> <p>You cannot know if your solution is close to max boundary. You can only know that your solution is better than previous ones. If we can know max boundary why implement SA or any other heuristic method. It is impossible or very expensive to know best solution (in your word max boundary), therefore we use heuristic solutions.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload