I have a problem to solve that I think is the Traveling Salesman type. I know that the traveling salesman problem most commonly discussed restricts the number of visits in each city to just one visit and that the city must all be accessible from any point. However, in the real world, this is not always possible. For example, let's examine the figure below.
Solving this problem via the problem of the usual traveling salesman (using the TSP library of R) I have a travel cost of 440 km (A -> B -> C -> D -> A), for example. However, in the second image (trying to simulate the real world) I find a smaller path, with a cost of 400 km (A -> B -> C -> B -> D -> B -> A).
What I would like to do is visit all cities with the shortest possible distance, regardless of the number of visits. There must be something ready about it, but I couldn't find it. Does anyone have any suggestions?
Thanks in advance.