473,395 Members | 1,484 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

STL for Fibonacci Heap??

What is the correct STL libraries to implement in order to have a Fibonacci
Heap created?

I am creating an algorithm which would use a Fibonacci Heap.

Thanks,

Lance
Jul 22 '05 #1
5 9698

"Lance" <La***@nospam.com> wrote in message
news:2c******************************@news.teranew s.com...
What is the correct STL libraries to implement in order to have a Fibonacci Heap created?

I am creating an algorithm which would use a Fibonacci Heap.

Thanks,

Lance


I can't think of any exceptions to the statement that the C++ Standard does
not mandate a particular implementation for any of the STL containers except
for stating that the elements in a vector<> must be stored contiguously
(what it *does* mandate is performance requirements). I'm sure others will
correct me if I'm wrong about this, but I think the only way you're going to
get a Fibonacci heap for sure in Standard C++ is if you implement it
yourself...
Jul 22 '05 #2

"Dave" <be***********@yahoo.com> wrote in message
news:vs************@news.supernews.com...

"Lance" <La***@nospam.com> wrote in message
news:2c******************************@news.teranew s.com...
What is the correct STL libraries to implement in order to have a Fibonacci
Heap created?

I am creating an algorithm which would use a Fibonacci Heap.


There is no such thing as a correct STL library - in principle the former
STL has been included and is now the C++ standard library
shipped with every recent compiler. If you mean that there is such a thing
as a Fibonacci Heap included in the C++ library I'll have to disappoint you.
It's up to you to do the implementation.

[SNIP]
I can't think of any exceptions to the statement that the C++ Standard does not mandate a particular implementation for any of the STL containers except for stating that the elements in a vector<> must be stored contiguously
(what it *does* mandate is performance requirements).

[SNIP]

This statement is not entirely true in this form. The standard does not make
statements about the details of the container implementations but there are
further requirements specified that go beyond performance. For example the
iterator access is specified for the containers, some points regarding the
requirements on the contained types and further requirement regarding e.g.
associative containers are given (I think there is no point in listing this
stuff here).

Regards
Chris


Jul 22 '05 #3
"Lance" <La***@nospam.com> wrote:
What is the correct STL libraries to implement in order to have a Fibonacci
Heap created?

I am creating an algorithm which would use a Fibonacci Heap.


The standard library has some heap algorithms, and a priority_queue
adapter, but they don't mandate the interal structure of the heap,
just a few operations. IIRC, "union" operations are not amoung these,
so it is probably going to be a binary heap in any implementation.

FWIW, I have never seen anyone use a Fibonacci Heap... not even in a
homework. Supposedly, there is a Perl library that implements them,
but that is the only one I've ever heard of.

--
Dave O'Hearn
Jul 22 '05 #4
"Lance" <La***@nospam.com> wrote:
What is the correct STL libraries to implement in order to have a Fibonacci
Heap created?

I am creating an algorithm which would use a Fibonacci Heap.


I don't really understand your question: as is, it does not make much
sense... My guess is that you want to know where to get a library from
which includes a Fibonacci heap and integrates well with the standard
C++ library. If this is indeed your question, you can download
<http://www.dietmar-kuehl.de/cxxrt/heaps.tar.gz>. This archive contains
a bunch of different heap implementations with a common interfaces.
Several of the heaps support changes of the "key".
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
Phaidros eaSE - Easy Software Engineering: <http://www.phaidros.com/>
Jul 22 '05 #5
da******@pobox.com (Dave O'Hearn) wrote:
FWIW, I have never seen anyone use a Fibonacci Heap... not even in a
homework.


First off, I have seen it used, eg. by myself in shortest path algorithms:
it is the canonical data structure for things like Dijkstra's algorithm
although there are approaches to avoid it (although at the cost of a
higher complexity).

In general, there are two reasons why people don't use Fibonacci Heaps:

1. The data structure is assumed to be relatively hard to implement and
there are alternatives which are assumed to be easier to implement.
2. The theoretical advantage of Fibonacci Heaps is assumed to pay off
only for very large data sets due to inherently bigger constants.

Both assumptions are wrong. The second is, however, not that unreasonable:
it takes quite some tuning the implementation to make them reasonably fast
for reasonably sized data sets. ... and, indeed, the pay off (O(n) rather
than O(n lg n) complexity for some operations) kicks in only with fairly
large data sets.

BTW, you can download an implementation of several different heaps,
including a Fibonacci Heap implementation, from
<http://www.dietmar-kuehl.de/cxxrt/heaps.tar.gz>.
--
<mailto:di***********@yahoo.com> <http://www.dietmar-kuehl.de/>
Phaidros eaSE - Easy Software Engineering: <http://www.phaidros.com/>
Jul 22 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

28
by: dleecurt | last post by:
Hello, I have a small problem, I am trying to write a program that will calculate the Fibonacci number series, and I have the code complete with one problem. I used a long in to store the numbers,...
0
by: Alex Vinokur | last post by:
An algorithm which computes very long Fibonacci numbers http://groups.google.com/groups?selm=bnni5p%2412i47o%241%40ID-79865.news.uni-berlin.de was used as a performance testsuite to compare speed...
5
by: Niks | last post by:
Can anybody explain me what is a "Fibonacci search"? even an URL will do. Thanks for reading.
4
by: YS Sze | last post by:
If you know the exact longitude and latitude for a specific location, would anyone think it'd make any sense to find out if this set of location numbers is really part of the Fibonacci series or...
12
by: CII | last post by:
Hi everybody. I've been reading posts a year old about the fibonacci series right on this newsgroup, and while it's not directly games related, I'll share my own notes as well. On another...
14
by: felixnielsen | last post by:
Im actually kinda embarassed to ask this question... @code start #include <iostream> int main() { unsigned long long a = 1; unsigned long long b = 1; for (int i = 0; i < 45; i++) { a += b;...
3
by: greek | last post by:
Hi! I hav to generate fibonaaci series using recursion: 0,1,1,2,3,5,8,18,21... whr fibonacci(0)=0 fibonacci(1)=1 fibonacci(n)=fibonacci(n-1)+fibonacci(n-2) ive witten the code but having 2...
13
by: mac | last post by:
Hi, I'm trying to write a fibonacci recursive function that will return the fibonacci string separated by comma. The problem sounds like this: ------------- Write a recursive function that...
0
by: not_a_commie | last post by:
I'm looking for C# (or Java) code or libraries for the following structures: Fibonacci Heap 2-3 Heap Trinomial Heap Extended Trinomial Heap I've been attempting to translate C code into C#...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.