Could someone differentiate between optimality and efficiency? Provide a definition for each term if possible.
Asked
Active
Viewed 4,497 times
3
-
1This is a broad topic, and also rife with opinion. It's probably not a good fit for SO. The answer you accepted is correct as far as it goes, but it doesn't go nearly far enough. Whole *books* have been written on this topic. – Jim Mischel Aug 11 '16 at 16:12
1 Answers
8
In both cases there is a criteria. In programming
or algorithms
they usually both refer to one of: operations, time or memory and the method of measuring.
Optimal - often marked as OPT
in algorithms - is the best solution according to the criteria. It means, that better solution doesn't exist. Watch out! There can be more than one OPT
solutions!
Efficient means nothing by itself but can be used in combine with a comparator. It means that you can say that one algorithm is more efficient that the other one which means, that it's faster or less memory consuming.
The most efficient
solution will be the optimal
one.

xenteros
- 15,586
- 12
- 56
- 91
-
Your concluding statement is not necessarily true. The most efficient in terms of speed might not be the optimal solution because it requires essentially infinite memory. There's theoretical optimum, and there's real world optimum. It's not at all unusual for a less efficient algorithm to outperform the theoretically optimum algorithm in the real world. – Jim Mischel Aug 11 '16 at 16:16
-
On my University we use to say that it's optimal in terms of speed, memory or both of them. So you can have both optimals: speed optimal and memory optimal solution. Usually you can't make an order on algorithms due to the fact that some of them aren't comparable absolutely. Still I see your point and I'll think out how to modify my answer. – xenteros Aug 12 '16 at 06:51