3-Dimensional Shortest Path
古いコメントを表示
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!
採用された回答
その他の回答 (1 件)
Walter Roberson
2016 年 3 月 3 日
0 投票
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 件のコメント
Ahmet Cecen
2016 年 3 月 3 日
編集済み: Ahmet Cecen
2016 年 3 月 3 日
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
2016 年 3 月 3 日
Steven Lord
2016 年 3 月 3 日
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.
カテゴリ
ヘルプ センター および File Exchange で Graph and Network Algorithms についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!