Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Nearest neighbour algorithm
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{Short description|Algorithm for the travelling salesman problem}} {{About|an approximation algorithm to solve the [[travelling salesman problem]]||Nearest neighbor (disambiguation){{!}}Nearest neighbor}} {{Infobox Algorithm |class=[[Approximation algorithm]] |image= |caption= |data=[[Graph (data structure)|Graph]] |time=<math>\Theta(N^2)</math> |space=<math>\Theta(N)</math> |optimal=No |complete= }} The '''nearest neighbour algorithm''' was one of the first [[algorithm]]s used to solve the [[travelling salesman problem]] approximately. In that problem, the salesman starts at a random city and repeatedly visits the nearest city until all have been visited. The algorithm quickly yields a short tour, but usually not the optimal one.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)