Hybrid algorithm

A hybrid algorithm is an algorithm that combines two or more other algorithms that solve the same problem, either choosing one based on some characteristic of the data, or switching between them over the course of the algorithm. This is generally done to combine desired features of each, so that the overall algorithm is better than the individual components.

"Hybrid algorithm" does not refer to simply combining multiple algorithms to solve a different problem – many algorithms can be considered as combinations of simpler pieces – but only to combining algorithms that solve the same problem, but differ in other characteristics, notably performance.

Examples

In computer science, hybrid algorithms are very common in optimized real-world implementations of recursive algorithms, particularly implementations of divide-and-conquer or decrease-and-conquer algorithms, where the size of the data decreases as one moves deeper in the recursion. In this case, one algorithm is used for the overall approach (on large data), but deep in the recursion, it switches to a different algorithm, which is more efficient on small data. A common example is in sorting algorithms, where the insertion sort, which is inefficient on large data, but very efficient on small data (say, five to ten elements), is used as the final step, after primarily applying another algorithm, such as merge sort or quicksort. Merge sort and quicksort are asymptotically optimal on large data, but the overhead becomes significant if applying them to small data, hence the use of a different algorithm at the end of the recursion. A highly optimized hybrid sorting algorithm is Timsort, which combines merge sort, insertion sort, together with additional logic (including binary search) in the merging logic.

A general procedure for a simple hybrid recursive algorithm is short-circuiting the base case, also known as arm's-length recursion. In this case whether the next step will result in the base case is checked before the function call, avoiding an unnecessary function call. For example, in a tree, rather than recursing to a child node and then checking if it is null, checking null before recursing. This is useful for efficiency when the algorithm usually encounters the base case many times, as in many tree algorithms, but is otherwise considered poor style, particularly in academia, due to the added complexity.

Another example of hybrid algorithms for performance reasons are introsort and introselect, which combine one algorithm for fast average performance, falling back on another algorithm to ensure (asymptotically) optimal worst-case performance. Introsort begins with a quicksort, but switches to a heap sort if quicksort is not progressing well; analogously introselect begins with quickselect, but switches to median of medians if quickselect is not progressing well.

Centralized distributed algorithms can often be considered as hybrid algorithms, consisting of an individual algorithm (run on each distributed processor), and a combining algorithm (run on a centralized distributor) – these correspond respectively to running the entire algorithm on one processor, or running the entire computation on the distributor, combining trivial results (a one-element data set from each processor). A basic example of these algorithms are distribution sorts, particularly used for external sorting, which divide the data into separate subsets, sort the subsets, and then combine the subsets into totally sorted data; examples include bucket sort and flashsort.

However, in general distributed algorithms need not be hybrid algorithms, as individual algorithms or combining or communication algorithms may be solving different problems. For example, in models such as MapReduce, the Map and Reduce step solve different problems, and are combined to solve a different, third problem.

See also

Read other articles:

Risørs kommun Risør kommuneRisør kommune Kommun Risør Kommunflagga Risørs kommunvapen Land  Norge Fylke Agder fylke Koordinater 58°43′29″N 9°13′48″Ö / 58.72472°N 9.23000°Ö / 58.72472; 9.23000 Centralort Risør Area 584,73 km² (2020)[6]  - land 179,02 km² (2020)  - vatten 405,71 km² Folkmängd 6 806 (2023)[7] Befolkningstäthet 38 invånare/km² Grundad 1837[1]  - Tillförda...

 

Dieser Artikel behandelt die rheinland-pfälzische Ortsgemeinde Reiferscheid. Für den Ortsteil von Ruppichteroth in Nordrhein-Westfalen siehe Reiferscheid (Ruppichteroth). Zu Orten namens Reifferscheid siehe Gemeinde Reifferscheid im Landkreis Ahrweiler und Ortsteil Reifferscheid (Hellenthal) der Gemeinde Hellenthal. Wappen Deutschlandkarte ? Hilfe zu Wappen 50.6555555555567.5461111111111250Koordinaten: 50° 39′ N, 7° 33′ O Basisdaten Bundesland: Rheinland-Pfalz Land...

 

