330 likes | 336 Views
Explore area requirements of orthogonal drawings for ternary trees, from simple recursion to complex strategies for area minimization. Research includes binary and ternary tree drawing areas optimization.
E N D
On the Area Requirements of Straight-Line OrthogonalDrawings of Ternary Trees Roma Tre University, Rome, Italy Barbara Covella, Fabrizio Frati, and Maurizio Patrignani
Orthogonal drawings • We consider orthogonal drawings of graphs • each edge is a sequence of axis-parallel segments • Drawings are planar • We always assume that the maximum degree of the nodes is four bend bend
Computing orthogonal drawings • Minimizing the number of bends in an orthogonal drawing of a planar graph with a fixed combinatorial embedding can be done in polynomial time • [Tamassia, 87] • If one is allowed to change the embedding (as we always assume in this paper) then bend minimization is NP-hard • [Garg & Tamassia, 01]
height = 4 width = 3 Orthogonal drawings of trees • A tree always admits an orthogonal drawing without bends • Hence, the research focuses on area requirements • the width (height) of a drawing is the numberof vertical (horizontal) grid lines touched by the drawing • the area of the drawingis width height area = 12
Binary trees and drawing area • General binary trees • O(n log log n) area bound • [Chan et al., 02][Shin et al., 00] • recently improved to n2O(log* n) • where log* n denotes iterated logarithm • result due to [Chan, 18] • Complete binary trees • O(n) area • [Shiloach 76][Crescenzi et al., 92] root
Ternary trees and drawing area • In this paper we address ternary trees • Area bounds for general ternary trees • O(n1.631) area • [Frati 08] • O(n1.576) area root this paper
Drawing invariant • All our drawings will respect the top-visibility property • the vertical half-line emanating from the root of a (sub)tree T and directed upwards does not intersect the drawing of T root
Top-visibility property and recursion • The top visibility property allows us to exploit recursion
Top-visibility property and recursion • The top visibility property allows us to exploit recursion • recursively draw the three subtrees of a node v
Top-visibility property and recursion • The top visibility property allows us to exploit recursion • recursively draw the three subtrees of a node v • arrange the threedrawings around vpreserving thetop-visibility property
General ternary trees • A node v may have three subtrees of very different sizes • Based on the number of the nodes that they contain, the three subtrees of v are denoted by Lv (large) Mv (medium), and Sv (small) • ties are arbitrarily broken Mvmedium subtree Svsmall subtree v Lvlarge subtree
Simple recursion strategies? • Unfortunately, it is not easy to devise an area-efficient drawing strategy based on recursively arranging the drawings of these subtrees v Lv Mv Sv v Lv Mv Sv
A complex recursion strategy • A heavy-pathis a path starting from the root of T and recursively descending into the largest subtree • A heavy-path has only medium and small subtrees attached to it
A complex recursion strategy • Exploiting heavy-paths [Frati, 08] achieved O(n1.631) area L M S • Denote by W(n) and H(n) the maximum width and the maximum height of the drawing of a tree with n nodes, respectively
W(n) O(n) H(n) A complex recursion strategy • W(n) trivially belongs to O(n) • H(n) = H(na)+H(nb)+1 • where na and nb are the sizes of the largest subtrees above and below the heavy-paths, respectively • [Frati, 08] proved • na+nb ≤ 2n/3 and hence H(n) ≤ n0.631
Worst case for [Frati, 08] • The worst case is when you have a very sparse tree until you reach a “balanced” node that is the root of three subtrees of the same size n/3 nodes H(n) O(1) nodes n/3 nodes n/3 nodes • In this case you have • na+nb 2n/3 • H(n) = n0.631
x A more complex recursion strategy • Node x is the first node that has two subtrees with at least n/p nodes • p is a parameter to be determined later • if x does not exists or if it is at distance less than two from the root we treat the configuration as a special case
x A more complex recursion strategy • Node x is the first node that has two subtrees with at least n/p nodes • p is a parameter to be determined later • if x does not exists or if it is at distance less than two from the root we treat the configuration as a special case
A more complex recursion strategy • Again, W(n) trivially belongs to O(n) W(n) O(n) • Regarding H(n) we show that • H(n) 2 nc - 1 where • Setting p = 9.956 we obtain • H(n) O(n0.576)
General ternary trees Theorem 1 Every n-node ternary tree admits a planar straight-line orthogonal drawing in O(n1.576) area
Complete ternary trees: drawing area • O(n1.262) area • [Frati, 08] • Recently improved to O(n1.118) area • [Ali, 15] • We explore the area requirements of drawings that satisfy the “subtree separation property”
Subtree separation property • We say that a drawing of a tree has the subtree separation property whenever the bounding boxes of any two disjoint subtrees do not overlap • either of these two constructions preserve the subtree separation property and achieve O(n1.262) area [Frati, 08]
No subtree separation property • In the following drawing the subtree separation property is not satisfied • construction used by [Ali, 15] achieving O(n1.118) area
Our results for complete trees • If the subtree separation property is enforced • we show an O(n1.149) area upper bound for complete ternary trees • we present a polynomial-time algorithm to produce optimal area drawings • we conjecture a superlinear lower bound for complete ternary trees
1-2 Drawings • A 1-2 drawing of a ternary tree is inductively defined as an arrangement of the (not necessarily congruent) 1-2 drawings of its three subtrees according to one of these two configurations Configuration 1 Configuration 2 • observe that 1-2 drawings trivially satisfy the subtree separation property
1-2 Drawings and subtree separation Theorem 2 For any complete ternary tree, one of its planar orthogonal drawings achieving minumum area and satisfying the subtree separation property is a 1-2 drawing • Consequence • if you enforce the subtree separation property restricting to 1-2 drawings is not a limitation!
1-2 drawings of complete ternary trees Theorem 3 A complete ternary tree admits a 1-2 drawing in O(n1.149) area • construction used • observe that the subtree separation property is satisfied
Polynomial-time algorithm • We devised a polynomial-time algorithm to compute optimal-area drawings of complete ternary trees • We computed optimal-area drawings up to depth 20 • 5 days computation on an Ubuntu linux box with two 4-core 3.16 GHz CPU and 48 GB RAM
Function fitting and conjecture • According to the least squares optimization method, a function in the form f(n) = a·nb + c that better fits the computed values of the minimum area has • a = 3.3262 • b = 1.047 • c = -181,209.1337 Conjecture 1 There exists a constant ε > 0 such that n-node complete ternary trees require Ω(n1+ε) area in any planar straight-line orthogonal drawing satisfying the subtree separation property
Open problems • General ternary trees • Do they admit drawings in near-linear area? • Complete ternary trees • Do they admit drawings (not necessarily complying with the subtree separation property) in near-linear area? • Improve the bound of O(n1.149) area on drawings satisfying the subtree separation property • Prove/disprove conjecture
Questions? Questions? A minimum area drawing of a complete ternary tree of depth eight
Questions? Questions? A minumum area drawing of a complete ternary tree of depth six