Credit: ZenShui/Eric Audras PhotoAlto Agency RF Collections Getty Images
Q:

# What is the nearest neighbor algorithm?

A:

The nearest neighbor algorithm is one of the initial approximate algorithms used in finding a possible solution to the travelling salesman problem. Though it shortens the tour, it is a sub-optimal solution.

Know More

## Keep Learning

There are several steps to follow when applying the nearest neighbour algorithm to the problem. First, one has to choose an arbitrary vertex as the current vertex. Then, the shortest edge that connects an unvisited node to the current vertex should be determined. This unvisited point should then be set as the current vertex and marked as visited. If, after this, all the vertices in selected domain are visited, one should terminate the process. If not, then one should execute the second step again. Practical areas where this algorithm has been successfully used include coding satellite images, analysing handwritten digits and solving regression problems.

Sources:

## Try a quiz

Q:
How do you know if the Queen is at Buckingham Palace?

## Related Questions

• A:

The term "J-curve" is a type of population growth wherein a population grows exponentially without restrictions. It is also known as the exponential curve.

Filed Under:
• A:

To find the mode of a number set, put the numbers in order, then count how many times each number appears. The mode is the value that appears the most often.

Filed Under:
• A:

According to an article from the Wharton School at the University of Pennsylvania, one way statistics are misused is when businesses infer false information from data gained during the course of their business, creating errors that cost time and money. Errors like this arise when an entity performs statistical research but fails to address all the components involved in the subject they are researching.