Recursive Algorithms for Approximating Probabilities in Graphical Models