Find distance between nodes

조회 수: 6 (최근 30일)
Tha saliem
Tha saliem 2017년 6월 3일
댓글: Waseem AL Aqqad 2021년 1월 24일
Hi i have a dataset of 1853 rows and 2 columns, sample of dataset is as follows:
1 105
1 104
2 1100
10 1165
813 1320
15 105
19 90
105 813
i want to create a graph to find distance between each node from other. For example if i enter input node 1, it will show that distance between 1 and 105 is 1, and between 1 and 813 is 2 (because it will come next to 105). and between 1 and 1320 is 3. (as shown in image below). and similarly for other nodes.
Any help will be greatly appreciated.

채택된 답변

Walter Roberson
Walter Roberson 2017년 6월 3일
To get the tree of distances from a node like you show, see https://www.mathworks.com/help/matlab/ref/graph.shortestpathtree.html
  댓글 수: 4
Tha saliem
Tha saliem 2017년 6월 4일
Thanks alot.
Waseem AL Aqqad
Waseem AL Aqqad 2021년 1월 24일
Thank you, Walter.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Directed Graphs에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by