In a computer science context, a heuristic is a method to reach a result that has not been proven to be correct, or to always give optimal results (otherwise it would be an algorithm). Heuristics are used because in many cases, the algorithms that do the same task are much slower (especially for NP complete problems), and getting an occasional wrong result, or a not quite optimal one is better than having to wait forever for any result at all. A common heuristic is the usage of pseudoprime numbers in lieu of true primes in many cryptograhic programs like PGP and SSH.