LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

I need to find an algorithm which can calculate the shortest path through a certain number of points in space

In this case he probably doesn't need to return to the start point, so the problem is simplified:

 

http://stackoverflow.com/questions/7763432/what-is-the-difference-between-travelling-salesman-and-fi...

 

Also, the number of points is probably small, so the computation time should be quite quick for the shortest path.

_____________
Creator of the BundleMagic plugin for LabVIEW!
Message 11 of 17
(1,589 Views)

Yes, the "Travelling salesman problem" is exactly what i search for. Thank you very much. Now i only need to study hard....!

0 Kudos
Message 12 of 17
(1,554 Views)

Brute-force will be sufficient for the movement of a camera.

Jim
You're entirely bonkers. But I'll tell you a secret. All the best people are. ~ Alice
For he does not know what will happen; So who can tell him when it will occur? Eccl. 8:7

0 Kudos
Message 13 of 17
(1,544 Views)

I don't think brute force will be applicable. With only 10 points in space i must check (10-1)!/2=181.440 different paths.

0 Kudos
Message 14 of 17
(1,505 Views)

Hi FM,

 

with just 180k possible paths you can employ brute force…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 15 of 17
(1,499 Views)

It was only an example, if the user begin to add points where to move the camera (my software must be programmable) i fear i can get stuck in the optimization routine.


GerdW ha scritto:

Hi FM,

 

with just 180k possible paths you can employ brute force…


 

0 Kudos
Message 16 of 17
(1,497 Views)

Consider your requirements.  Do you need absolutely the shortest path, or an "efficient tour" (i.e. "one of the shorter paths")?  Do you have a fixed starting point, or is it arbitrary (in which case there may be different "shortest paths")?  Can you visit a point more than once on a tour?

 

I suspect that if conditions are relaxed a little, adding a new point becomes computationally much simpler.  For example, if the sequence p(i) (where i goes from 1 to N, number of points) is your current "good" path, take your new point, put it between successive p(i) and p(i+1), and see which of the N paths is shortest.  Note that this will (almost certainly) degrade if you do it multiple times, but to add, say, 3 points to a tour of 10, I'd guess it wouldn't be too bad.

 

Bob Schor

Message 17 of 17
(1,469 Views)