pub fn minimal_cluster_shape<'a, N, I>(
        &self,
        indexed_shape_clusters: I,
        heights: &[(RiscvAirId, usize)],
    ) -> Option<(N, Shape<RiscvAirId>, usize)>
    where
        I: IntoIterator<Item = (N, &'a ShapeCluster<RiscvAirId>)>,
    {
        // Try to find a shape fitting within at least one of the candidate shapes.
        indexed_shape_clusters
            .into_iter()
            .filter_map(|(i, cluster)| {
                let shape = cluster.find_shape(heights)?;
                let area = self.estimate_lde_size(&shape);
                Some((i, shape, area))
            })
            .min_by_key(|x| x.2) // Find minimum by area.
    }
Returns the area, cluster index, and shape of the minimal shape from candidates that fit a
given collection of heights.
crates/core/machine/src/shape/mod.rs