What is the algorithm's complexity for a variant of the TSP problem where every node must be visited at least once, meaning that a node can be visited more than once? (The cycle starts from a specific node and, after passing all nodes (at least once) returns to the start node)
In the below link, I found a relevant algorithm, but its complexity is not given. https://stackoverflow.com/questions/75028657/find-the-shortest-cycle-in-a-positive-weighted-directed-graph-passing-through-on/75032146?noredirect=1#comment132525164_75032146
Assuming the algorithm from the mentioned stackoverflow post (presented without a proof of correctness)
Taking into account the operations commented on the algorithm the complexity is $O(N^2 log(N) + N + N^4)$ that can be simplified as $O(N^4)$.
A correct algorithm
An algorithm easy to prove correct is
And has complexity $O(N^3 + N!)$, this makes me suspicious about the previous algorithm, is it providing a faster algorithm for TSP problem on fully connected graphs?
Proof
By construction, if G' has an edge (u,v), the shortest path in G is the cost of the edge (u,v). If w is in the shortest path connecting u to v, G' also have edges (u,w) and (w,v).
So G' gives a way to hide the complexity of shortcuts.
The minimum cost trip G' is $u_0, u_1, \ldots, u_N$, has the minimum cost achievable for a trip passing through $u_0, u_1, \ldots, u_N$ in G. The solution the TSP G' is the minimum cost trip considering all the permutations of the vertices. Any trip visiting all the vertices of G' will have cost higher than at least one subsequence that gives the permutation of all the vertices of G. It follows that the minimum achievable cost of a trip visiting all the vertices in G is the cost of the optimal TSP solution in G'.