04-01-2015 10:18 AM
Like the topic's title. I need to find the shortest route connecting a certain number of points in a 3D space. Dijkstra's algorithm is not what i need because i do not have graph but simple points.
Thanks in advance for any advices which you can give me.
Francesco
04-01-2015 10:39 AM
I don't see why Dijkstra's algorthm isn't applicable here. You will just have to do the distance calculations. Or is there more to the story that you haven't told us. Maybe a good example of inputs with the expected output would help.
04-01-2015 10:47 AM
I would take a look at the A* algorithm. It is an extension of Dijkstra with much better performance. If you have a 3D grid of points, that can still be represented as a graph. You just have a path connecting each adjacent node in 3D space. The LabVIEW Robotics module includes a library for A* with 2D occupancy grids, but I'm not sure if it also supports 3D grids. You could generate a directed graph that takes the form of a 3D grid.
04-02-2015 01:26 AM
But the A* algorithm calculate the optimal path between two nodes, am i right? I need to find the shortest route which pass through certain points. For my application i must pass through this intermediate points.
04-02-2015 01:51 AM
Hi FM,
I need to find the shortest route which pass through certain points.
The "shortest route" between points is a direct line. So just draw some lines between your points and you are done! 🙂
You got several suggestions and each time you say "Nay, that doesn't fit to my application!". But when asked for a specific example you don't provide it (nor substantial information)!
04-02-2015 03:35 AM
04-02-2015 03:38 AM
Hi FM,
The algorithm you proposed search the shortest route between a start point and an end point but cannot guarantee me the all the points define by the user are reached, am I right?
Well, when you draw a line between EACH point in your route you are still finished with your task…
04-03-2015 05:31 AM
Hello again, i finally have some time to answer!
There is something that i can't understand or explain. Obviously the shortest route between two points is a straight line. So i can simply go for a local optimum and moving to the next closest point from where i am. The procedure is pretty simple but: who can guarantee me that a local optimum bring to a global optimum path, for visiting all the points in space, that i need?
I don't know if you ever see an In Circuit machine for testing electronic board. The software, after you programmed it, calculate the optimum route to minimize space travelled and time of test.
Thank you.
04-06-2015 10:55 AM
If I understand you correctly you have a set of points in space, and you need to travel through each point once with the shortest possible overall path. This is the traveling salesman problem, and there are many different algorithms to solve it, depending on how many points you have. I don't know of any LabVIEW implementations, but there is a wealth of information if you do a search for "traveling salesman".
04-06-2015 02:59 PM
I believe that the Travelling Saleman Problem is one of those that is "NP-difficult", with no known polynomial-time algorithm ...
Bob schor