Stadium in Saaremaa, Estonia Kuressaare linnastaadionLocationKuressaare, Saaremaa island, EstoniaOwnerTown of KuressaareOperatorSaaremaa SpordikoolCapacity2,000Field size100 × 60 mSurfaceGrassConstructionOpened31 August 1958; 65 years ago (1958-08-31)[1]Renovated2014Construction cost€2.1 million (2014)[2]TenantsFC Kuressaare (1997–present) Kuressaare linnastaadion is a multi-purpose stadium in Kuressaare, Estonia. It is currently used mostly for football...

Spencer WareDatos personalesNombre completo Spencer Ware[5]​Nacimiento Eunice Luisiana[1]​[2]​23 de noviembre de 1991 (32 años)[3]​[4]​País  Estados UnidosNacionalidad(es) EstadounidenseAltura 1,78 m (5′ 10″)Peso 103.97 kg (229 lb)Carrera deportivaDeporte Fútbol americanoEquipo universitario Universidad Estatal de LuisianaClub profesionalDebut deportivo 2013( Kansas City Chiefs)Draft de la NFL 2013Ronda 6 (puesto 194º)Equipo elect...

 

هذه المقالة يتيمة إذ تصل إليها مقالات أخرى قليلة جدًا. فضلًا، ساعد بإضافة وصلة إليها في مقالات متعلقة بها. (يوليو 2022) مفاعل تجرى فيه عملية اصطناع مفاعل التدفق الصفحي (LFR) هو نوع من المفاعلات الكيميائية التي تستخدم التدفق الصفحي للتحكم في معدل التفاعل أو توزيع التفاعل.[1] ...

 

Bagian dari seriZoroastrianismeFaravahardiyakini sebagai gambaran dari fravashi Topik utama Ahura Mazda Zarathustra aša (asha) / arta Malaikat dan iblis Amesha Spentas · Yazatas Ahuras · Daevas Angra Mainyu Kitab dan penyembahan Avesta Gatha · Yasna Vendidad · Visperad Yashts · Khordeh Avesta Ab-Zohr Selawat Ahuna Vairya Kuil Api Cerita dan legenda Dēnkard · Bundahišn Kitab Arda Viraf Kitab Jamasp Sanjan Sejarah dan kultur Zurvanism Kalender · Festival Pernikahan Eksatologi/Akhirat ...

يفتقر محتوى هذه المقالة إلى الاستشهاد بمصادر. فضلاً، ساهم في تطوير هذه المقالة من خلال إضافة مصادر موثوق بها. أي معلومات غير موثقة يمكن التشكيك بها وإزالتها. (نوفمبر 2019) الرابطة الجزائرية المحترفة الأولى 1964-1965 تفاصيل الموسم الرابطة الجزائرية المحترفة الأولى  البلد الجزائ

 

 Nota: Para outros significados, veja Queimada (desambiguação). Agricultura História Revolução neolítica Agricultura na Grécia Antiga Agricultura no Egito Antigo Agricultura na Roma Antiga Revolução agrícola árabe Intercâmbio colombiano Revolução agrícola britânica Revolução verde Na terra Agropecuária Pecuária Bovinocultura Suinocultura Avicultura Ovinocultura Pecuária de leite Sequeiro Extensiva Fertilizante Pastagem Intensiva animais Natural Monocultura Pomar Org...

 

Brazilian football manager (born 1967) In this Portuguese name, the first or maternal family name is Vieira and the second or paternal family name is de Araújo. Júnior is a generational suffix used for someone whose name is the same as their father, like Jr. in English. Moacir Júnior Moacir Júnior in 2021Personal informationFull name Moacir Vieira de Araújo JúniorDate of birth (1967-02-15) 15 February 1967 (age 56)Place of birth Curvelo, Brazil[1]Height 1.87...

2022 single by Cole SwindellShe Had Me at Heads CarolinaSingle by Cole Swindellfrom the album Stereotype ReleasedJune 21, 2022 (2022-06-21) (original) November 7, 2022 (2022-11-07) (remix)StudioSound Stage Studios (Nashville)[1]GenreCountry[1]Length 3:27 (original) 3:43 (remix) LabelWarner Music NashvilleSongwriter(s)Cole SwindellAshley GorleyJesse FrasureThomas RhettMark D. SandersTim NicholsProducer(s)Zach CrowellCole Swindell singles chronology...

 

PatchesSingle by Clarence CarterB-sideSay It One More Time(most countries)I Can't Leave Your Love Alone(UK)[1]ReleasedJuly 1970Recorded1970Genre Soul southern soul country Length3:10LabelAtlanticSongwriter(s)Ron Dunbar, General JohnsonProducer(s)Rick HallClarence Carter singles chronology I Can't Leave Your Love Alone (1970) Patches (1970) It's All in Your Mind (1970) Patches (sometimes known as Patches (I'm Depending On You))[2] is a country soul song written by General Johns...

 

