Low-Complexity Message-Passing Algorithms For Distributed Computation