optimise tsp algorithm so that penalty is weighted