Add functions to test TSP validity of outputs.