Sufficient conditions for convergence of the Sum-Product Algorithm