Week 2 Discussion Forum

Qualities of good algorithm

Qualities of good algorithm

by Mridul Halder(192-15-2908) -
Number of replies: 0

1.   Correctness: Your algorithm has to do what it’s supposed to do—solve the problem; and solve it in general—in all its possible instances. And you should make a formal analysis and prove (mathematically) that it does so.

2.   Optimality: You should also analysis the algorithm and show that it finds the solution in (asymptotically) optimal time. That’s typically done by showing what the lower bound for the problem solution complexity is and then show that your algorithm’s complexity is (again, asymptotically) equal. But it may get much more difficult with more complex algorithms.

3.   Stability: When your problem is discrete (or can be computed using discrete Arithmetic), you’re fine. But when you need to do your calculations in real (or complex) numbers, you always deal with numeric errors. There are 2 classes of them—one is inherent to the imprecise representation of real numbers in the (natively) digital machine architecture, the other one may be caused by the the calculations required by the algorithm. And numeric errors may cumulate—they may grow with the amount of operations. You need to make sure that the error is kept at bay, or your results may easily be completely off, even though the algorithm itself is sound and its implementation is (logically) correct. 

 


212 words