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.
52 CHAPTER 7. SUB-CUBIC TIME ALGORITHMtegrations. The result of multiplying square matrices of increasing sizes is illustrated in<strong>the</strong> plot of Fig. 7.9. As expected, <strong>the</strong> BLAS calls are significantly faster than <strong>the</strong> basic im-Performance of <strong>the</strong> different matrix multiplication methods used.10010python-scipypython-blascpp-boostcpp-blasn 3time in seconds - t(n)10.10.0150 100 200 500 800size of matrix - nFigure 7.9: Comparison of <strong>the</strong> matrix multiplication methods used.plementations. Nearly as much as a factor of one thousand. The plot is based on tenrepetitions of each matrix multiplication, but never<strong>the</strong>less, <strong>the</strong> points are a bit scatteredand not forming straight lines. I blame this on <strong>the</strong> methods used which may suffer fromstructural influences and this could also be indicated in <strong>the</strong> similar behaviour of <strong>the</strong> twoBLAS routines. Especially for <strong>the</strong> larger matrices <strong>the</strong> optimized calls are superior. It is,however, surprising to see that both Python calls are performing better than <strong>the</strong>ir respectiveC++ combatant.The only method that seems to be strict O(n 3 ) is <strong>the</strong> C++ Boost.uBlas call. In retrospectone might see this as <strong>the</strong> reason why <strong>the</strong> star tree was such a challenge to <strong>the</strong> C++prototype implementation.7.2.3 The final versionNow, had I been successful in finding an implementation of a <strong>the</strong>oretically good algorithm,<strong>the</strong> next step would be to estimate <strong>the</strong> exponent ω, and thus being able to choose<strong>the</strong> smallest of max(d v ,d v ′) ω , dv 2d v ′ and d v d 2 . However, as discussed in Sec. 7.1.1, <strong>the</strong>v ′matrix multiplication routines hide away different coefficients and in addition, time isspent padding <strong>the</strong> matrices in some cases, all of which has to be taken into account as