In computer science, a Fibonacci heap is a data structure for priority queue operations, consisting of a collection of heap-ordered trees. It has a better amortized running time than many other priority queue data structures including the binary heap and binomial heap. Michael L. Fredman and Robert E. Tarjan developed Fibonacci heaps in 1984 and published them in a scientific journal in 1987. Fibonacci heaps are named after the Fibonacci numbers, which are used in their running time analysis.
The amortized times of all operations on Fibonacci heaps is constant, except delete-min.[1][2] Deleting an element (most often used in the special case of deleting the minimum element) works in O ( log --> n ) {\displaystyle O(\log n)} amortized time, where n {\displaystyle n} is the size of the heap.[2] This means that starting from an empty data structure, any sequence of a insert and decrease-key operations and b delete-min operations would take O ( a + b log --> n ) {\displaystyle O(a+b\log n)} worst case time, where n {\displaystyle n} is the maximum heap size. In a binary or binomial heap, such a sequence of operations would take O ( ( a + b ) log --> n ) {\displaystyle O((a+b)\log n)} time. A Fibonacci heap is thus better than a binary or binomial heap when b {\displaystyle b} is smaller than a {\displaystyle a} by a non-constant factor. It is also possible to merge two Fibonacci heaps in constant amortized time, improving on the logarithmic merge time of a binomial heap, and improving on binary heaps which cannot handle merges efficiently.
Using Fibonacci heaps improves the asymptotic running time of algorithms which utilize priority queues. For example, Dijkstra's algorithm and Prim's algorithm can be made to run in O ( | E | + | V | log --> | V | ) {\displaystyle O(|E|+|V|\log |V|)} time.
A Fibonacci heap is a collection of trees satisfying the minimum-heap property, that is, the key of a child is always greater than or equal to the key of the parent. This implies that the minimum key is always at the root of one of the trees. Compared with binomial heaps, the structure of a Fibonacci heap is more flexible. The trees do not have a prescribed shape and in the extreme case the heap can have every element in a separate tree. This flexibility allows some operations to be executed in a lazy manner, postponing the work for later operations. For example, merging heaps is done simply by concatenating the two lists of trees, and operation decrease key sometimes cuts a node from its parent and forms a new tree.
However, at some point order needs to be introduced to the heap to achieve the desired running time. In particular, degrees of nodes (here degree means the number of direct children) are kept quite low: every node has degree at most log --> n {\displaystyle \log n} and the size of a subtree rooted in a node of degree k {\displaystyle k} is at least F k + 2 {\displaystyle F_{k+2}} , where F i {\displaystyle F_{i}} is the i {\displaystyle i} th Fibonacci number. This is achieved by the rule: at most one child can be cut off each non-root node. When a second child is cut, the node itself needs to be cut from its parent and becomes the root of a new tree (see Proof of degree bounds, below). The number of trees is decreased in the operation delete-min, where trees are linked together.
As a result of a relaxed structure, some operations can take a long time while others are done very quickly. For the amortized running time analysis, we use the potential method, in that we pretend that very fast operations take a little bit longer than they actually do. This additional time is then later combined and subtracted from the actual running time of slow operations. The amount of time saved for later use is measured at any given moment by a potential function. The potential ϕ ϕ --> {\displaystyle \phi } of a Fibonacci heap is given by
where t {\displaystyle t} is the number of trees in the Fibonacci heap, and m {\displaystyle m} is the number of marked nodes. A node is marked if at least one of its children was cut, since this node was made a child of another node (all roots are unmarked). The amortized time for an operation is given by the sum of the actual time and c {\displaystyle c} times the difference in potential, where c is a constant (chosen to match the constant factors in the big O notation for the actual time).
Thus, the root of each tree in a heap has one unit of time stored. This unit of time can be used later to link this tree with another tree at amortized time 0. Also, each marked node has two units of time stored. One can be used to cut the node from its parent. If this happens, the node becomes a root and the second unit of time will remain stored in it as in any other root.
To allow fast deletion and concatenation, the roots of all trees are linked using a circular doubly linked list. The children of each node are also linked using such a list. For each node, we maintain its number of children and whether the node is marked.
We maintain a pointer to the root containing the minimum key, allowing O ( 1 ) {\displaystyle O(1)} access to the minimum. This pointer must be updated during the other operations, which adds only a constant time overhead.
The merge operation simply concatenates the root lists of two heaps together, and setting the minimum to be the smaller of the two heaps. This can be done in constant time, and the potential does not change, leading again to constant amortized time.
The insertion operation can be considered a special case of the merge operation, with a single node. The node is simply appended to the root list, increasing the potential by one. The amortized cost is thus still constant.
The delete-min operation does most of the work in restoring the structure of the heap. It has three phases:
Overall, the amortized time of this operation is O ( log --> n ) {\displaystyle O(\log n)} , provided that d = O ( log --> n ) {\displaystyle d=O(\log n)} . The proof of this is given in the following section.
If decreasing the key of a node x {\displaystyle x} causes it to become smaller than its parent, then it is cut from its parent, becoming a new unmarked root. If it is also less than the minimum key, then the minimum pointer is updated.
We then initiate a series of cascading cuts, starting with the parent of x {\displaystyle x} . As long as the current node is marked, it is cut from its parent and made an unmarked root. Its original parent is then considered. This process stops when we reach an unmarked node y {\displaystyle y} . If y {\displaystyle y} is not a root, it is marked. In this process we introduce some number, say k {\displaystyle k} , of new trees. Except possibly x {\displaystyle x} , each of these new trees loses its original mark. The terminating node y {\displaystyle y} may become marked. Therefore, the change in the number of marked nodes is between of − − --> k {\displaystyle -k} and − − --> k + 2 {\displaystyle -k+2} . The resulting change in potential is k + 2 ( − − --> k + 2 ) = − − --> k + 4 {\displaystyle k+2(-k+2)=-k+4} . The actual time required to perform the cutting was O ( k ) {\displaystyle O(k)} . Hence, the amortized time is O ( k ) + c ( − − --> k + 4 ) {\displaystyle O(k)+c(-k+4)} , which is constant, provided c {\displaystyle c} is sufficiently large.
The amortized performance of a Fibonacci heap depends on the degree (number of children) of any tree root being O ( log --> n ) {\displaystyle O(\log n)} , where n {\displaystyle n} is the size of the heap. Here we show that the size of the (sub)tree rooted at any node x {\displaystyle x} of degree d {\displaystyle d} in the heap must have size at least F d + 2 {\displaystyle F_{d+2}} , where F i {\displaystyle F_{i}} is the i {\displaystyle i} th Fibonacci number. The degree bound follows from this and the fact (easily proved by induction) that F d + 2 ≥ ≥ --> φ φ --> d {\displaystyle F_{d+2}\geq \varphi ^{d}} for all integers d ≥ ≥ --> 0 {\displaystyle d\geq 0} , where φ φ --> = ( 1 + 5 ) / 2 ≈ ≈ --> 1.618 {\displaystyle \varphi =(1+{\sqrt {5}})/2\approx 1.618} is the golden ratio. We then have n ≥ ≥ --> F d + 2 ≥ ≥ --> φ φ --> d {\displaystyle n\geq F_{d+2}\geq \varphi ^{d}} , and taking the log to base φ φ --> {\displaystyle \varphi } of both sides gives d ≤ ≤ --> log φ φ --> --> n {\displaystyle d\leq \log _{\varphi }n} as required.
Let x {\displaystyle x} be an arbitrary node in a Fibonacci heap, not necessarily a root. Define s i z e ( x ) {\displaystyle \mathrm {size} (x)} to be the size of the tree rooted at x {\displaystyle x} (the number of descendants of x {\displaystyle x} , including x {\displaystyle x} itself). We prove by induction on the height of x {\displaystyle x} (the length of the longest path from x {\displaystyle x} to a descendant leaf) that s i z e ( x ) ≥ ≥ --> F d + 2 {\displaystyle \mathrm {size} (x)\geq F_{d+2}} , where d {\displaystyle d} is the degree of x {\displaystyle x} .
Base case: If x {\displaystyle x} has height 0 {\displaystyle 0} , then d = 0 {\displaystyle d=0} , and s i z e ( x ) = 1 ≥ ≥ --> F 2 {\displaystyle \mathrm {size} (x)=1\geq F_{2}} .
Inductive case: Suppose x {\displaystyle x} has positive height and degree d > 0 {\displaystyle d>0} . Let y 1 , y 2 … … --> y d {\displaystyle y_{1},y_{2}\dots y_{d}} be the children of x {\displaystyle x} , indexed in order of the times they were most recently made children of x {\displaystyle x} ( y 1 {\displaystyle y_{1}} being the earliest and y d {\displaystyle y_{d}} the latest), and let c 1 , c 2 … … --> c d {\displaystyle c_{1},c_{2}\dots c_{d}} be their respective degrees.
We claim that c i ≥ ≥ --> i − − --> 2 {\displaystyle c_{i}\geq i-2} for each i {\displaystyle i} . Just before y i {\displaystyle y_{i}} was made a child of x {\displaystyle x} , y 1 … … --> y i − − --> 1 {\displaystyle y_{1}\dots y_{i-1}} were already children of x {\displaystyle x} , and so x {\displaystyle x} must have had degree at least i − − --> 1 {\displaystyle i-1} at that time. Since trees are combined only when the degrees of their roots are equal, it must have been the case that y i {\displaystyle y_{i}} also had degree at least i − − --> 1 {\displaystyle i-1} at the time when it became a child of x {\displaystyle x} . From that time to the present, y i {\displaystyle y_{i}} could have only lost at most one child (as guaranteed by the marking process), and so its current degree c i {\displaystyle c_{i}} is at least i − − --> 2 {\displaystyle i-2} . This proves the claim.
Since the heights of all the y i {\displaystyle y_{i}} are strictly less than that of x {\displaystyle x} , we can apply the inductive hypothesis to them to get s i z e ( y i ) ≥ ≥ --> F c i + 2 ≥ ≥ --> F ( i − − --> 2 ) + 2 = F i . {\displaystyle \mathrm {size} (y_{i})\geq F_{c_{i}+2}\geq F_{(i-2)+2}=F_{i}.} The nodes x {\displaystyle x} and y 1 {\displaystyle y_{1}} each contribute at least 1 to s i z e ( x ) {\displaystyle \mathrm {size} (x)} , and so we have s i z e ( x ) ≥ ≥ --> 2 + ∑ ∑ --> i = 2 d s i z e ( y i ) ≥ ≥ --> 2 + ∑ ∑ --> i = 2 d F i = 1 + ∑ ∑ --> i = 0 d F i = F d + 2 {\displaystyle {\begin{aligned}\mathrm {size} (x)&\geq 2+\sum _{i=2}^{d}\mathrm {size} (y_{i})\\&\geq 2+\sum _{i=2}^{d}F_{i}\\&=1+\sum _{i=0}^{d}F_{i}\\&=F_{d+2}\end{aligned}}} where the last step is an identity for Fibonacci numbers. This gives the desired lower bound on s i z e ( x ) {\displaystyle \mathrm {size} (x)} .
Although Fibonacci heaps look very efficient, they have the following two drawbacks:[3]
Although the total running time of a sequence of operations starting with an empty structure is bounded by the bounds given above, some (very few) operations in the sequence can take very long to complete (in particular, delete-min has linear running time in the worst case). For this reason, Fibonacci heaps and other amortized data structures may not be appropriate for real-time systems.
It is possible to create a data structure which has the same worst-case performance as the Fibonacci heap has amortized performance. One such structure, the Brodal queue,[5] is, in the words of the creator, "quite complicated" and "[not] applicable in practice." Invented in 2012, the strict Fibonacci heap[6] is a simpler (compared to Brodal's) structure with the same worst-case bounds. Despite being simpler, experiments show that in practice the strict Fibonacci heap performs slower than more complicated Brodal queue and also slower than basic Fibonacci heap.[7][8] The run-relaxed heaps of Driscoll et al. give good worst-case performance for all Fibonacci heap operations except merge.[9] Recent experimental results suggest that the Fibonacci heap is more efficient in practice than most of its later derivatives, including quake heaps, violation heaps, strict Fibonacci heaps, and rank pairing heaps, but less efficient than pairing heaps or array-based heaps.[8]
Here are time complexities[10] of various heap data structures. Function names assume a min-heap. For the meaning of "O(f)" and "Θ(f)" see Big O notation.
هل الكواكب التي تدعم الحياة, مثل الأرض, نادرة؟ في علم الفلك الكوكبي وعلم الأحياء الفلكي، تقول فرضية الأرض النادرة (بالإنجليزية: Rare Earth hypothesis) بأن الحياة متعددة الخلايا والمعقدة (الحيوانات) التي ظهرت على الأرض تحتاج إلى دمج من الظروف الفيزيائية الفلكية والجيولوجية صعبة الحد
Wim van Hoorn kan verwijzen naar: Wim van Hoorn (beeldhouwer) (1908-1979), Nederlands beeldhouwer W.C. van Hoorn, Nederlands architect Bekijk alle artikelen waarvan de titel begint met Wim van Hoorn of met Wim van Hoorn in de titel. Dit is een doorverwijspagina, bedoeld om de verschillen in betekenis of gebruik van Wim van Hoorn inzichtelijk te maken. Op deze pagina staat een uitleg van de verschillende betekenissen van Wim van Hoorn en verwijzingen daarnaartoe. Bent u h…
2. Tennis-Bundesliga (Herren) 2019 Verband Deutscher Tennis Bund Erstaustragung 2001 Mannschaften 18 (zweigleisig) ↑ 1. Tennis-Bundesliga (Herren) 2019 ↑ 2018 ◄ 2019 ► 2020 ↓ Tennis-Regionalliga (Herren) 2019 ↓ Die 2. Tennis-Bundesliga der Herren wurde 2019 zum 19. Mal ausgetragen. Die Liga ist in eine Nord- und einer Süd-Gruppe aufgeteilt. Die Austragung der Spiele erfolgte an jeweils neun Spieltagen vom 14. Juli bis 18. August 2019.[1][2] Inhaltsverz…
International cricket tour England cricket team in New Zealand in 1990-91 New Zealand EnglandDates 9 February – 16 February 1991Captains Martin Crowe Graham GoochOne Day International seriesResults New Zealand won the 3-match series 2–1Most runs Andrew Jones (145)[1] Robin Smith (138)Most wickets Chris Pringle (9)[2] Angus Fraser (5)Martin Bicknell (5) The England national cricket team toured New Zealand in February 1991 and played a three-match One Day Inte…
This article is about the men's team. For the women's team, see Vanuatu women's national basketball team. Vanuatu FIBA rankingNR (15 September 2023)[1]Joined FIBA1966FIBA zoneFIBA OceaniaNational federationVanuatu Amateur Basketball FederationCoach?FIBA Oceania ChampionshipAppearancesNonePacific GamesAppearances?MedalsNone Home Away The Vanuatu national basketball team are the basketball team that represent Vanuatu in international competitions. It is administered by the Vanuatu Amateur …
General space-related commerce This article is about general space-related commerce. For entrepreneurial space ventures and colonization, see Private spaceflight. A DIRECTV satellite dish on a roof Commercial use of space is the provision of goods or services of commercial value by using equipment sent into Earth orbit or outer space. This phenomenon – aka Space Economy (or New Space Economy) – is accelerating cross-sector innovation processes combining the most advanced space and digital te…
Alaska DOT&PF seal Government agency in Alaska, United States Alaska Department of Transportation & Public Facilities (DOT&PF)Agency overviewHeadquarters3132 Channel Drive, P.O. Box 112500, Juneau, Alaska 99811EmployeesOver 3,000 permanent full-time, part-time and non-permanent employees in 8 labor unions in 83 locations throughout the state.Agency executiveRyan Anderson, P.E., [1], CommissionerWebsitewww.dot.alaska.gov The Alaska Department of Transportation & Public Fac…
Seharum Hati IbuSutradara Awaludin Produser Abdul Madjid Ditulis oleh Pitrajaya Burnama PemeranHendra CiptaFadlyArdi HSKM Bey ErriDidu MSRE Marlinda S.Niken BasukiRahayu SukadiRina HasyimTaka ZaharaTuty KiranaDistributorEwa Raya FilmTanggal rilis1977Durasi113 menitNegara IndonesiaBahasa Indonesia Seharum Hati Ibu adalah film Indonesia yang dirilis pada tahun 1977 dengan disutradarai oleh Awaludin. Film ini dibintangi antara lain oleh Hendra Cipta dan Fadly. Sinopsis Turin (Hendra Cipta), Maslam …
JoJo Información personalNombre de nacimiento Joanna Noëlle LevesqueApodo JoJo y Jo Otros nombres “Jojo”, “Joanne”Nacimiento 20 de diciembre de 1990 (32 años)Brattleboro (Estados Unidos) Nacionalidad EstadounidenseLengua materna Inglés FamiliaPareja Freddy Adu Información profesionalOcupación Cantante, actriz, cantautora, compositora, música, actriz de televisión, modelo, actriz de cine y artista discográfica Área Composición Años activa desde 1998Seudónimo “Jojo”, …
هذه مقالة غير مراجعة. ينبغي أن يزال هذا القالب بعد أن يراجعها محرر مغاير للذي أنشأها؛ إذا لزم الأمر فيجب أن توسم المقالة بقوالب الصيانة المناسبة. يمكن أيضاً تقديم طلب لمراجعة المقالة في الصفحة المخصصة لذلك. (مارس 2020) الروبوت الترفيهي ، كما يشير الاسم، هو روبوت غير مصنوع للاست
غوستافو فيغيروا معلومات شخصية الميلاد 30 أغسطس 1978 (العمر 45 سنة)سانتا آنا الطول 1.75 م (5 قدم 9 بوصة) مركز اللعب مهاجم الجنسية الولايات المتحدة المسيرة الاحترافية1 سنوات فريق م. (هـ.) 1998–1999 إل. دي. يو. كيتو 12 (0) 2000 أوكاس 43 (9) 2001 إل. دي. يو. كيتو 17 (3) 2001–2002 ديبورتيفو إ…
Alexander García Düttmann's lecture in the Mimara Museum, 25th Music Biennale Zagreb, April 2009 Alexander García Düttmann (born 1961 in Barcelona) studied Philosophy in Frankfurt as a student of Alfred Schmidt and in Paris as a student of Jacques Derrida. Career After obtaining his PhD from Frankfurt, he spent two years at Stanford University as a Mellon Fellow. His first academic position in the UK was a lecturership in Philosophy at Essex University. Currently he is professor of Aesthetic…
Defunct roller coaster at Kings Dominion Hypersonic XLCThe launch sectionKings DominionLocationKings DominionPark sectionCandy Apple GroveCoordinates37°50′14″N 77°26′46″W / 37.837155°N 77.445974°W / 37.837155; -77.445974StatusRemovedOpening dateMarch 24, 2001Closing dateOctober 28, 2007Cost$15,000,000 USDReplaced byEl Dorado WindSeekerGeneral statisticsTypeSteel – LaunchedManufacturerS&S – Sansei TechnologiesDesignerS&S – Sansei Technologies…
史密斯威森M57Smith & Wesson Model 57 史密斯威森M657 3英吋槍管型类型左輪手槍原产地 美國生产历史研发者史密斯&威森生产商史密斯&威森单位成本建議零售價: 史密斯威森M57經典6英吋槍管型:﹩1,009.00 生产日期 史密斯威森M57:1964年— 史密斯威森M657:1979年— 衍生型 史密斯威森M657(不鏽鋼底把版本) 其他衍生型 基本规格长度 M57 4英吋槍管型:241.3毫米(9.5英寸) M57…
Servette FC Genève 1890Calcio Les Grenats Segni distintivi Uniformi di gara Casa Trasferta Colori sociali Granata Dati societari Città Ginevra Nazione Svizzera Confederazione UEFA Federazione ASF/SFV Campionato Super League Fondazione 1890 Presidente Thierry Regenass Allenatore René Weiler Stadio Stade de Genève(30.084 posti) Sito web www.servettefc.ch Palmarès Campionati svizzeri 17 Trofei nazionali 7 Coppe di Svizzera3 Coppe di Lega svizzere Trofei internazionali 4 Coppe delle Alpi …
ガラス工芸 ガラスを素材として用いた工芸品(イギリス ブリストル産)(en) 建築物の外壁に用いられているガラス ガラス(蘭: glas、英: glass)または硝子(がらす、しょうし)という語は、物質のある状態を指す場合と特定の物質の種類を指す場合がある。古称として、玻璃(はり)、瑠璃(るり)ともいう[1]。 昇温によりガラス転移現象を示す非晶質固体 …
Flowers & HorTech Ukraine (з англ. Flowers — квіти, HorTech — акронім від horticultural technology — технології садівництва) — виставка квітів формату «бізнес для бізнесу». Повна назва — Міжнародна спеціалізована виставка по квітковому бізнесу, садівництву, ландшафтному дизайну і флористиці. Зміст …
Australian TV series or program Between Two WorldsGenreDramaCreated byBevan LeeWritten byBevan LeeDirected by Kriv Stenders Lynn Hegarty Caroline Bell-Booth Beck Cole Michael Hurst Country of originAustraliaOriginal languageEnglishNo. of series1No. of episodes10[1]ProductionExecutive producerJulie McGauranProducerChris Martin-JonesRunning time60 minutesProduction companySeven StudiosOriginal releaseNetworkSeven NetworkRelease26 July (26 July 2020) –6 September 2020 …
This article includes a list of general references, but it lacks sufficient corresponding inline citations. Please help to improve this article by introducing more precise citations. (September 2016) (Learn how and when to remove this template message) Naval gun Armstrong 100-ton gun Rockbuster at Napier of Magdala Battery, GibraltarTypeNaval gunCoast defence gunPlace of originUnited KingdomService historyIn service1877-1906Production historyDesignerElswick Ordnance CompanyUnit…
1957 novel The Litmore Snatch First edition (UK)AuthorHenry WadeCountryUnited KingdomLanguageEnglishGenreDetectivePublisherConstable (UK)Macmillan Inc. (US)Publication date1957Media typePrint The Litmore Snatch is a 1957 detective thriller novel by the British writer Henry Wade.[1] It was his final novel.[2] Like much of Wade's work it takes the form of a standard police procedural. A review in The Guardian by fellow crime writer Anthony Berkeley considered the book is a qui…
Lokasi Pengunjung: 3.145.1.255