<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Billy Diggin on Medium]]></title>
        <description><![CDATA[Stories by Billy Diggin on Medium]]></description>
        <link>https://medium.com/@billy.diggin?source=rss-94b58d3e0323------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ayyWI4gWML7q79wEkgvg7Q.jpeg</url>
            <title>Stories by Billy Diggin on Medium</title>
            <link>https://medium.com/@billy.diggin?source=rss-94b58d3e0323------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 24 Nov 2026 18:39:29 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@billy.diggin/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[May the Complexity be with you — Episode III: Compound Revenge.]]></title>
            <link>https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-iii-compound-revenge-b242fa598055?source=rss-94b58d3e0323------2</link>
            <guid isPermaLink="false">https://medium.com/p/b242fa598055</guid>
            <category><![CDATA[computing]]></category>
            <category><![CDATA[complexity]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Billy Diggin]]></dc:creator>
            <pubDate>Mon, 22 Mar 2021 08:41:29 GMT</pubDate>
            <atom:updated>2021-05-06T11:00:50.107Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>May the Complexity be with you — Episode III: Compound Revenge.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfA5MHUfXXrTw34uybeW5A.jpeg" /></figure><p>“<em>You are impossibly outnumbered.</em>” — <strong>Count Dooku</strong>.</p><h4>Preamble</h4><p>In <a href="https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-i-enlightenment-b1dcd889a1bf"><strong>Episode I: Enlightenment</strong></a>, we got a sense of complexity in relation to efficiency of algorithms. In <a href="https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-ii-the-diversity-wars-15649793702c"><strong>Episode II: The Diversity Wars</strong></a>, we shifted our discussion from algorithmic complexity to computational complexity. We are concerned about future use cases for our algorithms. We seek to understand the limitations of the algorithms we choose or construct. Now, in <strong>Episode III</strong> we explore complexity in context and the resulting effects of compounding.</p><h3>Episode III: Compound Revenge</h3><p>“<em>My powers have doubled since we last met count.</em>” — <strong>Anakin Skywalker</strong>.</p><p>Most algorithms are part of a chain of execution to accomplish some goal. Any individual algorithm in that chain of execution may be the bottleneck and, as a result, it is the predominant cost factor (in time and/or space). While it may be true that an algorithm needs to be atomic in nature — ideally performing its discrete task efficiently — it obviously cannot execute in isolation. The outputs from one processing stage are the inputs to the next stage, and so on. What kinds of effects could this have on complexity? We will use familiar constructs to highlight some compounding effects when algorithms are not measured in isolation.</p><h4>This is Not the Matrix You are Looking For</h4><p>“<em>Begun, the Clone War has</em>” — <strong>Yoda</strong>.</p><p>From the previous episode, we learned about the (atomic) nature of matrix multiplication. We now understand the possible input variables to the algorithm and the variety of computational paths which we need to accommodate. We now feel confident on measuring its computational cost. However, having tamed discrete matrix multiplication, we cannot rest on our laurels. We can run into compounding computational problems when there are sequences of matrices to multiply. This is called the <a href="https://en.wikipedia.org/wiki/Matrix_chain_multiplication">matrix chain multiplication problem</a>. It turns out that the order of multiplication of a series of matrices can have a significant compounding impact on the resulting computational cost. As an example, let’s multiply 4 matrices with dimensions as shown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iDCXkLU4fcIM1jHDcDA8Fg.png" /></figure><p>We can multiply these in 5 possible ways, each way requiring 3 matrix multiplication steps. Recall that multiplying a matrix of size <em>m</em>x<em>n</em> with another of size <em>n</em>xp requires <em>mnp</em> operations and the resulting matrix is of size <em>m</em>x<em>p</em>.</p><ol><li>(<strong>AB</strong>)(<em>CD</em>) — <strong>30,000</strong>+<em>90,000</em>+90,000 = 210,000 operations</li><li>(<em>A</em>(<strong>BC</strong>))D — <strong>30,000</strong>+<em>18,000</em>+54,000 = 102,000 operations</li><li>A((<strong>BC</strong>)<em>D</em>) — <strong>30,000</strong>+<em>36,000</em>+36,000 = 102,000 operations</li><li>((<strong>AB</strong>)<em>C</em>)D — <strong>30,000</strong>+<em>45,000</em>+54,000 = 129,000 operations</li><li>A(<em>B</em>(<strong>CD</strong>)) — <strong>90,000</strong>+<em>60,000</em>+36,000 = 186,000 operations</li></ol><p>In this trivial example, we could inadvertently double the effort required to complete the task. The matrix chain multiplication problem is an example that the <strong>ordering</strong> of algorithms in the chain of execution may be important. By not considering or understanding this additional complexity, serious compounded computation effects are possible. Therefore, it might be incumbent on the algorithm designer to accommodate scale up. The algorithm should perhaps provide an optimal set of methods to multiply a series rather than a pair of matrices.</p><h4>Confounded Compounding Rotating Images</h4><p>Another case of compounding arises from repetition and is similar to compounding interest on a loan principal. When we stop repaying the loan, the interest accrues and compounds. In algorithm terms, the output data increases in excess of the input data. When that output is used subsequently as input to the algorithm, there is a resulting increased computational cost due to the increased processing of data. A visual example of this is when we rotate an image, as part of a sequence of processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*of24f1MA5yGGeeFVGcM-OQ.png" /></figure><p>When an image of size <em>w, h</em> is rotated, the new size is given by <em>w’, h’</em> and is a function of the rotation angle — as given by the equation above. Unless the angle is a multiple of <strong>π</strong>, the size of the image will grow. Where this is allowed to repeat, the compounding effect on the image size increases the computational load. Angles of π /₄ can double the area of the image on each rotation. Therefore on each subsequent rotation, it is possible to compound this growth. After 5 rotations, the area is 32x the original. While this might be a somewhat contrived example, the learnings are important. Repeatedly chaining execution of the same algorithm can increase the input data scale and therefore the computation. The context has an impact.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_bdH9DOglj49JQvi4qvrsg.png" /><figcaption>“Size matters not. Look at me. Judge me by my size, do you? Hmmm?” — <strong>Yoda.</strong></figcaption></figure><p>To circumvent this, should we provide the algorithm with some context so that it can be more aware and efficient? For image rotation, we could provide some metadata about the original image size as an input to each subsequent rotation. Perhaps we can specify a non-orthogonal ROI. In that approach, we can be sure of only rotating the relevant pixels and not increasing the size of the image beyond what is necessary. Ideally we’d also need this metadata for other processing stages on images, e.g. filtering or smoothing operations. Those other, non-rotation, algorithms need to be similarly accommodating.</p><h4>Compounding by Composition</h4><p>We’ve seen a serial compounding example — where the algorithms compound the execution time either from chaining or by repetition. The effects of these can be quite minor in comparison to the added execution time that can arise from composition. Typically with arrays of data, we can use search, filter, map or find operations, etc. These operations on arrays are generally trivial — accepting innocuous functions to provide comparators or translators. The array is iterated until all data is processed or a stopping condition is reached.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/81/1*tsGB3a_HbrsHLKaPyzSIXw.png" /></figure><p>As a (contrived) example, let’s use a simple numeric sequence, S, contained in an array. We iterate over each element in the array and we map to another number based on a computation — let’s call that operator a conflation as shown by the equation on the left. As the <em>map</em> method iterates over the array, the square of each element is used to compute a cumulative sum to that value.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GJ0VQa3yu_67gdI0olNdKQ.png" /><figcaption>“I’m just a simple man, trying to make my way in the universe.” — <strong>Jango Fett</strong></figcaption></figure><p>Not only is there a dependency on the number of elements, there is a dependency on the values of those elements. While we could keep the number of elements in check — their values can have a hugely compounding effect on the execution time. It is not enough to understand that the complexity of the map method is 𝒪(<em>n</em>) — it is important to be aware of the complexity of the map function: <em>conflate</em>. The total in this case is 𝒪(<em>n</em>³<em>)</em>. It is also important to understand to what <em>n</em> refers — it is not necessarily the size of the array, but rather the values in the array — which could indeed be large and we may have less control over their scale.</p><h4>Compounding by Currying</h4><p>Composition or nesting of processing loops is easy to do — none more so in functional programming. In the next example, a higher-order function is used to <em>map</em> the sequence. This function, <em>conspire</em>, wraps the original <em>conflate</em> function inside additional cumulative operations. The combined complexity is now 𝒪(<em>n⁵</em>). The compounding context matters. We need to exercise care in our programming constructs as we can easily compose a compounding complex computation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fSxI_0otVl7hDHsB46-0ZQ.png" /><figcaption>“Why do I get the feeling your going to be the death of me?” — <strong>Obi-Wan Kenobi </strong>[to Anakin]</figcaption></figure><h4>Parallel Deception</h4><p>Multiplication of large matrices can be expensive. By way of example, multiplication of a pair of double-precision 1000x1000 element matrices takes ~750ms on my old Intel Core i5. We know that multiplying 4 matrices, e.g. ABCD takes 3 sets of multiplications. Ignoring the order, if ABCD are all double-precision and have 1000x1000 elements, it takes ~2200ms to complete all the operations (see lines 15, 16, 17 below) — just over 3x the time required to multiply one pair. This is as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/966/1*CcG5tdTnKEXluJ0OVZPdtg.png" /><figcaption>“Master Kenobi, you disappoint me! Yoda holds you in such high esteem…surely you could do better!” — <strong>Count Dooku</strong></figcaption></figure><p>With multi-core processors and appropriate separation of functions and data, we can take advantage of parallelism. In our case, we can perform the ABCD multiplication chain in parallel (see lines 20 to 27 above). If we break it down as Z=XY=(AB)(CD), where X=AB and Y=CD are multiplied in parallel first and Z=XY is subsequently multiplied. Of course Z has to wait for X and Y — so we can only parallelize X=AB and Y=CD. However, we still get a good result, that operation takes a total time of ~1550ms. This is also as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*AKDkDe6SbYoup1gl8x-N3w.png" /><figcaption>Daniels220 at English Wikipedia, <a href="https://creativecommons.org/licenses/by-sa/3.0">CC BY-SA 3.0</a> via Wikimedia Commons</figcaption></figure><p><a href="https://en.wikipedia.org/wiki/Amdahl%27s_law">Amdahl’s Law</a> describes the limits we may reach in parallelization — the serial parts (in our case computing X and Y in parallel and then computing Z=XY) will be the limiting factor. A 4-matrix chain parallel multiplication can only be completed in 2 stages as a best case. As a scaling up example, using this chaining multiplication parallelization approach and given an infinite number of processors, we could still only compute a chain of 16 matrices in the same time as a chain of 9 matrices, assuming similar conditions.</p><ul><li>16 Chain = {[(AB)(CD)] [(EF)(GH)]} {[(IJ)(KL)] [(MN)(OP)]}</li><li>9 Chain = {[(AB)(CD)] [(EF)(GH)]} {I}</li></ul><h4>Parallel Inception</h4><p>If we use a good linear algebra library, e.g. as a DLL — it will likely already have good coverage for parallelization (e.g. see line 5 below) for matrix multiplication. In this case, any available threads can be used to divide-and-conquer the computations.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*I7llUwu4jEwo3AMxCG7tog.png" /><figcaption>“So we moved into ‘aggressive negotiations’.” — <strong>Anakin Skywalker</strong></figcaption></figure><p>In our case, using this DLL’s matrix multiplication function applied to the double-precision 1000x1000 element matrices, the computation takes ~300ms to multiply one pair using 2 cores on the CPU. This is in comparison to ~750ms without parallelization.</p><p>For a fully serial ABCD chain multiplication, the DLL takes ~900ms. This is ~3x the multiplication time of a single pair— as expected. Now, let’s parallelize the (AB)(CD) chain as above and use the optimal DLL method. We expect to get even more improvement — right? Maybe we would expect to complete the execution in ~600ms. If we try to parallelize the chain using the already optimized multiplication function, it takes ~1250ms. This is ~650ms more that we guesstimated. This can’t be! We have compounding the complexity by oversubscribing the thread pool relative to the number of cores or processors. There are more threads than processors, therefore some of the threads are starving and we are victims of excessive context switching. Clearly, we have much to contend with for parallel processing and potential compounding.</p><h4>Postscript</h4><p>“<em>Chewie, we’re home.</em>” — <strong>Han Solo</strong></p><p>To conclude this episode, our prior consideration of algorithmic and computational complexity is set aside to consider the context and the complexity of compounding. Whether we process serially, by composition or in parallel, we need to exercise caution. Next, the fourth and final episode in the Trilogy — we explore diseconomies of scale— tune in to <strong>Episode IV: The Next Order</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b242fa598055" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[May the Complexity be with you — Episode II: The Diversity Wars.]]></title>
            <link>https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-ii-the-diversity-wars-15649793702c?source=rss-94b58d3e0323------2</link>
            <guid isPermaLink="false">https://medium.com/p/15649793702c</guid>
            <category><![CDATA[computing]]></category>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[complexity]]></category>
            <dc:creator><![CDATA[Billy Diggin]]></dc:creator>
            <pubDate>Mon, 01 Mar 2021 06:19:09 GMT</pubDate>
            <atom:updated>2021-03-01T06:19:09.104Z</atom:updated>
            <content:encoded><![CDATA[<h3>May the Complexity be with you — Episode II: The Diversity Wars.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfA5MHUfXXrTw34uybeW5A.jpeg" /></figure><p>“<em>The Force will be with you. Always.</em>” — <strong>Obi-Wan Kenobi</strong>.</p><h4>Preamble</h4><p>In <a href="https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-i-enlightenment-b1dcd889a1bf"><strong>Episode I: Enlightenment</strong></a>, we got a sense of complexity in relation to efficiency of algorithms. The good, the bad and the ugly (at the risk of movie confusion) so to speak. You may recall we are concerned about future use cases for the algorithms. In pursuit of this we must understand the limitations of the algorithms we choose or construct. Now, in <strong>Episode II</strong>, we shift our discussion from algorithmic complexity to computational complexity. To accomplish that, let’s explore variability in the problem space which gives rise to the need for diversity in the solution space.</p><h3>Episode II: The Diversity Wars</h3><p>“<em>I have a very bad feeling about this.</em>” — <strong>Luke Skywalker</strong>.</p><p>Remember our Big-O Notation — 𝒪(<em>f(n)</em>). The size or scale of the input, <em>n, </em>is very important as is the function, <em>f(). </em>However we also must consider the variety of ways the problem presents itself. We must look behind the veil of Big-O Notation and the complexity order to see the variability in the problem space so that we can appreciate the diversity of algorithms or approaches that we need. Only then can we begin to understand the limiting factors. As a proxy to guide us in this understanding let’s use matrix multiplication for ease of explanation.</p><h4>Not All Matrices Are Created Equal</h4><p>The matrix size (e.g. square <em>n</em>x<em>n</em>) is related to the compute cost of the product of two matrices — specifically with <em>n</em>³ multiplications and <em>n</em>³ — <em>n</em>² additions. If we think about the various permutations that matrices present, then we should consider non-square matrices — as they are not so uncommon. Without laboring too much and for brevity, the product of a matrix A, of size <em>m</em>x<em>n</em>, with a matrix B, of size <em>n</em>x<em>p</em>, results in a matrix C, of size <em>m</em>x<em>p</em>. An example and the relevant formula are shown here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*iqav3wpfDzJ-yLWkpHbFaA.png" /><figcaption>“Hmmm… yousa point is well seen” —<strong> Jar-Jar Binks</strong></figcaption></figure><p>The complexity order is still cubic and is more accurately described as 𝒪(<em>mnp</em>). So, our straight-forward matrix multiplication algorithm might perform well enough if one of the dimensions, <em>m</em>, <em>n</em> or <em>p</em> is low. The corollary is that a larger <em>m</em>, <em>n</em> or <em>p</em> will counteract efficiency. The range of the computation has now expanded and our upper bound on complexity has more variables.</p><h4>Simple Multiplication</h4><p>The equation seems straightforward — let’s code it up by looping over the common dimension, <em>k=1…n</em> and then compute the column and row product-sum for each column and each row entry (k-col-row loop-order). The starting code might look like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/781/1*2Eqc27JOwMHyBhcUKe_Ufg.png" /><figcaption>“<em>What a piece of junk!</em><strong>” — Luke Skywalker (on laying eyes on the Millennium Falcon for the first time)</strong></figcaption></figure><p>The computational cost for this naïve implementation is <em>n</em>³ multiplications and <em>n</em>³ additions. For square matrices, where <em>m</em>=<em>n</em>=<em>p</em>=1000, this takes ~18seconds on my old Core i5. It turns out that the order of the for loops does not matter to the computational correctness and so we can try 6 loop-order combinations and chart their execution times:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLdjFq6XxZgVEHwXc2fGsA.png" /></figure><p>Well, well. It looks like the order of the loops does matter to the execution time — quite a lot. The best ordering (row-k-col) seems to be to iterate over the rows, <em>m</em>, then the common dimension, <em>n</em>, and finally the columns, <em>p</em>. That gives a time somewhere between 350–730ms, depending on the data type — a 55x speed-up! The reason for such a varied discrepancy in execution time of the loop ordering has to do with processor data caching, or rather cache hits/misses. Best not to be naïve on implementation!</p><h4>Code Better</h4><p>“<em>Execute Order 66.</em>” — <strong>Darth Sidious</strong></p><p>Next consider other practical implementations. It is well understood that forward iterating and executing instructions accordingly through a linear vector can be encoded efficiently in comparison to non-sequential iteration. It takes advantage of processor data caching — generating significant efficiencies. Our loop-order example is testament to this.</p><p>Regarding processors, let’s assume we are privileged to be able to use the latest CPUs or somehow leverage the best Nvidia GPU for our algorithms. We can construct compute sequences that take advantage of the pipelining or parallelization mechanisms of these processors. We can, for example, use Advanced Vector Extensions, part of the Single Instruction-Multiple Data (SIMD) paradigm on Intel and AMD CPUs for compute optimization. Depending on how we construct our algorithm to calculate C=AxB, we may do things a little differently from the naïve implementation. Many FPGAs or GPUs are further optimized for vector computations, some are even specialized for matrix operations.</p><h4>Too Many Combinations</h4><p>To take advantage of various hardware, we may re-organize the computational stages of processing. Firstly, we may pre-transpose matrix B so that we can iterate columns linearly rather than jumping rows non-sequentially. In that case, for compute purposes, we are multiplying the rows of A with the rows of transposed B — to take advantage of linear iteration and SIMD processing. Secondly, we may separate the multiplication and the addition steps into distinct stages. This may mean increasing the total number of operations in exchange for pipelined or parallel optimizations. Furthermore, we may consider splitting the multiplication into separate waves or have multiplication and addition steps interleaved — all to take advantage of the intricacies of the underlying computing hardware. Finally, we may chunk the matrices into suitable processing sizes, e.g. 64Kb chunks, dependent on processor caches, etc. Of course, many of these processing steps can change the space complexity measure — we may need more interim storage for these compute stages.</p><p>Back in normal CPU world, we could opt to utilize OpenMP to help us scaffold the parallelization of the computations. We could distribute the computations across several nodes/cores. One other complication: if we optimize our algorithm, say for a Knights Landing Intel processor, we will need re-coding (or at least compilation optimization changes) to take advantage of another, say a Haswell processor, as they have AVX-512 versus AVX-2 instruction sets, respectively. Similarly, the coding for Nvidia CUDA would be quite different. What about mobile, or ARM based processors? Hmmmm!</p><p>Anyways, here is the reasonably optimal implementation for a generic processor — it includes multi-core/multi-processor support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/909/1*I7llUwu4jEwo3AMxCG7tog.png" /><figcaption>”<em>It’s the ship that made the Kessel Run in less than twelve parsecs.</em><strong>” </strong>— <strong>Han Solo</strong></figcaption></figure><h4>Types</h4><p>Do we proceed differently if the matrix elements are integer, floating point or complex quantities? How about a binary matrix? For processor optimization — yes, we would! There are separate pipelined instructions for integer versus floating addition and multiplication — with different compute costs. For a binary matrix, we could employ bitwise or logical instruction sets. Indeed, using 16-bit vs 32-bit integers there is a ~2.5x speedup. Using float instead of double gives ~3.5x. There is a ~3x difference between 32-bit integer and 64-bit double types.</p><h4>Sparsity</h4><p>How should we handle sparse matrix multiplication? Sparse matrices are typically not stored in an array format — rather usually as a list/index structure. Given that many matrix elements are zero, there is a reduction in the number of actual multiplications (and additions). We should certainly use an alternate and more efficient algorithm, at least a different array indexing method. Sparse matrix multiplications are 𝒪(<em>nuv</em>), where u and v are the number of non-zeros per row and column of the matrix pair to be multiplied; <em>u</em> ≤ <em>n</em> and <em>v</em> ≤ <em>n</em>. While we remain in the cubic complexity domain, as it is the worst-case scenario, the degree of sparsity dictates the actual computational efficiency or cost.</p><h4>Counting the Cost</h4><p>So, when considering the variety in the matrix elements, quite often we expose the need for a larger code branching solution set. To avoid having the worst-case computation scenario prevail on each occasion, we likely need to implement several variations of the algorithm, or employ several differing algorithms, each tailored to a differing solution sub-domain. By user selection or by inspection of the input parameters, the optimal algorithm and code branch is employed, dependent on the given circumstances. In return, we hope to compute the result faster and/or use less space in the process — efficient computing in the face of <strong>bad</strong> complexity.</p><h4><strong>Build a Better Algorithm</strong></h4><p>“<em>These aren’t the droids you’re looking for.</em>” — <strong>Obi-Wan Kenobi</strong></p><p>It is possible to multiply standard <em>n</em>x<em>n</em> matrices which yield a lower computational cost than the naïve implementation. This is thanks to <a href="https://en.wikipedia.org/wiki/Strassen_algorithm">Strassen’s Algorithm</a> and derivations of that approach. Strassen’s algorithm follows a recursive divide and conquer method — splitting the matrix into smaller computations and ultimately reducing the number of multiplications by ⅛. The reduction in computational cost comes with an increase in other costs. Firstly, the algorithm increases space complexity. There is a need to pad the input matrices and additional intermediate matrices are required during the calculations. Secondly, the implementation is more complicated relative to the naïve implementation, so we need to consider the cost of our time and effort to develop and maintain code for such an approach (of course, we would naturally defer to a public domain software library).</p><h4><strong>Deal with Diversity</strong></h4><p>“<em>Never tell me the odds!</em>” — <strong>Han Solo</strong></p><p>While Big-O Notation provides a measure of the worst-case complexity, as we have seen, in practice we also have complexity in diversity. We necessarily may need much more code in order to be efficient for many scenarios. We have to code or employ several algorithms and depending on the nature of the input, the scope of the problem and the context, there is a complementary selection of computational branches.</p><p>In summary, complexity in diversity arises from:</p><ul><li>Algorithmic choices</li><li>Space complexity choices</li><li>Variation in input scale — i.e. size of <em>n</em></li><li>Input shape — i.e. multi-variate <em>n</em></li><li>Input type — e.g. integer, float, complex, function</li><li>Coherence — e.g. sparsity of data, compound data types</li><li>Instruction set — e.g. optimizing for SIMD</li><li>Processor cache — i.e. optimizing for cache hits</li><li>Parallelization — e.g. number of cores</li><li>Dedicate compute — e.g. GPU, FPGA, etc.</li></ul><h4><strong>Postscript</strong></h4><p>“<em>Chewie, we’re home.</em>” — <strong>Han Solo</strong></p><p>To conclude this episode, our consideration of algorithmic complexity gave way to computational complexity. It is evident that variability in the problem space necessitates diversity in the solution space. Which gives rise to an alternate complexity — the breadth of code. Next, let us get another perspective — in practical applications and the concerns of compounding — tune in to <strong>Episode III: Compound Revenge</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15649793702c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[May the Complexity be with you — Episode I: Enlightenment.]]></title>
            <link>https://medium.com/@billy.diggin/may-the-complexity-be-with-you-episode-i-enlightenment-b1dcd889a1bf?source=rss-94b58d3e0323------2</link>
            <guid isPermaLink="false">https://medium.com/p/b1dcd889a1bf</guid>
            <category><![CDATA[algorithms]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[complexity]]></category>
            <dc:creator><![CDATA[Billy Diggin]]></dc:creator>
            <pubDate>Tue, 16 Feb 2021 06:35:52 GMT</pubDate>
            <atom:updated>2021-02-16T06:35:52.295Z</atom:updated>
            <content:encoded><![CDATA[<h3>May the Complexity be with you — Episode I: Enlightenment.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TfA5MHUfXXrTw34uybeW5A.jpeg" /></figure><p>“<em>The dark side clouds everything. Impossible to see the future is.</em>” — <strong>Yoda</strong>.</p><h4>Preamble</h4><p>While the complexity of an algorithm operating in test conditions can be measured and may be well understood — understanding how it will perform in real-world use cases can be challenging. We all agree that it is not always good enough to code and compute a solution to one specific problem use case. Unless it really is a once-off, throw-away codebase, the compute code is invariably designed to be modular and will be repurposed again and again to accommodate the input variation in the problem space. This will necessitate using more than one algorithm to crack the nut. But, we want all our algorithms to be efficient regardless of this input variation. Therefore choosing or constructing the set of algorithms that compute each solution requires care and attention.</p><p><strong>Episode I</strong> covers the basics — subsequent episodes dive deeper into algorithm diversity, compounding and complexity mitigation examples. Finally, we shall explore diseconomies of scale — which affect cost, revenue and/or reputation.</p><h3>Episode I: Enlightenment</h3><p>“<em>You must unlearn what you have learned.</em>” — <strong>Yoda.</strong></p><p>From a practical standpoint, we can consider the main effect of complexity to be cost. Costing us more in time, more in space, or both. We face these daily in different guises. Whether it is that our iCloud storage is full because of our proclivity to image everything that our pets get up to; or perhaps it is our need to quickly find the answers to those burning questions in the pub quiz. Behind these everyday activities, complexity is often the limiting factor towards satisfying these ever growing demands. To circumvent limits, sometimes we trade space for speed and sometimes speed for space. For example, favoring to spend longer searching through a large set of documents on a remote storage service, versus searching an in-memory or local SSD medium that has limited storage capacity, e.g. on a mobile device. Or where we might pre-compute and allocate space to store a hash-table so that our data lookup is more efficient.</p><p>Algorithmic and computational efficiency are often related to a complexity scale — called <a href="https://en.wikipedia.org/wiki/Big_O_notation">Big-O Notation</a>. It is a classification notation — denoted in function terms, 𝒪(<em>f(n)</em>), where <em>n</em> is the scale of the input to the algorithm and <em>f(n)</em> captures the complexity effect acting on that input. It is used to describe how much relative cost (in time or space) is required as the scale of the input to the algorithm changes. Examples of algorithms with increasing complexity include:</p><ul><li>Bi-section search over an <em>n</em>-data length sorted array</li><li>Calculating the square root of a number to <em>n</em>-decimal places</li><li>Fast-Fourier-Transform of a <em>n</em>-data length sequence</li><li>Multiplying two <em>n</em>-bit numbers</li><li>Multiplication of two matrices (e.g. size <em>n</em>x<em>n</em>)</li><li>Convolution operations on an <em>n</em>x<em>n</em> image</li><li>Back-propagation of an <em>n</em>-node multi-layer perceptron</li><li>Travelling Salesman Problem with <em>n</em>-cities</li></ul><h4>Good Complexity</h4><p>“<em>Oh, my dear friend. How I’ve missed you.</em>” —<strong> C-3PO.</strong></p><p>Interestingly, and typically, as the data size increases, not only could space cost increase, but so also could computational cost. For example, to find an candidate element in a sorted list we would use a bi-section search algorithm. We start in the middle of the list and depending on the comparison result, we disregard the half where the candidate cannot be and iterate to the half of the list where the candidate could be, again splitting the remaining set in half and iterating until a solution is found or the search is exhausted.</p><p>While the storage cost of the sorted list scales linearly with its size, we note that the space complexity of the algorithm is order 𝒪(1) — constant complexity. Our bi-section search algorithm needs no extra memory to store intermediate data and is independent of the size of the sorted list — the algorithm’s memory requirement is constant regardless of the size of the sorted list. This is because the algorithm only needs to store the current upper and lower bounds of the search space.</p><p>Clearly, for bi-section search, the computational cost increases with <em>n</em>, the length of the sorted list — more data means more searching. It can be shown that the worst-case cost, in Big-O Notation, for bi-section search is 𝒪(log<em> n</em>) — logarithmic scale. This is good. There are economies of scale as the data set increases. For example, doubling the number of elements in the list, only adds one more iteration to the bi-section search — now that is efficient. <strong>Good</strong> complexity.</p><p>This all works well and is true if the list is already sorted. Where this is not the case and the list is scrambled, the worst-case scenario is that we must iterate through the entire list to find the candidate or exhaust the search. In this situation we incur a cost related to 𝒪(<em>n</em>) — linear scale— every additional element in the list means an additional comparison computation. This is still good complexity, we can linearly scale our processing since the marginal return compensates for the marginal cost. The chart depicts the difference between those various levels of complexity. One could argue that anything on or below the yellow 𝒪(<em>n</em>) line is favorable. For example, testing whether a number <em>n</em> is prime requires 𝒪(√<em>n</em>) — sub-linear complexity and it is a reasonably efficient task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*5MMq8A03Y_32V_kIOdxdyw.png" /><figcaption><strong>With us, the complexity is….</strong></figcaption></figure><h4>Bad Complexity</h4><p>“<em>Fear is the path to the dark side. Fear leads to anger; anger leads to hate; hate leads to suffering. I sense much fear in you.</em>” — <strong>Yoda</strong></p><p>Let’s move the dial to the dark side of the complexity force. We can accept that it takes more memory to store and multiply two 100x100 matrices, versus two 10x10 matrices; the storage factor is ~100x. Thankfully, the straightforward algorithm is constant in space complexity, regardless of input size, and space complexity is denoted as 𝒪(1). But of course, multiplying a 100x100 pair of matrices requires more compute steps than a 10x10 pair. In fact, one million multiplications are required for a standard 100x100 matrix pair versus one thousand multiplications for a 10x10 matrix pair — the compute factor is ~1000x. Quite significant, and that does not include the number of additions required to complete the calculations. In terms of Big-O Notation — matrix multiplication is described as having complexity order of 𝒪(<em>n</em>³) — there are <em>n</em>³ multiplications and <em>n</em>³ — <em>n</em>² additions.</p><p>In other words, matrix multiplication can be said to have cubic order complexity. Every increase in the size of the matrices to be multiplied has an associated cubic cost. Going from a 10x10 pair of matrices to a 20x20 pair of matrices is eight times the compute cost; 30x30 is twenty-seven times the compute cost, and so on. <strong>Bad</strong> complexity exemplified. This chart depicts the scale of destruction— the baseline is our linear, 𝒪(<em>n</em>), good complexity — evident that things soon get out of hand for 𝒪(<em>n</em>³), even for low <em>n</em>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*i8bb2DRfmzW_j-EAc8zcTw.png" /><figcaption>“It is useless to resist” — Darth Vader</figcaption></figure><h4>Ugly Complexity</h4><p>“<em>There’s always a bigger fish.</em>” — <strong>Qui-Gon Jinn</strong></p><p>Beyond the barely palatable 𝒪(<em>n</em>³), consider exponential complexity 𝒪(2ⁿ) — where the computation scales to the <em>n</em>-th power. These often occur in algorithms for combinatorial selection. The simplest examples are the number of ways bits can be set on a byte stream, or the number of ways to pick lottery numbers. Thereafter comes 𝒪(<em>n!</em>) — factorial complexity. This will choke you instantaneously — faster than Darth Sidious. This is depicted in the naïve brute force approaches used to solve many NP-hard problems, e.g. the Travelling Salesman Problem. The requirement is to test all permutations, typically via recursion. The chart below depicts the enormity of the situation— notice the logarithmic vertical scale. We generally want to avoid exponential or factorial complexity situations. However, if you really want to test your sanity, check out the <a href="https://en.wikipedia.org/wiki/Infinite_monkey_theorem">Infinite Monkey Theorem</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WCl2tzBgQCkN2vzuhjaNiQ.png" /><figcaption>“<em>Only a Sith Lord deals in absolutes</em>” — Obi-Wan Kenobi</figcaption></figure><h4>Postscript</h4><p>“<em>Chewie, we’re home.</em>” — <strong>Han Solo</strong></p><p>Ok, simple and somewhat theoretical examples. No net new insights, however they set the scene for some practical considerations. Next, we move from algorithm complexity towards computation complexity. Let’s discuss those in <strong>Episode II: The Diversity Wars</strong>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b1dcd889a1bf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The 30 Year Old Algorithm]]></title>
            <link>https://medium.com/accenture-the-dock/the-30-year-old-algorithm-b98e7008f874?source=rss-94b58d3e0323------2</link>
            <guid isPermaLink="false">https://medium.com/p/b98e7008f874</guid>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[image-processing]]></category>
            <category><![CDATA[algorithms]]></category>
            <dc:creator><![CDATA[Billy Diggin]]></dc:creator>
            <pubDate>Thu, 17 Sep 2020 15:29:55 GMT</pubDate>
            <atom:updated>2020-09-18T14:43:48.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*wk3ShF5rEfwl1wDiB2tArw.png" /></figure><p>This formula is nearly 60 years old. 30 years ago, an algorithm to efficiently compute the formula was devised. In 2020, we assess if it has stood the test of time.</p><p>Back in 1962, Ming-Kuei Hu, published a paper titled “<a href="https://ieeexplore.ieee.org/document/1057692">Visual Pattern Recognition by Moment Invariants</a>”. It is one of those publications that is so often cited. It has laid the foundation for many PhDs and a myriad of publications. Let’s see what it is all about….</p><h4>Geometric Moment Invariants</h4><p>For an image containing relevant objects of interest, Hu set out the means to not only calculate feature descriptors for those objects, but also the computations needed to generate feature descriptors that are invariant of position, orientation and scale. These feature descriptors could then be used to classify and measure the objects in the image (more about <a href="https://en.wikipedia.org/wiki/Image_moment">image moments</a>).</p><p>Firstly, Geometric Moments are calculated for the image. These can then be used to determine the location, orientation and scale of objects therein. Very useful. In turn, these moments form the basis for calculating Moment Invariants. These Moment Invariants are a set of measures that remain relatively constant even when the objects are moved, rotated or scaled in the image. Those measures are ideal as features for classification purposes and therefore very useful for object recognition applications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDJpKUr7rbZCBuOuanepsA.png" /><figcaption>Hu’s Geometric Moments and their Invariants applied to finding and locating my brain.</figcaption></figure><h4>The Backstory</h4><p>30 years ago, we set out to use Hu’s Geometric Moment Invariant approach for a particular automation application. We had a coordinate measuring machine (a CMM in metrology parlance). We wanted to use machine vision to classify and locate parts placed inside the machine so that automated measurement could take place. Geometric Moments and their Invariants were ideal. Segment the object(s) in the image, apply the moment algorithm, use Moment Invariants to classify the part(s), use Geometric Moments to determine the position and orientation of the part(s), then initiate the probing/measurement sequence, etc. Happy days….</p><h4>The Naïve Approach</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/304/1*wk3ShF5rEfwl1wDiB2tArw.png" /><figcaption>Geometric Moments Formula</figcaption></figure><p>The algorithm to implement the Geometric Moments calculation is pretty straightforward and relatively easy to understand — which is part of its appeal in the community. For each pixel in the image, <em>I(x, y)</em>, we multiply the pixel value with a power factor (<em>i, j</em>) of its index position <em>(x, y)</em> in each axis. These are then accumulated to 10 Geometric Moments. The naïve implementation is here:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*JfoHapWJAdQ2Q90TB1NV4A.png" /><figcaption>Calculating Hu’s 10 Geometric Moments</figcaption></figure><p>The implementation has 10 multiplications per pixel (yellow arrows). There are also 10 additions per pixel. So, if we have M columns and N rows in the image, then there are 10(M∙N) multiplications and 10(M∙N) additions.</p><h4>Moment of Truth!</h4><p>30 years ago, image sizes for machine vision were only 256 x 256px (unless you could afford the 512 x 512px image sensors). We had 80386 processors (and, if you were lucky, you had a floating point co-processor — the 80387). The naïve approach was slow back then — maybe taking 500ms for a 256 x 256px image. Today, the same image can have its moments calculated with this naïve algorithm in ~1–2ms — using an Intel Core i5 7th Generation as a benchmark. So, what’s the problem? The answer…. evolution; cameras have continued to grow in resolution, bit-depth, spectrum, etc. Image sizes and associated data are ever increasing. For example, medical imaging cameras are up to 5472 x 3648px (20 Mega-Pixels) or more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/927/1*MsYa15g5v0MMsd6yDaPuKQ.png" /><figcaption>Computation time versus image size for naïve implementation (in 2020)</figcaption></figure><p>The graph shows the problem. In Big-O Notation, the algorithm is O(M∙N) ≡ O(n²) → Quadratic Complexity. It is inefficient and does not scale well. As the image size or object size increases, it takes longer to compute the Geometric Moments. A 12 mega-pixel image will take ~500ms. So processor technology has advanced and we can compute faster, but conversely imaging technology has also scaled — so we’re back where we started 30 years ago! Time has kept pace with the algorithm — or maybe it’s the other way round. By the way, while an execution time of 500ms might have been palatable in the distant past — it’s a non-runner these days. Today, we expect to be able to process image sequences at better than frame-rate.</p><h4>Research to the Rescue</h4><p>Back 30 years ago, the community were working on the computation problem too. Binary images were all the rage. Determine the gray-level (adaptive) threshold, binarize the image, then perhaps take a run-length encoding or build a chain-code (boundary encoding). Scientists, Mathematicians &amp; Engineers figured out clever ways to compute the geometric moments of these encodings of binary images using <a href="https://en.wikipedia.org/wiki/Green%27s_theorem">Green’s Theorem</a> and other techniques. What was sacrificed in bit depth, was made up for in execution time. For gray-level images, other <a href="https://en.wikipedia.org/wiki/Boffin">boffins</a> built dedicated VLSI hardware — some even built elaborate optical processors.</p><h4>OpenCV</h4><p>The <a href="https://opencv.org/">OpenCV</a> Library (initiated in 1998 in Intel by Gary Bradski and released in 2000) provides &gt;80% of the best optimized algorithms that one might need in an computer vision library. For our benefit, there are methods in the OpenCV API to compute Geometric Moments. The basic implementation in the OpenCV library looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/739/1*UMTeyJ-_tMgwS2qGo21VWA.png" /><figcaption>Calculating Hu’s 10 Geometric Moments — one of the OpenCV methods</figcaption></figure><p>The implementation has 3 multiplications per pixel (yellow ovals). There are also 4 additions per pixel. So, if we have M columns and N rows in the image, then there are 3(M∙N)+7N multiplications and 4(M∙N)+10N additions. The algorithm is still O(M∙N) ≡ O(n²) → Quadratic Complexity. On paper, it has about one third of the number of multiplications and about one third of the number of additions of the naïve approach. So it should be three times faster. However, the clever people in Intel and OpenCV optimized the execution for SIMD-based and other processors. The result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*45L0WCWhhuZQDqLNrhBpeg.png" /><figcaption>Computation time versus image size for naïve and OpenCV implementation (in 2020). The OpenCV plot uses the µ-Seconds axis; the naïve is the milli-Seconds axis.</figcaption></figure><p>Both curves are obviously quadratic, but are an order of magnitude apart. We’d expect a 12 mega pixel image to be processed in ~10ms by the Intel Core i5. 50x faster than the naïve, unoptimized approach. Thank you OpenCV.</p><h4>Salvador Dali to the Rescue</h4><p>However, 30 years ago, OpenCV did not exist. An Intel Core i5 was not even a pipe-dream. So we had to make do with old fashioned Engineering and lateral thinking to come up with another approach.</p><p>Inspiration came from a Salvador Dali painting: <strong><em>The Persistence of Memory</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/368/1*scIoXZjOu2CdSx-sZ4qMRQ.jpeg" /><figcaption>Salvador Dalí. (Spanish, 1904–1989). The Persistence of Memory. 1931. Oil on canvas, 9 1/2 x 13&quot; (24.1 x 33 cm). © Salvador Dalí, Gala-Salvador Dalí Foundation/Artists Rights Society (ARS), New York. Photograph taken in 2004.</figcaption></figure><p>The surreal time-pieces that Dali conjured up subsequently evoked the idea of using projections of the image to calculate Hu’s Geometric Moments. In formal terms, these projections can be considered as elements of the Radon Transform (<a href="https://en.wikipedia.org/wiki/Johann_Radon"><em>Johann Radon</em></a><em>, an Austrian Mathematician, developed the Radon Transform in 1917</em>). This can be visualized as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/478/1*b9cm3rWtN8gxO3VFGNyP-w.png" /><figcaption>A projection onto a line integral at an angle α, as part of the Radon Transform (<a href="https://commons.wikimedia.org/wiki/File:Radon_transform_projection.png">Wikimedia</a> — <a href="https://commons.wikimedia.org/wiki/Category:CC-BY-SA-3.0">CC-BY-SA-3.0</a>)</figcaption></figure><h4>Discrete Radon Transform</h4><p>Dali provided the inspiration and Radon provided the constructs. The mathematical fundamentals were figured out for application to a discrete image. Then we figured out how to efficiently compute the Discrete Radon Transform and its projections. Next were the mathematics for the Geometric Moments of the projections. Then we determined the relationship between moments of the projection and the image moments. Finally, the computational steps could be constructed. It turns out only 4 projections are needed to calculate Hu’s Geometric Moments. So the steps in the algorithm are:</p><ol><li>Project the image horizontally, vertically, diagonally and anti-diagonally (cleverly using summations; no interpolations are involved)</li><li>Compute the 1-D Geometric Moments of each of the 4 projections</li><li>Calculate the 2-D Geometric Moments from the 1-D Geometric Moments</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_YKZgBPQ2WWol036NWjmQ.png" /><figcaption>4 Projections of my brain for the Discrete Radon Transform (it did not hurt)</figcaption></figure><p>We carefully encode the algorithm to be efficient, e.g. pointer arithmetic, linear progression through the image, minimizing code inside loops, etc. We instructed the compiler to optimize for SIMD-based processors — similar to the OpenCV implementation. In code, the DRT algorithm looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/673/1*W6BYvkNEvKURKvup7IV1OA.png" /><figcaption>Calculating Hu’s 10 Geometric Moments — the DRT Algorithm</figcaption></figure><h4>The Taste Test</h4><p>From inspection, we can see that the DRT algorithm has <strong>0</strong> multiplications per pixel! There are 4 additions per pixel. If we have M columns and N rows in the image, there is an order of M+N multiplications and M+N additions for each projection. In total there are 6(M+N) multiplications and 4(M∙N)+7(M+N) additions. The DRT algorithm is O(M+N) ≡ O(n) → Linear Complexity. Back in the day, this resulted in equivalent execution times of &lt;30ms for a 256 x 256px image — below frame-rate. An order of magnitude improvement relative to the naïve approach. Whooopeee!</p><p>How does it compare today against OpenCV?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*t7jD-UDHmY7n_gDTWpNcyQ.png" /><figcaption>Computation time versus image size for naïve and OpenCV implementation (in 2020). The DRT and OpenCV plots uses the µ-Seconds axis; the naïve is the milli-Seconds axis.</figcaption></figure><p>The DRT algorithm is ~3x faster than the OpenCV method — using the Core i5 as the benchmark. The curve is still quadratic —although while the multiplications in the algorithm are O(n), the additions in the algorithm are O(n²).</p><p>A 12 mega-pixel image can have its Geometric Moments computed in ~4ms. It would seem that this 30 year old algorithm has stood the test of time.</p><h4>Closing Remarks</h4><p>That’s how mad I am — what drives you mad?</p><p>The interested developer can check out the <a href="https://github.com/wild-ig/drt_moments">repository</a>.</p><p>The interested practitioner can check out the <a href="https://arxiv.org/abs/2008.11083">paper</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b98e7008f874" width="1" height="1" alt=""><hr><p><a href="https://medium.com/accenture-the-dock/the-30-year-old-algorithm-b98e7008f874">The 30 Year Old Algorithm</a> was originally published in <a href="https://medium.com/accenture-the-dock">Accenture The Dock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>