TSP dynamic alghoritm