필터 지우기
필터 지우기

how to find short paths and diameter for sparse matrix

조회 수: 1 (최근 30일)
nadia nadi
nadia nadi 2015년 8월 31일
편집: nadia nadi 2015년 8월 31일
Dear,
i need to find the diameter for a sparse matrix in matlab and the files i found is
all_shortest_paths(A,varargin) and depth_first_search(A,u,dfs_visitor,varargin)
from file exchange, both of them need to use this file check_matlab_bgl(A,options) which is checks the input A for various properties one of them if it is sparse then it will give error. My question is their anyone know how to compute the diameter for sparse matrix , even if it is still sparse I need to compute the diameter. I found this command in matlab
[dist] = graphallshortestpaths(G)
i think its useful but its confusing how to use it, can anyone use it to this matrix
A=[10000000000000000000
01000000000000000000
00001100001000000100
00010000000000000000
00100000001000001000
00100100001000000000
00000000000010000000
00000001000000000001
00000000100100000000
00000000010000000000
00101100001000000000
00000000100000000001
00010000000000010000
00000000000001000000
00000100000000000000
00000000000000010000
00000010000000000001
10000010000000010000
00000000100000000010
00000001000000100000
];
Regards,
Nadia

답변 (0개)

카테고리

Help CenterFile Exchange에서 Sparse Matrices에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by