pub fn optimal_leaf_ordering<F: Float + FromPrimitive + PartialOrd + Debug>(
z: &Array2<F>,
d: &Array1<F>,
) -> Result<Array1<usize>>Expand description
Calculates the optimal leaf ordering for a dendrogram
This reorders the leaves to minimize the sum of distances between adjacent leaves. Uses automatic algorithm selection: exact for small dendrograms, heuristic for large ones.
§Arguments
z- The linkage matrixd- The original distance matrix (condensed form)
§Returns
Result<Array1<usize>>- The optimal leaf ordering