computing the quartet distance between general trees
computing the quartet distance between general trees
computing the quartet distance between general trees
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
7.1. THE ALGORITHM 41reflecting Eq. (7.3), however, makes it clear that <strong>the</strong> symmetry only occurs <strong>between</strong> twoentries in <strong>the</strong> matrix. Therefore <strong>the</strong> butterflies are only counted twice. This is becauseEq. (7.3) is incomplete and only captures half of <strong>the</strong> constellations of <strong>the</strong> indices. To produce<strong>the</strong> total number of shared directed butterflies due to symmetry, <strong>the</strong> two equations(7.2) and (7.3) should have read:( )1 |F i ∩G j | ∑ ∑ ∑ ∑(|F k ∩G l ||F m ∩G n |) + (|F k ∩G n ||F m ∩G l |) (7.4)4 2k≠i l≠j m≠i ,k n≠j,land( )1 I [i , j ] ∑ ∑4 2k≠i l≠j∑ ∑(I [k,l]I [m,n]) + (I [k,n]I [m,l]). (7.5)m≠i ,k n≠j,lFigure 7.4 b) illustrates a choice of indices in Eq. (7.5). It is clear that for some fixed choiceof <strong>the</strong> (i , j ) entry, <strong>the</strong>re are four ways to choose <strong>the</strong> o<strong>the</strong>r entries; as soon as one entry isselected, say (k,l), <strong>the</strong>re is only one way to select <strong>the</strong> remaining three entries (m,n), (k,n)and (m,l) if precisely those four entries are to be selected.As <strong>the</strong> result in <strong>the</strong> article is simply wrong by a factor of 2, <strong>the</strong> succeeding parts of<strong>the</strong> article are still valid, if we divide by 2 instead of 4. One can show that <strong>the</strong> two subexpressionsof Eq. (7.5) are actually expressing <strong>the</strong> same quantity and thus, this shouldbe a correct workaround. This is most fortunate, since what remains from that point in<strong>the</strong> article is to transform Eq. (7.3) into an expression that is constant time computable.This work will still be valid.jnljnliimmkk(a)(b)Figure 7.4: Illustrates (a) <strong>the</strong> choice of entries in Eq. (7.3) and (b) <strong>the</strong> choice of entries in Eq. (7.5)A recipe for counting shared butterflies associated with a pair of edges has now beendescribed. This is done for all pairs of directed edges. As mentioned in <strong>the</strong> descriptionof directed butterflies, one butterfly is identified by two different edges in one tree. Theconsequence is that each shared butterfly is associated with two different pairs of claims.