Note that every time you run this algorithm, different configurations will be generated and for this reasons this is called a stochastic algorithm. When doing this kind of simulations, you need to look at the average results over many repetitions to obtain a statistically correct answer. Thus, you should prepare the code so that a full simulation can be repeated 𝑁rep number of times, where 𝑁rep is a number to be decided (see more later).