Find connected components in a graph in MATLAB

大城市里の小女人 提交于 2019-12-06 07:18:22
Amro

Perhaps a density-based clustering algorithm can be applied in this case. See this related question for a description of the DBscan algorithm.

I do not think that it is possible to satisfy both conditions in all cases.

If you decide to concentrate on the first condition, you can use Complete-Linkage hierarichical clustering, in which points or groups of points are merged based on the maximum distance between any two points. In Matlab, this is implemented in CLUSTERDATA (see help for the individual function steps).

To calculateyour cluster indices, you'd run

clusterIndex = clusterdata(coordiantes,maxDistance,'criterion','distance','linkage','complete','distance','euclidean')

In case you then want to simply eliminate points of different clusters that are less than minDistance apart, you can run pdist between clusters to clean up your connected components.

k-means or k-medoid algorithm may be useful in this case.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!