Algorithm efficiency comes from problem information
Christopher Rackauckas · 2018
This is a high level post about algorithms (especially mathematical, scientific, and data analysis algorithms) which I hope can help people who are not researchers or numerical software developers better understand how to choose and evaluate algorithms.When scientists and programmers think about efficiency of algorithms, they tend to think about high level ideas like temporary arrays, choice of language, and parallelism.Or they tend to think about low level ideas like pointer indirection, cache efficiency, and SIMD vectorization.However, while these features matter, most decent implementations of the same algorithm tend to get quite close in efficiency to each other (probably What does my algorithm know about my problem?Let me highlight one of the biggest success stories in numerical analysis: solving linear systems.The problem is simple, for what values of does ?Most people learn early on in their math career that you solve this via Gaussian elimination which is a very nice algorithm (okay, it's actually not, but it doesn't get much better). In fact, as far as we know right now, solving linear systems has the same asymptotic complexity as matrix multiplication which is currently .This grows pretty fast, meaning the problem is quite hard, but is it all a game of who can write the most efficient general linear solver?Not even close.The algorithm complexity is the worst case scenario, but in most applications you actually aren't in "the worst case".MATLAB's backslash (A\b) operator solves the linear system , but what algorithm does it use?Well, Mathworks describes it with a picture: