Overlap-free Drawing of Generalized Pythagoras Trees for Hierarchy Visualization
Generalized Pythagoras trees were developed for visualizing hierarchical data, producing organic, fractal-like representations. However, the drawback of the original layout algorithm is visual overlap of tree branches. To avoid such overlap, we introduce an adapted drawing algorithm using ellipses instead of circles to recursively place tree nodes representing the subhierarchies. Our technique is demonstrated by resolving overlap in diverse real-world and generated datasets, while comparing the results to the original approach.
💡 Research Summary
The paper addresses a fundamental limitation of generalized Pythagoras trees (GPT), a hierarchy‑visualization technique that produces organic, fractal‑like drawings by recursively placing squares on top of each other. While GPT creates aesthetically appealing layouts, the original algorithm often yields overlapping branches, which severely hampers readability, especially for large or deep hierarchies.
To eliminate overlap without discarding information or drastically shrinking nodes, the authors propose two complementary innovations. First, they replace the semicircular arc used for positioning child squares with a semi‑ellipse defined by the equation x²/a² + y²/b² = 1. The semi‑axis a remains fixed (a = 1 for a unit circle), while the vertical semi‑axis b can be increased or decreased. Enlarging b makes the ellipse taller, pushing sub‑trees apart; shrinking b flattens the ellipse, pulling sub‑trees together. This geometric flexibility allows the layout to adapt locally to congestion while preserving the overall tree‑like appearance.
Second, the authors introduce a force‑directed refinement process that iteratively adjusts the b‑parameter based on detected overlaps. Overlap detection is accelerated by storing all node bounding boxes in a quadtree; a window query on each rectangle returns candidate intersecting rectangles in O(d + k) time (d = quadtree depth, k = number of candidates), far faster than naïve O(n) checks. When an overlap between nodes u and v is found, the algorithm identifies their lowest common ancestor z. A “spread” counter on z is incremented, while a “narrow” counter is incremented on every node along the paths from u and v up to z. After all overlaps are catalogued, each node is examined: if spread > narrow, a push force increases b by 10 % (capped at the golden ratio φ ≈ 1.618); if narrow > spread, a pull force decreases b by 10 %; otherwise a neutral force nudges b back toward 1, scaled by a learning‑rate term that decays over iterations. These three forces are applied repeatedly until no overlaps remain. The algorithm’s pseudocode (Algorithm 1) details the update loop, and supplementary material provides a complexity analysis.
The authors evaluate the method on three categories of data.
- NCBI Taxonomy – a real‑world hierarchy with 324 269 nodes and 51 930 initial collisions. After 155 iterations the layout becomes completely overlap‑free; the overall silhouette of the tree is preserved, though the drawing expands in size. A log‑scale plot of collisions versus iteration shows a clear negative exponential decay (R² ≈ 0.98). An alternative experiment limiting node height (height = min(original height, width)) yields a similar convergence speed but produces a more compact shape at the cost of deviating from the original fractal geometry.
- File‑System Hierarchy – 30 859 nodes representing a software project’s directory tree, initially containing 8 483 collisions. Full resolution required 164 iterations, again expanding the drawing modestly. In densely packed sub‑trees the b‑parameter approaches zero, causing the layout to resemble an icicle plot, which the authors note as a limitation when many nodes are stacked vertically.
- Synthetic Hierarchies – a suite of generated trees (binary, deep, flat, symmetric, self‑similar). Visual inspection confirms that after overlap removal the characteristic relationships (children arranged along a curved contour) remain recognizable, though the exact “fingerprint” of some trees (e.g., binary) changes more dramatically than others (self‑similar). Readability improves across the board: branches become visually separable, and depth cues (color gradients) are easier to follow.
The discussion acknowledges that a precise analytical relationship between input size, initial overlap density, and required iterations remains elusive; empirical results consistently show a roughly exponential decline in collisions. Termination is observed in all test cases, but a formal proof is left for future work. The authors also point out that the method may inflate the overall area and can produce very flat structures for extremely shallow hierarchies, potentially reducing aesthetic appeal.
In conclusion, the paper presents a practical, geometry‑aware, force‑directed algorithm that successfully eliminates branch overlap in generalized Pythagoras trees while preserving their organic visual identity. By allowing selective deformation of the underlying ellipse, the approach balances the need for readability with the desire to maintain the fractal‑like aesthetic that makes GPT attractive for large‑scale hierarchy visualization. Future directions include formal convergence analysis, adaptive constraints to prevent excessive flattening, and integration with interactive exploration tools.
Comments & Academic Discussion
Loading comments...
Leave a Comment