Factor graphs are a way to represent graphically the factorization of a function. The sum product algorithm is an algorithm that computes marginals of that function by passing messages on its factor ...