Question: This is a step of simulated annealing algorithm for TSP, in Python. But I don't get what it does. It says True, but is it
This is a step of simulated annealing algorithm for TSP, in Python. But I don't get what it does. It says True, but is it talking about what condition? what are i and j? why should one be bigger than the other one? Please explain
def propose_move(self): n = self.n #number of cities while True: i = np.random.randint(n) j = np.random.randint(n) if i != j: break if i > j: i, j = j, i return (i,j)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
