二年级的应用题componentsmatlab,MATLAB图论⼯具箱—components函数components Compute the connected components of a graph.
components()函数计算⼀个图(矩阵)的连通分量
[ci sizes] = components(A) 返回矩阵的顶点分别属于哪⼀个连通分量的索引(Ci),以及每⼀个连通分量的⼤⼩(size),
连通分量的个数即为max(components(A)),The algorithm ud computes the strongly connected components of A, which are the connectedschiphol
components of A if A is undirected (i.e. symmetric)。(这个算法⽤来计算A的强连通分量,如果A是⽆向图的话(即A是对称矩阵)(这个地⽅不知道是什么意思)笔记本电脑摄像头
职业目标评估这个⽅法⽤在有向图中满的英文
时间复杂度为O(V+E),⽅法仅仅是深度优先搜索。
note:
noneof1、这个⽅法忽略矩阵中的⾮零元素(即如果元素为零则视为没有边连接两个对应顶点)。
1980年属相
2、其中参数A必须为稀疏矩阵
征信中心
Example:
A0=[0 1 0 0;1 0 1 0;0 1 0 0;0 0 0 0]; >> A0 A0 = 0 1 0 0 1 0 1 0 0 1 0 0 0 0 0 0 >> [c d]=components(spar(A0)) c = 1 1 1 2 d = 3 1