Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the difference between a heuristic and an algorithm?

What is the difference between a heuristic and an algorithm?

like image 394
streetparade Avatar asked Feb 25 '10 13:02

streetparade


People also ask

What is the difference between an algorithm and a heuristic psychology?

Algorithms and heuristics are different approaches to solving problems. Algorithms are comprehensive step-by-step procedures. They are exhaustive and guarantee the correct solution, but may be time-consuming and require a lot of mental effort. In contrast, heuristics are shortcut strategies or rules-of-thumb.

What is a significant difference between an algorithm and a heuristic quizlet?

An algorithm is a methodical, logical rule or procedure that guarantees solving a particular problem. A heuristic is a simple thinking strategy that allows us to make judgements and solve problems efficiently. Generally, heuristics are speedier but more error-prone than algorithms.

Is a heuristic a type of algorithm?

Heuristic algorithms are used to solve NP problems and decrease the time complexity of problems by giving quick solutions. It's popularly utilized in artificial intelligence problems. One example is informed search, where additional information is available to determine the next step towards finding the solution.

Why is algorithm better than heuristic?

While algorithms provide step-by-step procedures that can guarantee solutions, heuristics are faster and provide shortcuts for getting to solutions, though this has the potential to cause errors.


2 Answers

An algorithm is the description of an automated solution to a problem. What the algorithm does is precisely defined. The solution could or could not be the best possible one but you know from the start what kind of result you will get. You implement the algorithm using some programming language to get (a part of) a program.

Now, some problems are hard and you may not be able to get an acceptable solution in an acceptable time. In such cases you often can get a not too bad solution much faster, by applying some arbitrary choices (educated guesses): that's a heuristic.

A heuristic is still a kind of an algorithm, but one that will not explore all possible states of the problem, or will begin by exploring the most likely ones.

Typical examples are from games. When writing a chess game program you could imagine trying every possible move at some depth level and applying some evaluation function to the board. A heuristic would exclude full branches that begin with obviously bad moves.

In some cases you're not searching for the best solution, but for any solution fitting some constraint. A good heuristic would help to find a solution in a short time, but may also fail to find any if the only solutions are in the states it chose not to try.

like image 51
kriss Avatar answered Oct 15 '22 10:10

kriss


  • An algorithm is typically deterministic and proven to yield an optimal result
  • A heuristic has no proof of correctness, often involves random elements, and may not yield optimal results.

Many problems for which no efficient algorithm to find an optimal solution is known have heuristic approaches that yield near-optimal results very quickly.

There are some overlaps: "genetic algorithms" is an accepted term, but strictly speaking, those are heuristics, not algorithms.

like image 21
Michael Borgwardt Avatar answered Oct 15 '22 09:10

Michael Borgwardt