Number of trees in a Fibonacci Heap without CASCADING-CUT

  • Context: Comp Sci 
  • Thread starter Thread starter CGandC
  • Start date Start date
  • Tags Tags
    Algorithm Trees
Click For Summary

Discussion Overview

The discussion revolves around determining the maximum number of trees in a Fibonacci heap when the DECREASE-KEY operation is implemented without CASCADING-CUT. Participants explore the implications of the CONSOLIDATE operation and the relationship between the number of nodes and the number of trees, focusing on theoretical bounds and mathematical expressions.

Discussion Character

  • Exploratory
  • Mathematical reasoning
  • Debate/contested

Main Points Raised

  • One participant suggests that the maximum number of trees occurs when all trees are of the smallest order, leading to an upper bound of ##O(\sqrt{n})## for the number of trees.
  • Another participant questions the validity of the sum used to derive the upper bound, indicating that it may lead to an ##O(n^2)## result instead.
  • There is a proposal to redefine variables to clarify the relationship between total nodes and trees, suggesting that the sum should represent the minimal number of nodes across all trees.
  • Participants discuss the implications of the CONSOLIDATE operation, with one asserting that it would yield at most ##O(\log(n))## trees, while another argues for a potential upper bound of ##O(\sqrt{n})##.
  • Several participants engage in deriving expressions for the minimum number of nodes in trees of varying orders, leading to a mathematical formulation involving the sum of integers.
  • A later reply emphasizes the importance of correctly expressing the relationship between the number of trees and nodes, ultimately leading to a conclusion about the big-O notation for the number of trees.

Areas of Agreement / Disagreement

Participants express differing views on the correct upper bound for the number of trees, with some arguing for ##O(\sqrt{n})## and others suggesting that earlier calculations may lead to ##O(n^2)##. The discussion remains unresolved regarding the precise implications of the mathematical expressions used.

Contextual Notes

There are limitations in the assumptions made regarding the relationships between the number of nodes and trees, as well as the definitions of the variables involved in the calculations. The discussion reflects an ongoing exploration of these concepts without reaching a definitive conclusion.

CGandC
Messages
326
Reaction score
34
Homework Statement
The question relates to Fibonacci heaps. Suppose DECRASE-KEY was implemented without CASCADING-CUT.
Prove that after CONSOLIDATE operation on the Fibonacci heap, the amount of trees in the heap is at most ## O( \sqrt{n} ) ##.
Relevant Equations
( The question is in the context of the section about Fibonacci heaps from 2nd edition of CLRS )
--- ##n## refers to the amount of nodes in the Fibonacci heap.
--- order of a tree in heaps is defined as the number of children of a root.
--- In a different exercise I showed that the minimal amount of nodes in a tree ( from Fibonacci heap in which DECREASE-KEY is implemented without CASCADING-CUT ) of order ##k## is ##k+1##.
I know that the maximum number of trees in a heap will be when all the trees are of smallest order as possible. Then, after performing CONSOLIDATE operation on the heap, all the newly created trees in the heap will be of different orders. Since in a different exercise I showed that the minimal amount of nodes in a tree ( from Fibonacci heap in which DECREASE-KEY is implemented without CASCADING-CUT ) of order ##k## is ##k+1##, thus, we can sum the nodes from all the minimal trees, bound them by ##n## and get an upper-bound of ## O( \sqrt{n} ) ## for the number of trees.

The above attempt is not necessarily correct and has logical gaps. My main trouble is that the sum ## \sum_{k=1}^{k=n} k+1 ## will give me an upper bound of ##O(n^2)## and not of ##O(\sqrt{n})##. In any-case I'm stuck and I'd really appreciate help, I have no idea how to proceed and I feel like I've been brooding for too-long on this problem.
 
Physics news on Phys.org
CGandC said:
My main trouble is that the sum ## \sum_{k=1}^{k=n} k+1 ## will give me an upper bound of ##O(n^2)## and not of ##O(\sqrt{n})##.
That is not a problem. It may help if you use ## N ## to represent the total number of nodes and ## T ## the total number of trees. What limit are you summing to with this notation? What does the sum represent?
 
