Nearest neighbour
Nearest neighbour is a greedy algorithm initially to find the shortest path among a graph. It is typically used to solve problems like Traveling Salesman.
It basically works like Prim's algorithm, but the next nearest vertice needs to be connected to the last one.
Complexity
- Worst case:
- Best case: