What is the difference between a heuristic and an algorithm?

后端 未结 12 562
说谎
说谎 2021-01-29 17:25

What is the difference between a heuristic and an algorithm?

12条回答
  •  别那么骄傲
    2021-01-29 18:12

    Actually I don't think that there is a lot in common between them. Some algorithm use heuristics in their logic (often to make fewer calculations or get faster results). Usually heuristics are used in the so called greedy algorithms.

    Heuristics is some "knowledge" that we assume is good to use in order to get the best choice in our algorithm (when a choice should be taken). For example ... a heuristics in chess could be (always take the opponents' queen if you can, since you know this is the stronger figure). Heuristics do not guarantee you that will lead you to the correct answer, but (if the assumptions is correct) often get answer which are close to the best in much shorter time.

提交回复
热议问题