- Apr 16, 2005
- 407
- 0
- 71
Basically, I have 10 objects that I'm tracking with x and y coordinates. I want to find the shortest path (distance-wise) between an arbitrary starting object and any ending object. BUT I want to hit every object in between as well.
From what I've looked up, this is extremely close to the traveling salesman problem. The difference being I don't necessarily want to come back to the starting point. I just want the shortest total distance that I can find while still getting to all of them.
Are solutions to the traveling salesman problem the closest I'm going to come to this, or is there another algorithm that I'm unaware of?
I could always brute force the problem in question, but that looks all sorts of not-fun.
And yes, this may technically be mathematical more than coding, but I'm writing it in code. Which is why this is posted here.
From what I've looked up, this is extremely close to the traveling salesman problem. The difference being I don't necessarily want to come back to the starting point. I just want the shortest total distance that I can find while still getting to all of them.
Are solutions to the traveling salesman problem the closest I'm going to come to this, or is there another algorithm that I'm unaware of?
I could always brute force the problem in question, but that looks all sorts of not-fun.
And yes, this may technically be mathematical more than coding, but I'm writing it in code. Which is why this is posted here.
