This algorithm determines the weight distribution.
This algorithm was written by Duygu Balcan and integrated by Russell Duhon.