3-Dimensional Shortest Path
Show older comments
Hello, I have a question about the shortest path algorithm.
I want to find shortest path in 3 dimensional space(for example, latitude, longitude, and altitude) I think it's possible that using "graphshortestpath" function in matlab is fine.
But in this case it's hard to make a graph matrix and a edge matrix...
So if someone knows that an efficient way to make for shortest path algorithm for 3 dimensional space, please help me.
Thanks in advance!
Accepted Answer
More Answers (1)
Walter Roberson
on 3 Mar 2016
0 votes
The A* and Dijkstra algorithms do not care at all about how many dimensions the graph is embedded in: they only care about the connection information and the distances (or the two combined in one.)
3 Comments
Ahmet Cecen
on 3 Mar 2016
Edited: Ahmet Cecen
on 3 Mar 2016
This is true, but graphshortestpath and similar functions will almost always require data in the form of an adjacency matrix, which is 2D. The problem here if I relate correctly is not that the graph is embedded in 3D, it is that there is no graph, simply volumetric data like a 3D maze for example: the corridors are 1s and walls are 0s. How do I transform that 3D maze into a 2D adjacency matrix in the most time and memory efficient way possible with MATLAB? That is the problem the submission I refer to solves. The rest is easy-peasy as you mentioned.
Helio
on 3 Mar 2016
Steven Lord
on 3 Mar 2016
The shortestpath method for graph and digraph objects that was introduced in release R2015b can work on a weighted graph object. There's an example on that function's documentation page.
Categories
Find more on Graph and Network Algorithms in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!