If I input an arbitrary amount of points [x1,y1].....[xn,yn] into a function I need to somehow return/print the shortest distance between all of the points. I understand how to find the distance between two points (fairly easy and straight forward), but how do I take an arbitrary amount of points and test each point with one another without testing each point with itself.

bradley1234
0
Newbie Poster

## Recommended Answers

Jump to PostThis sounds like the traveling salesman problem

## All 2 Replies

ddanbe
2,724
Professional Procrastinator
Featured Poster

vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.