shortest path in 2D matrix between two coordinate points
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Sohaib Bin Altaf
il 5 Lug 2018
Risposto: Sohaib Bin Altaf
il 10 Lug 2018
As in the attached image, i have a 2D matrix of 50 by 50. The matrix contains zeros (blue) and ones(yellow). Imagine it as a floor, The yellow or ones mean the walls. In this whole matrix a transmitter(T) and receiver (R) can be placed anywhere and i need to know how many walls the signal penetrates when it reaches from T to R. Lets suppose the T is at (x,y) and R is at (i,j). I take the shortest path between T and R. If i get the shortest path i can calculate the number of 1s in the path and that will be the number of walls which i need.
Can anyone help in this regard.. Thank you
0 Commenti
Risposta accettata
KSSV
il 5 Lug 2018
YOu have the following options to check:
1. Do interpolation of the points along the path, if any point has 1, it is crossing the wall. Note that, for this you need to generate lot many points along the path so that a point lies on the yellow path.
2. Generate the points along the path, get the nearest neigboours to those points and see, any point is from yellow path.
3. Find the intersection between shortest paths and yellow paths. This would be better a solution.
8 Commenti
Più risposte (2)
Vedere anche
Categorie
Scopri di più su Dijkstra algorithm in Help Center e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!