Title: An algorithm for optimization of certain allocation models