DEV Community

Rishal Hurbans
Rishal Hurbans

Posted on

Using heuristics for intelligence

When you're deciding if you'd try a specific pizza, you may have some criteria that it passes. The pizza might be made by someone different with a different technique, but as long as it passes your set of rules, you'll try it. This is a heuristic.

Alt Text

Often described as a rule of thumb, a heuristic is a rule or set of rules used to evaluate a state. It can be used to define criteria that a state must satisfy or measure the performance of a specific state.

A heuristic is used when a clear method of finding an optimal solution is not possible. A heuristic can be interpreted as an educated guess in social terms and should be seen more as a guideline than as a scientific truth.

If you enjoy cheddar cheese, mushrooms, and pineapple on a crispy base, a pizza that includes more of these attributes will be more appealing to you and achieve a better score for your heuristic.

Another example is writing algorithms to solve a GPS routing problem. The heuristic may be “Good paths minimize time in traffic and minimize distance traveled” or “Good paths minimize toll fees and maximize good road conditions”.

A poor heuristic for a GPS routing program would minimize straight-line distance between two points. This heuristic might work for birds or planes, but in reality, we walk or drive.

Heuristics are used in many AI algorithms to define attributes of what makes a good solution. Algorithms generate a variety of solutions and measure how good they are using heuristics. Some even evolve their own heuristics, like adversarial algorithms.

If you enjoyed this and want to learn more, see Grokking Artificial Intelligence Algorithms with Manning Publications: http://bit.ly/gaia-book, consider following me for more, or join my mailing list for infrequent knowledge drops in your inbox: https://rhurbans.com/subscribe.

Top comments (0)