pub fn reorder_palette(palette: &Palette) -> (Palette, Vec<u8>)
Reorders the palette using a greedy TSP approximation. Returns (new_palette, index_mapping) where index_mapping[old_idx] = new_idx.