added support for the sum-product variant of the belief propagation algorithm.
Merge pull request #124 from scott-vsi/master

fixed the sum-product variant of the belief propagation