开发者

Find connected components in a graph in MATLAB

I have many 3D data points, and I wish to find 'connected components' in this graph. This is where clusters are formed that exhibit the following properties:

  • Each cluster contains points all of which are at most distance from another point in the cluster.
  • All points in two distinct clusters are at least distance from each other.

This problem is described in the question and answer here.

Is there a MATLAB implementation of such an algorithm开发者_如何学JAVA built-in or available on the FEX? Simple searches have not thrown up anything useful.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