> =A0 =A0I found a heuristic solution that has complexity O(n*log(n)) per
> step (for 1000 elements and 16 areas, I got a good solution in 500
> steps).

Erratum: complexity is O(n^2*log(n))
*but continue considering the lack of sleep...