how to realize a* or best first search in 2d matrix?

3 ビュー (過去 30 日間)
Vlad bibikov
Vlad bibikov 2021 年 1 月 25 日
回答済み: Shubham Rawat 2021 年 1 月 28 日
Hello, i have a random n*n matrix and i need to find path from one point to another using a* or BFS. You can move only up/down and left/right
For example [ 6 9 6 8;
8 6 3 9;
9 2 6 1 ]
We start from (1;1) to (3;4) and the way is gonna be like 6 - 8 - 6 - 2 - 6 - 1 and the distance will be 6+8+6+2+6+1=29

採用された回答

Shubham Rawat
Shubham Rawat 2021 年 1 月 28 日
Hi Vlad,
You may use this link for the BFS using Adjacency matrix:
Hope this Helps!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeConstruction についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by