operations-research / tsp_constructive /seed_solution_idea.txt
Qi Liu
Upload folder using huggingface_hub
26e50bc verified
Raw
History Blame Contribute Delete
276 Bytes
The nearest neighbor heuristic. At each step, simply choose the closest unvisited city from your current location.
This is greedy and myopic (doesn't look ahead), but it's fast and intuitive.
Typically produces tours that are 20-30% longer than optimal, but takes O(n^2) time.