The sum was supposed to represent the minimal amount of nodes in all trees. Suppose this sum was ## S ##, after the CONSOLIDATE operation, I'd have at most ##O( log(n) )## trees in the Fibonacci heap.
Now, I think If I were to get an upper-bound of ## O(\sqrt{n}) ## on the number of trees, I'd need to have about ## 2^\sqrt{n} ## nodes, because only in such case I'd have ##T = log(2^\sqrt{n}) = \sqrt{n} ## trees, so I think the answers lies in this. But on the other hand, the analysis I did does not relate to the sum ## S ##, so I am perplexed right now..
 
Please write the sum again as ## \sum_{k=1}^X k+1 ## (which we know is ## \frac{X^2 + 3X}2 ##). Now write ## Y = \sum_{k=1}^X k+1 = \frac{X^2 + 3X}2 ##. What do you think ## X \text{ and } Y ## are here? What is it that is equal to ## k + 1 ## for each something that has something equal to ## k ##?
 
Last edited:
CGandC said:
The sum was supposed to represent the minimal amount of nodes in all trees. Suppose this sum was ## S ##, after the CONSOLIDATE operation, I'd have at most ##O( log(n) )## trees in the Fibonacci heap.
No you wouldn't, you are about to prove that you would have at most ##O( \sqrt n )## trees.
 
Actually let's start this from scratch: write down an expression for the minimum number of nodes in a tree of depth ## k ##.
 
For the trees in the Fibonacci heap, the minimum number of nodes in a tree of order ## k ## is ## k + 1 ##. How do I proceed to use this fact together with the fact that after performing CONSOLIDATE operation on all the trees, each tree created in the new heap will be of different order?
 
If you have ## T_0 ## trees what is the minimum number of nodes they will cover? What will be the order of these trees? If after consolidation you have the maximum number of trees left, and this number is ## T ## write down a list of the orders of the trees.
 
(actually you were nearly there a few posts ago, I'll try from there)

CGandC said:
The sum was supposed to represent the minimal amount of nodes in all trees.
Exactly. So write down an expression for the minimal number ## N ## of nodes in ## T ## trees (after consolidation).
 
Last edited:
  • #10
Like this?:

Let ## Tree_1, ... ,Tree_T ## denote the trees after consolidating.
## Tree_1 ## will have at-least 1 node ( ## Tree_1 ## must be of at-least order ##0## )
## Tree_2 ## will have at-least 2 node ( ## Tree_2 ## must be of at-least order ##1## )
.
.
.
## Tree_T ## will have at-least T nodes ( ## Tree_T ## must be of at-least order ##T-1## )

the number of their nodes will satisfy ## \sum_{k=1}^{T} k \leq n \longrightarrow \frac{T^2}{2} \leq \sum_{k=1}^{T} k = \frac{T(T+1)}{2} \leq n \longrightarrow T^2 \leq 2n \longrightarrow T \leq \sqrt{2}\sqrt{n} ##

Edit:
It should be ## \sum_{k=1}^{T} k = \frac{T(T+1)}{2} = n ## and from here ## \frac{T^2}{2} \leq n ##
 
  • Like
Likes   Reactions: pbuk
  • #11
CGandC said:
It should be ## \sum_{k=1}^{T} k = \frac{T(T+1)}{2} = n ## and from here ## \frac{T^2}{2} \leq n ##
Well it's actually ## \frac{T^2 + T}{2} \leq n ## but as we are only interested in big-O let's write (with a bit of short-circuiting) ## T^2 = \mathcal O (N) ##.

So from this, ## T = \mathcal O(?) ##
 
  • Like
Likes   Reactions: CGandC
  • #12
## \mathcal O(T) = O(\sqrt{N}) ## !
Thanks a lot! I was vacillating on this problem for lots of hours, but I feel like I learned a lot about fibonacci heaps.
 
  • Like
Likes   Reactions: pbuk

Similar threads

  • · Replies 1 ·
Replies
1
Views
3K
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
Replies
1
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
6K