Quantcast
Viewing all articles
Browse latest Browse all 4

Answer by Joel David Hamkins for Worst known algorithm in terms of Big-O (more precisely Big-theta)?

Of course there can be no "worst" algorithm, since for anyalgorithm taking $p(n)$ steps on input of size $n$, we caneasily design another algorithm taking $2^{p(n)}$ steps,which will be worse by the big-$O$ and big-$\Theta$measures.

Meanwhile, the phenomenon of extremely long-runningcomputations is naturally related to the phenomenon offast-growing functions, such as the Ackermann diagonalfunction,whose values---and hence whose running times---areextremely large in comparison with conventional algorithms.

For example, here is an algorithm that is likely to beworse than any algorithm you may have considered. Theproblem is to determine, on input $n$, the $A(n)$-th digitof the decimal expansion of $\pi$, where $A(n)$ is theAckermann diagonal function. On input $n$, my proposedalgorithm would first compute $A(n)$, and then compute$\pi$ to that many digits, and then output thecorresponding digit. The running time of this algorithmwill exceed the Ackermann diagonal function, but it is notclear how one could improve the algorithm to make itfaster.

But perhaps you meant to inquire merely about feasiblealgorithms, that is, algorithms that we will actually wantto undertake. In this case, of course, even the exponentialalgorithms that seem to be required for NP problems wouldbe too hard, and we would want to stay within thepolynomial hierarchy. Even $n^3$ algorithms are not reallyfeasible on large input.

(But indeed, I go further, if you are truly interested onlyin actually feasible, practical algorithms, then thebig-$O$ and big-$\Theta$ concepts are not the rightconcept, since even constant time $O(1)$ algorithms can beunfeasible, if the constant is very large. The whole pointof big-$O$ and big-$\Theta$ is to look at asymptoticbehavior of the algorithms on extremely large input, andthis takes us immediately out of the actually feasiblecategory.)


Viewing all articles
Browse latest Browse all 4

Trending Articles