Message passing for undirected graph using sum product algorithm.