O(n + max_key) stable sort on the items generated by vals. Items v in vals are sorted according to val_to_key[v].
(
vals: impl Iterator<Item = usize> + Clone,
val_to_key: &[usize],
max_key: usize,
)
source not stored for this graph (policy: none)