Algorithmic Growth

Order of Growth

Algorithmic efficiency is a function of time and required memory. All too often brute force approaches are used because it is relatively easy to construct and one that actually can provide proof of correctness. However, more clever polynomial time bounded approaches would provide a more efficient solution. The order of growth or rate of growth for an algorithm considers its running time. Only the leading term of a polynomial is required and constants and constant coefficients are insignificant. So a time of xn2 + yn + c yields a rate of growth of θ(n2). An algorithm would be more efficient than another one if its worst-case time has a lower order of growth. Keep in mind that this is for large inputs.

Asymptotic Efficiency

Various measures such as worst-case, average-case and best-case asymptotic complexity are used to indicate algorithmic efficiency. Asymptotic complexity itself refers to the function of computational time growth in a problem size as its size approaches infinity. Asymptotic efficiency deals with the increasing running time of an algorithm with respect to increases in the size of its input. Asymptotic running time notation is defined by functions having a domain of the natural numbers.

θ notation

k2g(n)

 
θ notation represents an upper and lower asymptotic "tight" bound for a given function f(n). So given a function g(n), θ(g(n)) = {f(n) | $ constants k1, k2 and n0 > 0 where 0 ² k1g(n) ² f(n) ² k2g(n) for every n ³ n0}. So the running time in θ notation can be anywhere from its lower bound to its upper bound.

 

 

 

 

 

 

 

 

 

 

 

 

 


f(n) = θ(g(n)) The notation is actually f(n) ë θ(g(n)).

O notation

O notation represents an upper asymptotic bound only. So given a function g(n), O(g(n)) = {f(n) | $ constants k and n0 > 0 where 0 ² f(n) ² kg(n) for every n ³ n0}. In other words, f(n) has an upper bound of some constant k multiple of g(n). So the running time in terms of O notation is always going to be the upper bound. In other words, we always know that the running time is going to be at the most the upper bound. As an example, O(n2) implies that if a computation of size n takes t units of time then a computation size of 2 * n would take 4 * t units of time. For a computation problem of O(n3), if the problem size doubled then the computation time would increase by a factor of 8.

 

 

 

 

 

 

 

 

 

 

 

 

 


f(n) = O(g(n)) The notation is actually f(n) ë O(g(n)).

½ notation

½ notation represents a lower asymptotic bound only. So given a function g(n), ½(g(n)) = {f(n) | $ constants k and n0 > 0 and 0 ² kg(n) ² f(n) for every n ³ n0}. So the running time in terms of ½ notation is always going to be the lower bound. In other words, we always know that the running time is as at least the lower bound.

 

 

 

 

 

 

 

 

 

 

 


f(n) = ½(g(n)) The notation is actually f(n) ë ½(g(n)).

Links

http://www.nist.gov/dads/HTML/bigOnotation.html
http://www.me.berkeley.edu/~e77/lecnotes/ch20/ch20.htm
http://www.cs.wisc.edu/~hasti/cs367-common/notes/COMPLEXITY.html