Algorithms for massive data assignment