Distributed algorithms for certain assignment problems