compactify_edges constructs M1, M2, and ix index matrices.
compactify_edges
compactify_edges(w, n)
w
weights vector
n
number of points to cluster