3-Dimensional Shortest Path
Ältere Kommentare anzeigen
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!
Akzeptierte Antwort
Weitere Antworten (1)
Walter Roberson
am 3 Mär. 2016
0 Stimmen
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 Kommentare
Ahmet Cecen
am 3 Mär. 2016
Bearbeitet: Ahmet Cecen
am 3 Mär. 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
am 3 Mär. 2016
Steven Lord
am 3 Mär. 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.
Kategorien
Mehr zu Graph and Network Algorithms finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!