fn take_relayer_diverse(
sorted: Vec<PathWithMetrics>,
n: usize,
) -> Vec<PathWithMetrics>Expand description
Takes n candidates from sorted, preferring not-yet-represented first relayers and bounding
how often any relayer recurs past the first position.
Plain truncation keeps the n lowest-latency paths, which in a well-connected network are often
the same few relayers reached by different routes; every downstream draw then inherits that
concentration. Relative order is preserved, so each pass stays latency-ordered. Four passes:
paths with a new first relayer whose later relayers are all under the MIDDLE_HOP_SHARE cap;
then any path under the cap; then, over the cap, paths with a new first relayer, so a pool whose
every path shares a later relayer still keeps as many first relayers as it offers; then the best
of the rest, so a thin pool still fills the floor.