Belief propagation for permutations, rankings, and partial orders