Distributed Optimal Assignment Algorithm for Collective Foraging *