alloc function

Allocate values to "buckets" subject to weights and constraints