D'Hondt and Hare-Niemeyer algorithm.
Needs to be loaded with "load hondt".
function hondt (v,n) Distributions of seats with d'Hondt Compute the distribution of seats s[1],...s[k], which corresonds to v[1],...,v[k], such that sum s[i] = n, using d'Hondt. File: hondt
function hnbest (v,n) Best distribution of seats with Hare-Niemeyer Compute the distribution of seats s[1],...s[k], which corresonds to v[1],...,v[k], such that sum s[i] = n, using closest fit. The method minimizes the sum of absolute errors and is often called Hare-Niemeyer method. File: hondt See:
hondt (D'Hondt and Hare-Niemeyer)