Reputation: 5
So I've been given this task and I do not know how to use the information regarding the costs. This is the requirement and I have no additional information.
Upvotes: 0
Views: 1206
Reputation: 191
This should be solvable by Double Tree approximation algorithm for solving TSP (Traveling Salesman Problem) / Hamilton Circuit. It requires two conditions of input graph to be met:
The algorithm works like this:
This algorithm is 2-approx (the cost of the circuit is at max double the optimal solution - there is a proof for this which I can provide if you want). The worst complexity is O(e + vlog(v)) - e is number of edges, v number of vertexes... this should map to yours O(m + nlog(n)).
I could not find any good link with the algorithm explanation at the moment, I will try to provide it later.
Upvotes: 1