Q:

What is the nearest neighbor algorithm?

A:

Quick Answer

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.

Continue Reading
What is the nearest neighbor algorithm?
Credit: ZenShui/Eric Audras PhotoAlto Agency RF Collections Getty Images

Full Answer

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.

Learn more about Statistics

Related Questions

  • Q:

    What is the simplest solution to a Rubik's cube?

    A:

    A simple solution to a Rubik's cube is the algorithm R' D' R F' D' R R’ D D R D R’ D’ R F R U R’ U’ F’ R U R’ U R U U R’ U U R U’ L’ U R’ U’ L R’ D’ R D. The algorithm uses the key: F for front, R for right, U for up, B for back, L for left and D for down. Apostrophes mark counter-clockwise rotations.

    Full Answer >
    Filed Under:
  • Q:

    How do you resolve a tree dispute with your neighbor?

    A:

    An individual can resolve a tree dispute with a neighbor by talking to the neighbor about the tree issue, and if the neighbor does not do anything to resolve the problem, the individual may have the option to take him to court, FindLaw says. The tree may be considered a nuisance by law, and, therefore, an individual could initiate a nuisance claim with the court.

    Full Answer >
    Filed Under:
  • Q:

    What are some tips for handling a neighbor's barking dog?

    A:

    Deal with a neighbor's barking dog by making the neighbor aware of the situation, asking him to resolve the problem, and then following up with the proper authorities if the problem isn't resolved. Landlords, property managers and the police are all resources to use if the problem can't be resolved amicably between the neighbors.

    Full Answer >
    Filed Under:
  • Q:

    How do you stop your neighbor's dogs from barking?

    A:

    The best way to quiet a neighbor's barking dog is usually to approach the neighbors and ask them to find a solution, according to WTOP. If the problem persists, try contacting the landlord, housing association or animal control.

    Full Answer >
    Filed Under:

Explore