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

Are all trees in Fibonacci heaps binomial trees?

Is it possible for a Fibonacci heap to contain a tree that isn't a binomial tree? If so, how would this happen? Can you give an example?
weeb
  • 1,939
  • 4
  • 18
  • 29
1
vote
0 answers

extract Min function is not working properly

I got an assignment but I'm stuck in the titled problem. It will be very glad that you will help me to solve this. The quick over review I have provided the classes and main file for which I have to implemented the function and run the code. There…
1
vote
1 answer

Clear mark attribute of a node in extract-min operation of Fibonacci Heap

In the DECREASE-KEY operation of Fibonacci Heap, whenever a node is cut from its parent and added to the root list, its mark attribute is set to FALSE. However, in the EXTRACT-MIN operation, the children of the min-node are added to the root list…
Preetom Saha Arko
  • 2,588
  • 4
  • 21
  • 37
1
vote
1 answer

CLRS's Fibonacci Heap size(x) analysis has a flaw?

In CLRS's Introduction to Algorithms 3rd edition P.525, when it analyzes the size(x)'s lower bound, there is a sentence that I quote as "because adding children to a node cannot decrease the node’s size, the value of Sk increases monotonically with…
jscoot
  • 2,019
  • 3
  • 24
  • 27
1
vote
1 answer

Problem with Boost Fibonacci Heap at the moment of erasing an element

I'm getting an unrelated error with Boost's Fibonacci Heap when I use the erase()method: astar: /usr/include/boost/intrusive/list.hpp:1266: static boost::intrusive::list_impl::iterator…
stroncod
  • 33
  • 7
1
vote
2 answers

Pell heap,just like Fibonacci heap

Is there any heap based on Pell sequence(or Pell number) instead of Fibonacci number(like the Fibonacci heap)?
huyichen
  • 113
  • 1
  • 4
1
vote
1 answer

Computing directly nth Fibonacci term without finding previous terms using binet's formula. (in O(1) time)

from math import sqrt n = int(input()) phi = (1 + sqrt(5))/2 fib_n = round((phi**n)) print(fib_n) The above-mentioned code is not correct, it gives some nearer value to fib_n. from math import sqrt n = int(input()) phi = (1 + sqrt(5))/2 fib_n…
hack3r-0m
  • 700
  • 6
  • 20
1
vote
1 answer

Min Fibonacci Heap - How to implement increase-key operation?

I have been trying to implementing heap data structures for use in my research work. As part of that, I am trying to implement increase-key operations for min-heaps. I know that min-heaps generally support decrease-key. I was able to write the…
1
vote
1 answer

Original design of DecreaseKey of Fibonacci heaps in Fredman and Tarjan's paper

I am now implementing the Fibonacci heap according to the original Paper of Fredman and Tarjan. If I understand it correctly, according to the paper, to perform the DecreseKey operation of a node x, we simply cut it from its parent. But if the key…
Snjór
  • 61
  • 7
1
vote
1 answer

Using Existing Fibonacci Heap Java Implementation with Dijkstra's Shortest Path Java Implementation

Using java programming language, I am trying to implement the most efficient shortest path algorithm on a graph with positive edge cost. To the best of my knowledge, that would be Dijkstra's algorithm with a Fibonacci Heap as the priority Queue. I…
Traveling Salesman
  • 2,209
  • 11
  • 46
  • 83
1
vote
1 answer

Decrease operation in fibonacci heap, boost

I'm trying to use in my implementation the fibonacci heap from boost but my program crashes, when I calling decrease function, this the example (W is a simple class): struct heap_data { boost::heap::fibonacci_heap::handle_type…
Vincenty
  • 11
  • 2
1
vote
1 answer

Dijkstra’s algorithm with a Fibonacci heap

I am trying to implement Dijkstra's algorithm for finding the shortest paths between nodes using Fibonacci Heap with Adjacency List representation for the graph. According to the algorithm I know, we have to find the minimum node in the Heap and…
LoL
  • 41
  • 5
1
vote
2 answers

How to improve Boost Fibonacci Heap performance

I am implementing the Fast Marching algorithm, which is some kind of continuous Dijkstra. As I read in many papers, the Fibonacci heap is the most adequate heap for this purpose. However, when profiling with callgrind my code I see that the…
Javi
  • 3,440
  • 5
  • 29
  • 43
1
vote
1 answer

Why does Fibonacci heap keep a global node counter?

I read that Fibonacci heap keeps a global node counter, but I can't see why. I even found an implementation that had the counter but didn't use it at all.
user267817
1
vote
1 answer

How to implement decrease-key in a Fibonacci heap to run in O(1) amortized time?

How can you get O(1) amortized complexity in the decrease-key operation on a Fibonacci heap? Just finding the node in the Fibonacci heap that contains the element takes O(n) time using a BFS, which should make it impossible to get O(1) amortized…
Rohit Garg
  • 115
  • 2
  • 10