Design of Heuristic Algorithms for Hard Optimization: With Python Codes for the Travelling Salesman Problem