Heuristic (computer science)

In mathematical optimization and computer science, heuristic (from Greek εὑρίσκω "I find, discover"[1]) is a technique designed for problem solving more quickly when classic methods are too slow for finding an exact or approximate solution, or when classic methods fail to find any exact solution in a search space. This is achieved by trading optimality, completeness, accuracy, or precision for speed. In a way, it can be considered a shortcut.

A heuristic function, also simply called a heuristic, is a function that ranks alternatives in search algorithms at each branching step based on available information to decide which branch to follow. For example, it may approximate the exact solution.[2]

Definition and motivation

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. This solution may not be the best of all the solutions to this problem, or it may simply approximate the exact solution. But it is still valuable because finding it does not require a prohibitively long time.

Heuristics may produce results by themselves, or they may be used in conjunction with optimization algorithms to improve their efficiency (e.g., they may be used to generate good seed values).

Results about NP-hardness in theoretical computer science make heuristics the only viable option for a variety of complex optimization problems that need to be routinely solved in real-world applications.

Heuristics underlie the whole field of Artificial Intelligence and the computer simulation of thinking, as they may be used in situations where there are no known algorithms.[3]

Trade-off

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

  • 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, in which case the 'overhead' on calculating the heuristic might have a negative impact.

In some cases, it may be difficult to decide whether the solution found by the heuristic is good enough because the theory underlying heuristics is not very elaborate.

Examples

Simpler problem

One way of achieving the computational performance gain expected of a heuristic consists of solving a simpler problem whose solution is also a solution to the initial problem.

Travelling salesman problem

An example of approximation is described by Jon Bentley for solving the travelling salesman problem (TSP):

  • "Given a list of cities and the distances between each pair of cities, what is the shortest possible route that visits each city exactly once and returns to the origin city?"

so as to select the order to draw using a pen plotter. TSP is known to be NP-hard so an optimal solution for even a moderate size problem is difficult to solve. Instead, the greedy algorithm can be used to give a good but not optimal solution (it is an approximation to the optimal answer) in a reasonably short amount of time. The greedy algorithm heuristic says to pick whatever is currently the best next step regardless of whether that prevents (or even makes impossible) good steps later. It is a heuristic in the sense that practice indicates it is a good enough solution, while theory indicates that there are better solutions (and even indicates how much better, in some cases).[4]

Another example of heuristic making an algorithm faster occurs in certain search problems. Initially, the heuristic tries every possibility at each step, like the full-space search algorithm. But it can stop the search at any time if the current possibility is already worse than the best solution already found. In such search problems, a heuristic can be used to try good choices first so that bad paths can be eliminated early (see alpha–beta pruning). In the case of best-first search algorithms, such as A* search, the heuristic improves the algorithm's convergence while maintaining its correctness as long as the heuristic is admissible.

Newell and Simon: heuristic search hypothesis

In their Turing Award acceptance speech, Allen Newell and Herbert A. Simon discuss the heuristic search hypothesis: a physical symbol system will repeatedly generate and modify known symbol structures until the created structure matches the solution structure. Each following step depends upon the step before it, thus the heuristic search learns what avenues to pursue and which ones to disregard by measuring how close the current step is to the solution. Therefore, some possibilities will never be generated as they are measured to be less likely to complete the solution.

A heuristic method can accomplish its task by using search trees. However, instead of generating all possible solution branches, a heuristic selects branches more likely to produce outcomes than other branches. It is selective at each decision point, picking branches that are more likely to produce solutions.[5]

Antivirus software

Antivirus software often uses heuristic rules for detecting viruses and other forms of malware. Heuristic scanning looks for code and/or behavioral patterns common to a class or family of viruses, with different sets of rules for different viruses. If a file or executing process is found to contain matching code patterns and/or to be performing that set of activities, then the scanner infers that the file is infected. The most advanced part of behavior-based heuristic scanning is that it can work against highly randomized self-modifying/mutating (polymorphic) viruses that cannot be easily detected by simpler string scanning methods. Heuristic scanning has the potential to detect future viruses without requiring the virus to be first detected somewhere else, submitted to the virus scanner developer, analyzed, and a detection update for the scanner provided to the scanner's users.

Pitfalls

