Algorithm for making multiple lists become as similar to each other as possible in terms of: number of elements sum of elements