Belief propagation using some priorities.