Update tsp.cpp

added check to NaN values in adjacency matrix