Some heuristics have a strong underlying theory; they are either derived in a top-down manner from the theory or are arrived at based on either experimental or real world data. Others are just rules of thumb based on real-world observation or experience without even a glimpse of theory. The latter are exposed to a larger number of pitfalls.

When a heuristic is reused in various contexts because it has been seen to "work" in one context, without having been mathematically proven to meet a given set of requirements, it is possible that the current data set does not necessarily represent future data sets (see: overfitting) and that purported "solutions" turn out to be akin to noise.

Statistical analysis can be conducted when employing heuristics to estimate the probability of incorrect outcomes. To use a heuristic for solving a search problem or a knapsack problem, it is necessary to check that the heuristic is admissible. Given a heuristic function meant to approximate the true optimal distance to the goal node in a directed graph containing total nodes or vertices labeled , "admissible" means roughly that the heuristic underestimates the cost to the goal or formally that for all where .

If a heuristic is not admissible, it may never find the goal, either by ending up in a dead end of graph or by skipping back and forth between two nodes and where .

Etymology

The word "heuristic" came into usage in the early 19th century. It is formed irregularly from the Greek word heuriskein, meaning "to find".[6]

See also

  • Constructive heuristic
  • Metaheuristic: Methods for controlling and tuning basic heuristic algorithms, usually with usage of memory and learning.
  • Matheuristics: Optimization algorithms made by the interoperation of metaheuristics and mathematical programming (MP) techniques.
  • Reactive search optimization: Methods using online machine learning principles for self-tuning of heuristics.

References

  1. ^ https://en.wiktionary.org/wiki/heuristic
  2. ^ Pearl, Judea (1984). Heuristics: intelligent search strategies for computer problem solving. United States: Addison-Wesley Pub. Co., Inc., Reading, MA. p. 3. OSTI 5127296.
  3. ^ Apter, Michael J. (1970). The Computer Simulation of Behaviour. London: Hutchinson & Co. p. 83. ISBN 9781351021005.
  4. ^ Jon Louis Bentley (1982). Writing Efficient Programs. Prentice Hall. p. 11.
  5. ^ Allen Newell and Herbert A. Simon (1976). "Computer Science as Empirical Inquiry: Symbols and Search" (PDF). Comm. ACM. 19 (3): 113–126. doi:10.1145/360018.360022. S2CID 5581562.
  6. ^ "Definition of heuristic in English". Oxford University Press. Archived from the original on 23 October 2016. Retrieved 22 October 2016.

Read other articles:

Human settlement in EnglandJuniper HillJuniper HillLocation within OxfordshireOS grid referenceSP579324Civil parishCottisfordDistrictCherwellShire countyOxfordshireRegionSouth EastCountryEnglandSovereign stateUnited KingdomPost townBrackleyPostcode districtNN13Dialling code01280PoliceThames ValleyFireOxfordshireAmbulanceSouth Central UK ParliamentBanbury List of places UK England Oxfordshire 51°59′17″N 1°09′29″W / 51.988°N 1.158°W...

 

Cemetery and museum in Ponce, Puerto Rico United States historic placeCementerio Antiguo de PonceU.S. National Register of Historic Places The Panteón Nacional Román Baldorioty de Castro, previously known as Cementerio Antiguo de Ponce (looking north)Location of Ponce and the cemetery in Puerto RicoLocationCalle Torre no. 1 and Calle Frontispicio, Ponce, Puerto RicoCoordinates18°00′57″N 66°37′04″W / 18.015833°N 66.617778°W / 18.015833; -66.617778Area3.7 a...

 

Клаусс Особисті дані Повне ім'я Жуан Клаусс де Мелло Народження 1 березня 1997(1997-03-01) (26 років)   Крісіумаd, Санта-Катаріна, Бразилія Зріст 190 см Вага 84 кг Громадянство  Бразилія Позиція нападник Інформація про клуб Поточний клуб «Сент-Луїс Сіті» Юнацькі клуби 2006...

