## Invitation to Computer Science 8th Edition

Unlike algorithms, heuristics are techniques to obtain an answer for a problem, that is close to, but not exactly, an optimal solution. Heuristics are used when obtaining or applying an algorithm is impossible or impractical. This is achieved by trading optimality, completeness, accuracy, or precision for speed. Many problems in computer science that have no known fast algorithms are solved using heuristics. For example, the traveling salesman problem. --- For adding two three digits numbers, the following heuristic can be used. 1. The hundreds and thousands place of the answer is the sum of the hundreds place of the two numbers. 2. The tens and units place is 0. The above heuristic is guaranteed to give an answer that is off by less than or equal to 100. That is if the answer is $\mathrm{c},$ and the heuristic is given a value h, $|h-x|<=100$