Drawing non-layered tidy trees in linear time
Article first published online: 19 JUL 2013
Copyright © 2013 John Wiley & Sons, Ltd.
Software: Practice and Experience
Volume 44, Issue 12, pages 1467–1484, December 2014
How to Cite
2014), Drawing non-layered tidy trees in linear time, Softw. Pract. Exper., 44, pages 1467–1484, doi: 10.1002/spe.2213(
- Issue published online: 5 NOV 2014
- Article first published online: 19 JUL 2013
- Manuscript Accepted: 20 JUN 2013
- Manuscript Revised: 13 JUN 2013
- Manuscript Received: 17 JAN 2013
- tree drawing;
- complexity proof;
- Reingold–Tilford algorithm
The well-known Reingold–Tilford algorithm produces tidy-layered drawings of trees: drawings where all nodes at the same depth are vertically aligned. However, when nodes have varying heights, layered drawing may use more vertical space than necessary. A non-layered drawing of a tree places children at a fixed distance from the parent, thereby giving a more vertically compact drawing. Moreover, non-layered drawings can also be used to draw trees where the vertical position of each node is given, by adding dummy nodes. In this paper, we present the first linear-time algorithm for producing non-layered drawings. Our algorithm is a modification of the Reingold–Tilford algorithm, but the original complexity proof of the Reingold–Tilford algorithm uses an invariant that does not hold for the non-layered case. We give an alternative proof of the algorithm and its extension to non-layered drawings. To improve drawings of trees of unbounded degree, extensions to the Reingold–Tilford algorithm have been proposed. These extensions also work in the non-layered case, but we show that they then cause a O(n2) run-time. We then propose a modification to these extensions that restores the O(n) run-time. Copyright © 2013 John Wiley & Sons, Ltd.