I'm looking for advice or resources to solve a problem similar to TSP but where:
This means, given these cities (where x
are cities and visual space between each x
are proportional to distances between cities):
x
x x
x
A regular-TSP solution could be:
x
|\
| x-x
| /
x-/
But I would like this kind of solution, which is better according to the new rules:
x
\
x-x
/
x
Does this problem have a name and are there some publication about an optimized solution?
You are describing the minimum spanning tree (MST) problem. You got lucky! Because while TSP is NP-hard, the MST is among the easiest combinatorial optimization problems to solve, computationally. It can be solved in O(m log n) time through a straightforward implementation of either Prim's or Kruskal's algorithm (and, both of those algorithms are also pretty easy to code). There are also other algorithms and other data structures that can make the complexity even lower, but if you have 30 nodes, either of these algorithms will solve it in a fraction of a second.