Questions tagged [fibonacci-heap]

A Fibonacci heap is an implementation of a priority queue that supports amortized O(1) insertion, merge, find-min, and decrease-key, along with amortized O(log n) delete and extract-min. When implemented with a Fibonacci heap, Dijkstra's algorithm and Prim's algorithm can be made to work in O(E + V log V).

77 questions
1
vote
1 answer

Promote a node after already lost 2 or more children

In the decrease-key operation of a Fibonacci Heap, if it is allowed to lose s > 1 children before cutting a node and melding it to the root list (promote the node), does this alter the overall runtime complexity? I think there are no changes in the…
1
vote
1 answer

Implementing Consolidate in Fibonacci heap

The pseudocode from Introduction to Algorithms states: for each node w in the root list of H link trees of the same degree But how to efficiently implement the for each root node part? Original roots are linked to other roots of the same degree…
kenor
  • 1,888
  • 2
  • 16
  • 27
1
vote
1 answer

How to show Fibonacci heap with n nodes can have height n?

I want to show that a Fibonacci heap with n nodes could have height n. I tried this with examples but I don't know how to show this in general.
Rat565
  • 91
  • 2
  • 4
1
vote
1 answer

Fibonacci heaps: Insertion, Extract-Min, and Performance?

I was trying to learn about fibonacci heaps, the pseudocode for inserting an element in the heap was: Fibonacci-Heap-Insert(H,x) degree[x] := 0 p[x] := NIL child[x] := NIL left[x] := x right[x] := x mark[x] := FALSE concatenate the root list…
2147483647
  • 1,177
  • 3
  • 13
  • 33
0
votes
1 answer

How to insert an element to a Fibonacci tree?

Q. How would you insert an element to a Fibonacci tree. I was thinking, because fibonacci trees are like sorted tree. I have to either balance the right tree or the left tree. but how?
user1110749
  • 37
  • 1
  • 5
0
votes
0 answers

Amortized time complexity: DecreaseKey() in Fibonacci Heap

At Wikipedia we can find a description of DecreaseKey(). From my point of view, if we perform the operation of cutting the nodes or remarking them, it may take linear time complexity, depending on the height of the tree from which we are cutting…
0
votes
0 answers

Assert removed/popped elements are not updated fibonacci heap boost

I'm using Boost's Fibonacci heap in my code, and I noticed online it's possible to update an erased/popped element using it's handle: Why can I update a popped out element in a boost::fibonacci_heap? I have a class wrapping the fib heap and has it's…
Wolf
  • 77
  • 8
0
votes
1 answer

Amortized Analysis of Fibonacci Heap with Potential Method

I'm trying to do an amortized analysis of a fibonacci heap using the potential method. I'm struggling with understanding the analysis of the pop min / delete min operation. In tutorials I can find for bounding the amortized complexity of the "pop…
0
votes
1 answer

Why is B+-tree preferred over fibonacci heap in database-system implementation?

Is there a particular reason the B+-tree is preferred, when implementing a larger scale database-system, over the Fibonacci heap? From the complexity analysis in the image it would seem that Fibonacci heap is faster.
Jan Koten
  • 13
  • 2
0
votes
1 answer

Implementation of the consolidate method of fibonacci heap in java, an error of IndexofBoundsException

I'm trying to do a fibonacci heap, and I don't understand why I get an "indexofboundsException" error in the consolidate method, I implement it just like geek_for_geeks, although it is in C language, I am doing it in java, and it should work :(. As…
matt
  • 29
  • 6
0
votes
2 answers

Finding last digit of sum from m to n Fibonacci numbers. (0 ≤ ≤ ≤ 10^14)

My code is as follow : m, n = map(int, input().split()) # write function "fibtotal" which takes input x and gives accurate fib(x+2)%10 (as sum till fib(x) == fib(x+2) - 1) # using above function get fibtotal(m-1) and fibtotal(n) # subtract…
hack3r-0m
  • 700
  • 6
  • 20
0
votes
1 answer

Fibonacci Heap Extract Min Implementation Not Working

I am implementing Fibonacci Heap to improve on my Dijkstra's shortest path algorithm. My insert method works fine, and the next one I needed to do is extract-min. I am following CLRS. Please note some attributes mentioned in the book aren't in my…
Higigig
  • 1,175
  • 1
  • 13
  • 25
0
votes
1 answer

boost::fibonacci_heap: Nested define of handle with comparator redefined circular definition errors

Boost documentation and previous stack overflow both give working examples of how to define custom comparator functions and include handle in the node type of a boost heap. However when I combine both of these features (a custom defined compare…
kdmarrett
  • 43
  • 3
0
votes
0 answers

How to reduce time complexity of MST using fibonacci heap's union operation?

I am searching for linear time complexity of MST. I am trying to proceed this using Fibonacci heap as its union and find minimum operation takes constant time. Is possibly there any link to reduce time complexity of MST? Please help.
0
votes
1 answer

Prim's algorithm with Fibonacci heap: why O(E + V*log(V))?

I know Prim's algorithm and how to implement it. I am also aware of why its time complexity is O(E + V log(V)). We add edges E times (that is in O(E)) and choose minimum V times (that is O(V*log(V)). But I don't understand a part of it: Why V…