EUCLIDEANMST Build euclidean minimal spanning tree of a set of points. EDGES = euclideanMST(POINTS) POINTS is a [NxP] array, N being the number of points and P being the dimension. Result EDGES is a [Mx2] array, containing indices of each vertex for each edges. [EDGES DISTS] = euclideanMST(POINTS) Also returns the lengths of edges computed by MST algorithm. Algorithm first computes Delaunay triangulation of the set of points, then computes euclidean length of each edge of triangulation, and finally uses prim algorithm to simplify the graph. Example % choose random points in the plane and display their Euclidean MST pts = rand(50, 2)*100; edges = euclideanMST(pts); drawGraph(pts, edges) See also prim_mst, distancePoints, delaunayn
Package: matgeom