Recently, I participated in a coding competition. The problem sounded like TSP. I am not looking for a solution here. I just want to find out if the problem was a variant of TSP and if it was solvable.
Here is the summary:
We were given a Complete weighted graph. Each city (vertex) was connected with remaining cities. All connecting distances were positive integers. The graph was undirected.
Problem was to compute maximum total distance to visit all cities. No cycles allowed. No starting point provided. One peculiar thing was that once we travel from A to B with cost c, immediate return to A from B was allowed with 0 cost. For example, this is a valid path. A --> B --> A --> C --> D
Constraints: No. of Cities <= 100000 No. of Paths <= 1000000 Distance between cities <= 1000
Time limit for a single test case 0.5 seconds.
P.S. : I used nearest neighbors algorithm, passed sample test cases but couldn't meet the 0.5 second time limit for larger test cases.