Open
Description
In some cases there will be an IndexError in the consolidate function in line 122:
A = [None] * int(math.log(self.total_nodes) * 2)
int(math.log(self.total_nodes) * 2)
is supposed to be the maximum number of distinct node degrees. This is however off by one and a bit. The node degree d is bound by where
is the golden ratio (See Wikipedia). Doing the math I got
. So the 2 needs to be replaced with something like 2.08. The number of possible distinct node degrees is one higher than this since nodes with a degree of zero need to be considered. The solution is to replace:
A = [None] * int(math.log(self.total_nodes) * 2)
with
A = [None] * int(math.log(self.total_nodes) * 2.08 + 1)
Metadata
Metadata
Assignees
Labels
No labels