function P = dgraf( A )
%计算图的可达矩阵
%A表示图的邻接矩阵
%P表示图的可达矩阵
n=size(A,1);
P=A;
%计算矩阵Bn
for i=2:n
P=P+A^i;
% P
end
P(P~=0)=1;
P;
文章标签 java 可达性算法实现 表示图 邻接矩阵 文章分类 Java 后端开发
function P = dgraf( A )
%计算图的可达矩阵
%A表示图的邻接矩阵
%P表示图的可达矩阵
n=size(A,1);
P=A;
%计算矩阵Bn
for i=2:n
P=P+A^i;
% P
end
P(P~=0)=1;
P;
举报文章
请选择举报类型
补充说明
0/200
上传截图
格式支持JPEG/PNG/JPG,图片不超过1.9M