The generalized distributive law (GDL) is a generalization of the distributive property which gives rise to a general message passing algorithm. It is a synthesis of the work of many authors in the information theory, digital communications, signal processing, statistics, and artificial intelligence communities. The law and algorithm were introduced in a semi-tutorial by Srinivas M. Aji and Robert J. McEliece with the same title.
Introduction Application of the standard distributive law to an arithmetic expression reduces the number of operations in it. For example, in the expression a∗b+a∗c=a∗(b+c), there are three operations on the left-hand side but four on the right-hand side. Generalization of distributive law leads to a large family of fast algorithms. This includes the FFT and Viterbi algorithm. This is explained in a more formal way in the example below: α(a,b)=def∑c,d,e∈Af(a,c,b)g(a,d,e) where f(⋅) and g(⋅) are real-valued functions, a,b,c,d,e∈A and |A|=q (say) Here we are "marginalizing out" the independent variables (c, d, and e) to obtain the result. When we are calculating the computational complexity, we can see that for each q2 pairs of (a,b), there are q3 terms due to the triplet (c,d,e) which needs to take part in the evaluation of α(a,b) with each step having one addition and one multiplication. Therefore, the total number of computations needed is 2⋅q2⋅q3=2q5. Hence the asymptotic complexity of the above function is O(n5). If we apply the distributive law to the right-hand side of the equation, we get the following:
α(a,b)=def∑c∈Af(a,c,b)⋅∑d,e∈Ag(a,d,e) This implies that α(a,b) can be described as a product α1(a,b)⋅α2(a) where α1(a,b)=def∑c∈Af(a,c,b) and α2(a)=def∑d,e∈Ag(a,d,e) Now, when we are calculating the computational complexity, we can see that there are q3 additions in α1(a,b) and α2(a) each and there are q2 multiplications when we are using the product α1(a,b)⋅α2(a) to evaluate α(a,b). Therefore, the total number of computations needed is q3+q3+q2=2q3+q2. Hence the asymptotic complexity of calculating α(a,b) reduces to O(n3) from O(n5). This shows by an example that applying distributive law reduces the computational complexity which is one of the good features of a "fast algorithm".
History
Some of the problems that used distributive law to solve can be grouped as follows:
Decoding algorithms: A GDL like algorithm was used by Gallager's for decoding low density parity-check codes. Based on Gallager's work Tanner introduced the Tanner graph and expressed Gallagers work in message passing form. The tanners graph also helped explain the Viterbi algorithm. It is observed by Forney that Viterbi's maximum likelihood decoding of convolutional codes also used algorithms of GDL-like generality. Forward–backward algorithm: The forward backward algorithm helped as an algorithm for tracking the states in the Markov chain. And this also was used the algorithm of GDL like generality Artificial intelligence: The notion of junction trees has been used to solve many problems in AI. Also the concept of bucket elimination used many of the concepts.
The MPF problem MPF or marginalize a product function is a general computational problem which as special case includes many classical problems such as computation of discrete Hadamard transform, maximum likelihood decoding of a linear code over a memory-less channel, and matrix chain multiplication. The power of the GDL lies in the fact that it applies to situations in which additions and multiplications are generalized. A commutative semiring is a good framework for explaining this behavior. It is defined over a set K with operators "+" and "." where (K,+) and (K,.) are a commutative monoids and the distributive law holds. Let p1,…,pn be variables such that p1∈A1,…,pn∈An where A is a finite set and |Ai|=qi. Here i=1,…,n. If S={i1,…,ir} and S⊂{1,…,n}, let AS=Ai1×⋯×Air, pS=(pi1,…,pir), qS=|AS|, 𝐀=A1×⋯×An, and 𝐩={p1,…,pn} Let S={Sj}j=1M where Sj⊂{1,...,n}. Suppose a function is defined as αi:ASi→R, where R is a commutative semiring. Also, pSi are named the local domains and αi as the local kernels. Now the global kernel β:𝐀→R is defined as: β(p1,...,pn)=∏i=1Mα(pSi) Definition of MPF problem: For one or more indices i=1,...,M, compute a table of the values of Si-marginalization of the global kernel β, which is the function βi:ASi→R defined as βi(pSi)=∑pSic∈ASicβ(p) Here Sic is the complement of Si with respect to {1,...,n} and the βi(pSi) is called the ith objective function, or the objective function at Si. It can observed that the computation of the ith objective function in the obvious way needs Mq1q2q3⋯qn operations. This is because there are q1q2⋯qn additions and (M−1)q1q2...qn multiplications needed in the computation of the ith objective function. The GDL algorithm which is explained in the next section can reduce this computational complexity. The following is an example of the MPF problem. Let p1,p2,p3,p4, and p5 be variables such that p1∈A1,p2∈A2,p3∈A3,p4∈A4, and p5∈A5. Here M=4 and S={{1,2,5},{2,4},{1,4},{2}}. The given functions using these variables are f(p1,p2,p5) and g(p2,p4) and we need to calculate α(p1,p4) and β(p2) defined as:
α(p1,p4)=∑p2∈A2,p3∈A3,p5∈A5f(p1,p2,p5)⋅g(p2,p4) β(p2)=∑p1∈A1,p3∈A3,p4∈A4,p5∈A5f(p1,p2,p5)⋅g(p2,p4) Here local domains and local kernels are defined as follows:
where α(p1,p4) is the 3rd objective function and β(p2) is the 4th objective function. Consider another example where p1,p2,p3,p4,r1,r2,r3,r4∈{0,1} and f(r1,r2,r3,r4) is a real valued function. Now, we shall consider the MPF problem where the commutative semiring is defined as the set of real numbers with ordinary addition and multiplication and the local domains and local kernels are defined as follows:
Now since the global kernel is defined as the product of the local kernels, it is
F(p1,p2,p3,p4,r1,r2,r3,r4)=f(p1,p2,p3,p4)⋅(−1)p1r1+p2r2+p3r3+p4r4 and the objective function at the local domain p1,p2,p3,p4 is
F(p1,p2,p3,p4)=∑r1,r2,r3,r4f(r1,r2,r3,r4)⋅(−1)p1r1+p2r2+p3r3+p4r4. This is the Hadamard transform of the function f(⋅). Hence we can see that the computation of Hadamard transform is a special case of the MPF problem. More examples can be demonstrated to prove that the MPF problem forms special cases of many classical problem as explained above whose details can be found at
… excerpt ends here. Continue reading the full article.

