Nearest neighbour algorithm
From Wikipedia, the free encyclopedia
- Start at some vertex, at mark it as current.
- From the current vertex, take the shrtest edge that connects it to an unvisited vertex V.
- Set the current vertex to V.
- If there no unvisited vertices left, you are done.
- Else, go to step 2.
Such algorithms are easy to implement, but they do not always find the best solution. What is worse, the algorithm may not find a tour even if one exists.