I love TSP problem, I usually use this in other topics but here need to design TSP problem to find minimum cost for moving between cities. This algorithm is not made by me, As you know I searched and use available sources on the internet, really the internet is helpful.
The travelling salesman problem (also called the travelling salesperson problem or TSP) asks the following question: "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?" It is an NP-hard problem in combinatorial optimization, important in theoretical computer science and operations research.
Read more: https://en.wikipedia.org/wiki/Travelling_salesman_problem
$ g++ tsp.cpp -o tsp
$ ./tsp
© Copyright 2021, Max Base