Implement Bayesian Belief Propagation