Friday the 13thPoster rilis teatrikalSutradara Marcus Nispel ProduserMichael BayAndrew FormBrad FullerDitulis olehDamian ShannonMark SwiftSkenarioDamian ShannonMark SwiftCeritaDamian ShannonMark SwiftMark WheatonBerdasarkanCharactersoleh Victor MillerPemeranJared PadaleckiDanielle PanabakerAmanda RighettiAaron YooTravis Van WinkleDerek MearsPenata musikSteve JablonskySinematograferDaniel PearlPenyuntingKen BlackwellPerusahaanproduksiParamount PicturesNew Line CinemaPlatinum DunesDistrib...

Range of hills in Worcestershire A view from the top of Bilberry Hill The Lickey Hills (known locally as simply The Lickeys) are a range of hills in Worcestershire, England, 11 miles (18 km) to the south-west of the centre of Birmingham near the villages of Lickey, Cofton Hackett and Barnt Green. The hills are a popular country park area and they afford panoramic views over much of the surrounding countryside. Ownership The hills had been a royal hunting reserve belonging to the Manor of...

 

Language that is cultivated for religious reasons Holy Language redirects here. For the language so called by John Dee, see Enochian. For the concept of a divine language, see Divine language. Part of a series onAnthropology of religionThe oldest surviving manuscript in the sacred Sanskrit language: Devi Māhātmya, on palm-leaf, in an early Bhujimol script, Bihar or Nepal, 11th century. Basic concepts Afterlife Animism Augury Communitas Comparative religion Divination Divine language Evoluti...

 

The Marys of the EmpireLocationBritain and CommonwealthFounderLady Mary Trefusis Hon. Mrs Geoffrey Hope-MorleyEstablished1911 Following the announcement of the coronation of Queen-Empress Mary and King-Emperor George V in 1911 all the Marys in the Empire donated money towards a gift for the new Queen. 11 years later, to mark the engagement of their daughter Princess Mary to Viscount Lascelles, the Marys of the Empire clubbed together again.[1][2] The name Mary At the start of ...

St. Marie Lugar designado por el censo St. MarieUbicación en el condado de Valley en Montana Ubicación de Montana en EE. UU.Coordenadas 48°24′11″N 106°31′58″O / 48.403055555556, -106.53277777778Entidad Lugar designado por el censo • País Estados Unidos • Estado  Montana • Condado ValleySuperficie   • Total 59.31 km² • Tierra 59.22 km² • Agua (0.14%) 0.09 km²Altitud   • Media 832 m s. n. m.Pobl...

 

1994 soundtrack album by Various ArtistsThe Swan Princess: Music From The Motion PictureSoundtrack album by Various ArtistsReleasedNovember 1, 1994[1]GenreSoundtrackLabelSony WonderProducerVarious ArtistsSingles from The Swan Princess: Music From The Motion Picture Far Longer than ForeverReleased: 1994 The Swan Princess: Music From The Motion Picture is the soundtrack to the Animated Feature The Swan Princess. The single Far Longer than Forever performed by Regina Belle and Je...

 

Road in Tamil Nadu, India 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 article is written like a personal reflection, personal essay, or argumentative essay that states a Wikipedia editor's personal feelings or presents an original argument about a topic. Please help improve it by rewriting it in an encyclopedic style. (August 2012) (Learn how and when to remove this template mess...

Japanese musician (1966–2011) 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: Taiji musician – news · newspapers · books · scholar · JSTOR (August 2011) (Learn how and when to remove this template message) Taiji沢田 泰司Taiji performing with X circa 1990Background informationBirth nameTaiji Sawada...

 

Estrellas Del Aire IATA ICAO Callsign - ETA[1] ESTRELLAS[2] Founded1991Commenced operationsSeptember 1991Ceased operationsNovember 1996Operating basesLic. Benito Juarez International AirportFleet size2Parent companyLínea Estrella de OroEmployees47 (in 1995)[3] Estrellas del Aire (English: Air Stars) was a Mexican passenger airline. It was established in 1991 by Estrellas de Oro, to complement their existing bus routes throughout Mexico. It was notable for being one of...

 

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