python code of 2 opt algorithm