What is heuristic programming and why it matters?

Heuristics are nothing new, they play an important role in our daily lives, in both problem-solving and decision-making. With the world is full of information, our brains are only capable of processing a certain amount of it, heuristics can help a lot. Because if you would try to analyze every single aspect of every situation or decision, you would never get anything done. We make thousands of decisions every single day and most of them we don’t really think about, we “know” how to behave in certain situations based on our experience and that’s what heuristics are about. When we are trying to solve a problem or make a decision, we often turn to these mental shortcuts when we need a quick solution.

So, what is heuristic programming?

Heuristics are mental shortcuts that help us make decisions and judgments quickly without having to spend a lot of time researching and analyzing information. They usually involve focusing on one aspect of a complex problem and ignoring others. They work well under most circumstances, but they can lead to systematic deviations from logic, probability or rational choice. Examples that employ heuristics include using a rule of thumb, an educated guess, an intuitive judgment, a guesstimate, stereotyping, profiling, or common sense.

In computer science, artificial intelligence, and mathematical optimization, a heuristic is a technique designed for solving a problem more quickly when classic methods are too slow, or for finding an approximate solution when classic methods fail to find any exact solution. This is achieved by trading optimality, completeness, accuracy, or precision for speed.

A heuristic programming employs a practical method, not guaranteed to be optimal, perfect, logical, or rational, but instead sufficient for reaching an immediate goal through programming techniques. It is important to highlight that Heuristics are the strategies derived from previous experiences with similar problems. These strategies rely on using readily accessible, though loosely applicable, information to control problem-solving in human beings, machines, and abstract issues.
And the objective of a heuristic is to produce a solution in a reasonable time frame that is good enough for solving the problem at hand.

The trade-off criteria for deciding whether to use a heuristic for solving a given problem:

  • Optimality: When several solutions exist for a given problem, does the heuristic guarantee that the best solution will be found? Is it actually necessary to find the best solution?
  • Completeness: When several solutions exist for a given problem, can the heuristic find them all? Do we actually need all solutions? Many heuristics are only meant to find one solution.
  • Accuracy and precision: Can the heuristic provide a confidence interval for the purported solution? Is the error bar on the solution unreasonably large?
  • Execution time: Is this the best-known heuristic for solving this type of problem? Some heuristics converge faster than others. Some heuristics are only marginally quicker than classic methods.

And now the main question is: why do we rely on heuristics?
Psychologists have suggested a few different theories:

  • Effort reduction: According to this theory, people utilize heuristics as a type of cognitive laziness. Heuristics reduce the mental effort required to make choices and decisions.
  • Attribute substitution: Other theories suggest people substitute simpler but related questions in place of more complex and difficult questions.
  • Fast and frugal: Still other theories argue that heuristics are actually more accurate than they are biased. In other words, we use heuristics because they are fast and usually correct.

This is in contrast to algorithmic programming, which is based on mathematically provable procedures. But what is important to understand here is that Heuristic programming is characterized by programs that are self-learning; they get better with experience. Heuristic programs do not always reach the very best result but usually produce a good result.

Let us know about your thoughts and experience with heuristic programming, we would be happy to discuss it in the comments section below.


Article was contributed by Ekaterina Novoseltseva, CMO at software development hub Apiumhub, which specializes in software architecture, web & mobile app development.

Jack is a tech blogger and content marketer specializing in online security and privacy. He spends his time split between Western Canada and Asia Pacific.