Neural network algorithm with optimized parameters and used to solve TSP