Perijinan dagang (Belanda: handelspas) yang dikeluarkan atas nama Tokugawa Ieyasu. VOC Opperhoofden di Jepang adalah kepala dagang Perusahaan Hindia Timur Belanda (Vereenigde Oostindische Compagnie atau VOC dalam ejaan lama Belanda, artinya Perusahaan Hindia Timur Bersatu) di Jepang pada zaman keshogunan Tokugawa, juga disebut sebagai zaman Edo. Opperhoofd adalah sebuah kata Belanda (jamak opperhoofden) yang artinya 'kepala tertinggi'. Dalam pemakaian sejarah, kata tersebut adalah gelar guber...

 

العلاقات الأفغانية الوسط أفريقية أفغانستان جمهورية أفريقيا الوسطى   أفغانستان   جمهورية أفريقيا الوسطى تعديل مصدري - تعديل   العلاقات الأفغانية الوسط أفريقية هي العلاقات الثنائية التي تجمع بين أفغانستان وجمهورية أفريقيا الوسطى.[1][2][3][4][5]...

 

Ця стаття про збірку Марко Вовчок. Про жанр оповідань див. Народне оповідання. «Народні оповідання» Палітурка першого тому збірки оповідань Марка Вовчка «Народні оповідання» (1857)Автор Марко ВовчокКраїна Російська імперіяМова українськаМісце СПбВидавництво Типографія...

