Simulated Annealing Algorithm Explained from Scratch (Python)