Added assessment of ancestor pointers to optimization_ideas.txt
This adds my assessment of the performance of the ancestor pointers optimization in practice to optimization_ideas.txt.
This commit is contained in:
@@ -27,8 +27,9 @@ Thoughts concerning optimization:
|
||||
a node's parent, we have to change the pointers for all of the descendants
|
||||
that are less than k levels below the node - up to 2^k - 1 nodes. Since there
|
||||
are O(log N) parent pointer changes per update, and updates already take
|
||||
O(log^2 N) amortized time, we can afford a k value of up to lg lg N + c (but
|
||||
interestingly, not O(log log N)).
|
||||
O(log^2 N) amortized time, we can afford a k value of up to lg lg N + O(1)
|
||||
(but interestingly, not O(log log N)). However, I think this would be
|
||||
significantly slower than a B-tree in practice.
|
||||
- If I don't implement the B-tree optimization, there are a couple of small
|
||||
optimizations I could try. First, I could move the field
|
||||
EulerTourNode.augmentationFunc to EulerTourVertex, in order to save a little
|
||||
|
||||
@@ -39,8 +39,8 @@ import java.util.Map;
|
||||
* take O(log N) time rather than O(log N / log log N) time.
|
||||
*
|
||||
* This implementation is actually based on a slightly modified description of the data structure given in
|
||||
* http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-851-advanced-data-structures-spring-2012/lecture-videos/session-20-dynamic-graphs-ii/ .
|
||||
* The description in the video differs from the data structure in the paper in that the levels are numbered in reverse
|
||||
* https://ocw.mit.edu/courses/6-851-advanced-data-structures-spring-2012/resources/session-20-dynamic-graphs-ii/ . The
|
||||
* description in the video differs from the data structure in the paper in that the levels are numbered in reverse
|
||||
* order, the constraint on tree sizes is different, and the augmentation uses booleans in place of edges. In addition,
|
||||
* the video defines subgraphs G_i. The change in the constraint on tree sizes is beneficial because it makes it easier
|
||||
* to delete vertices.
|
||||
|
||||
Reference in New Issue
Block a user