أولاد الياقوت تقسيم إداري البلد المغرب  الجهة فاس مكناس الإقليم تاونات الدائرة قرية با محمد الجماعة القروية سيدي العابد المشيخة الكرادسة السكان التعداد السكاني 87 نسمة (إحصاء 2004)   • عدد الأسر 11 معلومات أخرى التوقيت ت ع م±00:00 (توقيت قياسي)[1]،  وت ع م+01:00 (توقيت صيفي...

 

Running Up That HillSingel oleh Kate Bushdari album Hounds of LoveSisi-BUnder the IvyDirilis5 Agustus 1985 (1985-08-05)GenreSynth-pop[1][2]art pop[3]new wave[4]art rock[5]Durasi4:58LabelEMIPenciptaKate BushProduserKate BushKronologi singel Kate Bush Night of the Swallow (1983) Running Up That Hill (1985) Cloudbusting (1985) Music videoRunning Up That Hill di YouTubeSampel audioBerkas:Running Up That Hill.oggberkasbantuan Running Up That Hill, atau ...

 

This article needs additional citations for verification. Please help improve this article by adding citations to reliable sources. Unsourced material may be challenged and removed.Find sources: 1720 in Canada – news · newspapers · books · scholar · JSTOR (January 2021) (Learn how and when to remove this template message) ← 1719 1718 1717 1720 in Canada → 1721 1722 1723 Decades: 1700s 1710s 1720s 1730s 1740s See also: History of Canada Time...

Irish legendary creature This article is about the creature in Irish folklore. For other uses, see Leprechaun (disambiguation). LeprechaunA modern depiction of a leprechaun of the type popularised in the 20th centuryGroupingLegendary creaturePixieSpriteFairyAos SíFirst attestedIn folkloreCountryIrelandDetailsFound in a moor, forest, cave, garden A leprechaun (Irish: lucharachán/leipreachán/luchorpán) is a diminutive supernatural being in Irish folklore, classed by some as a type of solita...

 

Опис Емблема ФК Нафтовик Долина Джерело http://naftovyk.if.ua/ Час створення 2018 Автор зображення невідомо Ліцензія Відповідно до статті 8 Закону України про авторське право і суміжні права, наступні об'єкти не охороняються авторським правом: 1) повідомлення про новини або інші фак...

 

Artikel ini sebatang kara, artinya tidak ada artikel lain yang memiliki pranala balik ke halaman ini.Bantulah menambah pranala ke artikel ini dari artikel yang berhubungan atau coba peralatan pencari pranala.Tag ini diberikan pada April 2016. Informasi industri musik Indonesia adalah semua informasi yang berhubungan dengan industri Musik di Indonesia antara lain Asosiasi, Perusahaan rekaman, Grup musik Indonesia, Penyanyi Indonesia, Media penyelenggara informasi di Indonesia, Hak Cipta, Singe...

Play by Middleton and Rowley, published 1652 Title page of 1653 publicationWritten byThomas Middleton and William RowleyCharactersVermanderoBeatrice-JoannaDiaphantaTomazo de PiracquoAlonzo de PiracquoAlsemeroJasperinoDe FloresAlibiusLollioIsabellaFranciscusAntonioPedroDate premiered1622Place premieredLondon, EnglandOriginal languageEarly Modern EnglishSubjecttreachery, sinGenretragedySetting17th century: Alicante and a madhouse nearby The Changeling is a Jacobean tragedy written by Thomas Mid...

 

Rue de l'Étuve richting Place Cockerill De Rue de l'Étuve is een oude straat in de Belgische stad Luik. Ze loopt van de Rue de la Cathédrale tot aan de Place Cockerill. In het Nederlands betekent de straatnaam Stoofstraat, wat verwijst naar een (bad)stoof, een openbaar badhuis. In 1861 was er minstens één badstoof te vinden in de straat. De straat dateert uit de 14e eeuw en lag oorspronkelijk op een eilandje tussen de Biez du Moulin Saint-Jean (sinds 1815 de Rue de l'Université), de Bie...

 

American theologian (1803–1895) Not to be confused with Edward Beech. Edward BeecherBorn(1803-08-27)August 27, 1803East Hampton, New YorkDiedJuly 28, 1895(1895-07-28) (aged 91)Brooklyn, New YorkOccupationTheologianSpouseIsabella JonesChildrenElevenParentLyman Beecher Edward Beecher (August 27, 1803 – July 28, 1895) was an American theologian, the son of Lyman Beecher and the brother of Harriet Beecher Stowe and Henry Ward Beecher. Biography Beecher was born August 27, 1803, in East H...

Eka Supria AtmajaBupati Bekasi ke-14Masa jabatan12 Juni 2019 – 11 Juli 2021 Pelaksana Tugas: 18 Oktober 2018 – 12 Juni 2019PresidenJoko WidodoGubernurRidwan KamilWakilAkhmad Marjuki (sejak 27 Oktober 2021)PendahuluNeneng Hassanah YasinPenggantiHerman Hanafi (Plh.) Dani Ramdan (Pj.) Akhmad Marjuki (Plt.) Wakil Bupati Bekasi ke-6Masa jabatan22 Mei 2017 – 18 Oktober 2018PresidenJoko WidodoGubernurAhmad HeryawanRidwan KamilBupatiNeneng Hassanah YasinPendahuluRohim ...

 

French television series SpiralFrenchEngrenages Created byAlexandra ClertGuy-Patrick SainderichinStarringCaroline ProustPhilippe DuclosAudrey FleurotThierry GodardFred BianconiGrégory FitoussiComposerStéphane ZidiCountry of originFranceOriginal languageFrenchNo. of series8No. of episodes86 (list of episodes)ProductionRunning time52 minutesOriginal releaseNetworkCanal+Release13 December 2005 (2005-12-13) –5 October 2020 (2020-10-05) Spiral (French: Engrenages, lit. ...

 

British TV series or programme PretendersStarringFrederick JaegerCountry of originUnited KingdomOriginal languagesEnglish, German, WelshNo. of series1No. of episodes13ProductionProducersPatrick Dromgoole Leonard WhiteProduction companyHTVOriginal releaseNetworkITVRelease27 February (1972-02-27) –21 May 1972 (1972-05-21) Pretenders was a 13 episode British historical adventure television series produced by Harlech Television (HTV) and broadcast from 27 February to 21 May ...

South African adventurer and photographer This article has multiple issues. Please help improve it or discuss these issues on the talk page. (Learn how and when to remove these template messages) This biography of a living person needs additional citations for verification. Please help by adding reliable sources. Contentious material about living persons that is unsourced or poorly sourced must be removed immediately from the article and its talk page, especially if potentially libelous.Find ...

 

Railway station serving the city of Kunming, Yunnan, China Kunming昆明 metro A view of Kunming railway stationGeneral informationLocationGuandu District, Kunming, YunnanChinaCoordinates25°1′3″N 102°43′15″E / 25.01750°N 102.72083°E / 25.01750; 102.72083Operated byKunming Railway Bureau, Ministry of Railways of the PRCPlatforms6HistoryOpened1966Services Preceding station China Railway Following station Qujingtowards Shanghai or Shanghai South Shan...

 

Strategi Solo vs Squad di Free Fire: Cara Menang Mudah!