The 'traveling salesman problem' (TSP) is a well-known NP-hard problem in combinatorial optimization, theoretical computer science and operations research with multiple variations and related interesting questions also on stackexchange.
I am interested here in the TSP on a simple graph (loops or multi-edges won't make a difference, no weights): Given a list of vertices and the distances between each pair of vertices given by the graph distance, what is the shortest possible route that visits each vertex (on the list) at least once and returns to the origin vertex?
For this TSP on the graph $g$, I am defining the TSP-polynomial as a generating function the number $k$ of vertices and all sets of vertices $v_1,... v_k\in V(g)$ in the vertex set of $g$
$$ \mathrm{TSP}^g (x,y) = \sum_{k=1}^n y^k\, \mathrm{TSP}_k^g (x) = \sum_{k=1}^n y^k \sum_{v_1,v_2,... v_k\in V(g)} x^{\mathrm{MCL}(v_{1},... v_k)}$$
where $\mathrm{MCL}$ is the 'minimal cycle length' or 'length of the TSP cycle' visiting all vertices $v_1,... v_k$ (in arbitrary order).
This is designed, so that the average length of the TSP cycle over $k$ vertices is $\frac{d}{dx} \ln ( \mathrm{TSP}^g_{k} (x) )\vert_{x=1}$; also, other moments of the distribution of minimal lengths can be easily calculated.
I am wondering
Is this polynomial known or a variation of a known polynomial?
Below a few examples and notes.
Example of the complete graph's TSP-polynomial
- For the triangle $K_3$, the polynomial is $\mathrm{TSP}^{K_3} (x,y)= 3y +3y^2 x^2+y^3 x^3$
- For the complete graph $K_8$ with 8 vertices, it is $\mathrm{TSP}^{K_8} (x,y) = 8 y + 28 x^2 y^2 + 56 x^3 y^3 + 70 x^4 y^4 + 56 x^5 y^5 + 28 x^6 y^6 + 8 x^7 y^7 + x^8 y^8 $
- For the complete graph $K_n$ with $n$ vertices, it seems to be $\mathrm{TSP}^{K_n} (x,y) = n y + \sum_{k\geq 2} \binom{n}{k} (yx)^k $
This is a simple expression: could be due to the fact, that for the complete graph, the distance of all vertices is the same and thus minimization of the cycle is trivial.
Example of the cycle graph's TSP-polynomial
- For the 4-cycle $C_4$, the polynomial is $\mathrm{TSP}^{C_4} (x,y)=4 y + (4 x^2 + 2 x^4) y^2 + 4 x^4 y^3 + x^4 y^4 $
- For the 6-cycle $C_6$, it is $\mathrm{TSP}^{C_6} (x,y)= 6 y + (6 x^2 + 6 x^4 + 3 x^6) y^2 + (6 x^4 + 14 x^6) y^3 + 15 x^6 y^4 + 6 x^6 y^5 + x^6 y^6 $
- For the 8-cycle $C_8$, it is $\mathrm{TSP}^{C_8} (x,y)=8 y + (8 x^2 + 8 x^4 + 8 x^6 + 4 x^8) y^2 + (8 x^4 + 16 x^6 + 32 x^8) y^3 + (8 x^6 + 62 x^8) y^4 + 56 x^8 y^5 + 28 x^8 y^6 + 8 x^8 y^7 + x^8 y^8 $
- It seems that $\mathrm{TSP}^{C_{2n}} (1,y) = (1+y)^{2n}-1 = \sum_{k\geq 1} \binom{2n}{k} y^k$
- ... and $\mathrm{TSP}^{C_{2n}} (x,1) = 2n (1+\sum_{k=1}^{n-1} 2^{k-1} x^{2k}) + (4^n-n 2^n-1) x^{2n}$
Also, $\mathrm{TSP}^{C_{2n}}_k (x) = \binom{2n}{k} x^{2n}$ for $k>n$, i.e. with more than $n$ stops on $C_{2n}$, you 'go the full circle'.
In general, we seem to have $$ \mathrm{TSP}^{C_{2n}} (x,y) = \sum_{k=1}^{2n} y^k \left( 2n \sum_{l=k-1}^{n-1} x^{2l} \binom{l-1}{k-2} + x^{2n} \left( \binom{2n}{k} - 2 k \binom{n}{k} \right) \right) $$
The star graph's TSP polynomial
- For the star with $3$ vertices, aka $K_{1,2}$ or $P_3$, it is $\mathrm{TSP}^{K_{1,2}} (x,y) = 3 y + (2 x^2 + x^4) y^2 + x^4 y^3 $
- For the star with $7$ vertices, aka $K_{1,6}$, it is $\mathrm{TSP}^{K_{1,6}} (x,y) = 7 y + (6 x^2 + 15 x^4) y^2 + (15 x^4 + 20 x^6) y^3 + (20 x^6 + 15 x^8) y^4 + (15 x^8 + 6 x^{10}) y^5 + (6 x^{10} + x^{12}) y^6 + x^{12} y^7$
- For the star with $8$ vertices, aka $K_{1,7}$, it is $\mathrm{TSP}^{K_{1,7}} (x,y) = 8 y + (7 x^2 + 21 x^4) y^2 + (21 x^4 + 35 x^6) y^3 + (35 x^6 + 35 x^8) y^4 + (35 x^8 + 21 x^{10}) y^5 + (21 x^{10} + 7 x^{12}) y^6 + (7 x^{12} + x^{14}) y^7 + x^{14} y^8 $
- More general, it seems $\mathrm{TSP}^{K_{1,n}} (1,y) = (n+1) y + \sum_{k\geq 2} \binom{n+1}{k} y^k $
The torus grid graph's TSP polynomial
- For the 3x3 torus with $9$ vertices, aka $T_{3,3}$, it is $\mathrm{TSP}^{T_{3,3}} (x,y) = 9 y + (18 x^2 + 18 x^4) y^2 + (6 x^3 + 36 x^4 + 36 x^5 + 6 x^6) y^3 + (9 x^4 + 72 x^5 + 45 x^6) y^4 + (36 x^5 + 81 x^6 + 9 x^7) y^5 + (48 x^6 + 36 x^7) y^6 + 36 x^7 y^7 + 9 x^8 y^8 + x^9 y^9 $
- $\mathrm{TSP}^{T_{n,m}}_{1} (x) = n m$
- $\mathrm{TSP}^{T_{n,m}}_{2} (1) = \binom{n m}{2}$
- $\mathrm{TSP}^{T_{n,n}}_2 (x) = \begin{cases} n^2 \sum_{j=1}^{n-1} \min\{ 2j, 2(n-j) \}\, x^{2j}, & \text{if } n\text{ odd} \\ n^2 \sum_{j=1}^{n-1} \min \{ n-1, 2j, 2(n-j) \}\, x^{2j} + n^2/2 \, x^{2n}, & \text{if } n\text{ even} \\ \end{cases}$
A few NOTES:
You could argue to add a term (1) to the definition for $0$ vertices: $\mathrm{TSP'}^g_0(x) := 1$. Also, you could argue to add loops (of length 1) to all vertices, then $\mathrm{TSP^g_1(x)}= n x$ and some of the TSP-polynomials may further simplify and factorize, e.g., $\mathrm{TSP'}^{K_n \text{ with loops }} (x,y) = \sum_{k=0}^n \binom{n}{k} (yx)^k = (1+yx)^n$.
With respective definitions (e.g., the sum is limited to sets of vertices in connected components, or vertex sets with undefined minimal cycle length are ignored), the TSP-polynomial of 2 disconnected graphs equals the sum of the 2 TSP-polynomials of the components; so, we can focus on connected graphs.
Furthermore, it is easy to see that
- $\mathrm{TSP}^g_{1} (x) = n x^0 = n$, there are $n$ 1-vertex sets aka vertices and the path length is $0$
- $\mathrm{TSP}^g_{n} (x) = x^{?}$, there is only one vertex set with all $n$ vertex sets; however, the length of the minimal cycle $?$ depends on the graph
- $\mathrm{TSP}^g_{k} (1) = \binom{n}{k}$, where $n$ is the number of vertices of $g$
My intuition tells me, that a closed formula will be combinatorically very difficult as the minimization step breaks symmetries and recursive approaches for non-linear/ non-1d graphs... but I may be wrong.
Also, if it was possible to calculate for the grid graph, it would be possible to calculate the Beardwood, Halton & Hammersley/ 'TSP constant' for Manhatten metric...
BTW wondering:
- What is the minimal pair of non-isomorphic graphs where the polynomial is the same? Or is it unique?
- What do operations on graphs (add, delete vertices and edges) or graph products do to the TSP-polynomial? The factorization of the complete graph with loops in the amended definition looks 'interesting' in this respect...
References
- https://en.wikipedia.org/wiki/Travelling_salesman_problem
- https://en.wikipedia.org/wiki/Distance_(graph_theory)
- https://en.wikipedia.org/wiki/Tutte_polynomial
- https://en.wikipedia.org/wiki/Hamiltonian_path
- https://mathworld.wolfram.com/GridGraph.html
- https://mathworld.wolfram.com/TorusGridGraph.html
- https://www.theoremoftheday.org/OR/BHH/TotDBHH.pdf
- https://arxiv.org/pdf/1311.6338
- **
- Why is the Traveling Salesperson Problem "Difficult"?
- Counting the Number of Paths in the "Travelling Salesman Problem"
- Suggestions for topics in a public talk about art and mathematics
- Understanding the reduction from Hamiltonian cycle to the traveling salesman problems
- Does the TSP (traveling salesman problem) change in difficulty when the number of dimensions is greater than the number of cities?
- https://arxiv.org/pdf/2001.00578
- **
- https://mathematica.stackexchange.com/questions/15985/solving-the-travelling-salesman-problem?noredirect=1&lq=1