Advertisement

Acta Informatica

, Volume 18, Issue 4, pp 377–392 | Cite as

The complexity of drawing trees nicely

  • Kenneth J. Supowit
  • Edward M. Reingold
Article

Summary

We investigate the complexity of producing aesthetically pleasing drawings of binary trees, drawings that are as narrow as possible. The notion of what is aesthetically pleasing is embodied in several constraints on the placement of nodes, relative to other nodes. Among the results we give are: (1) There is no obvious “principle of optimality” that can be applied, since globally narrow, aesthetic placements of trees may require wider than necessary subtrees. (2) A previously suggested heuristic can produce drawings on n-node trees that are Θ(n) times as wide as necessary. (3) The problem can be reduced in polynomial time to linear programming; hence, if the coordinates assigned to the nodes are continuous variables, then the problem can be solved in polynomial time. (4) If the placement is restricted to the integral lattice then the problem is NP-hard, as is its approximation to within a factor of about 4 per cent.

Keywords

Information System Operating System Continuous Variable Data Structure Communication Network 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. 1.
    Borosh, I., Treybig, L.B.: Bounds on Positive Integral Solutions of Linear Diophantine Equations. Proc. Amer. Math. Soc. 55, 299–304 (1976)Google Scholar
  2. 2.
    Garey, M.R., Johnson, D.S.: Computers and Intractability: A Guide to the Theory of NP-Completeness. W.H. Freeman and Co., San Francisco, 1979Google Scholar
  3. 3.
    Khachian, L.G.: A Polynomial Algorithm for Linear Programming. Doklady Akad. Nauk SSSR 244, 191–194 (1979)Google Scholar
  4. 4.
    Knott, G.D.: A Numbering System for Binary Trees. Comm. ACM 20, 113–115 (1977)Google Scholar
  5. 5.
    Knuth, D.E.: The Art of Computer Programming, Vol.1: Fundamental Algorithms. Addison-Wesley Publishing Co., Reading, MA, 1968Google Scholar
  6. 6.
    Reingold, E.M., Nievergelt, J., Deo, N.: Combinatorial Algorithms: Theory and Practice. Prentice-Hall: Englewood Cliffs, New Jersey, 1977Google Scholar
  7. 7.
    Reingold, E.M., Tilford, J.S.: Tidier Drawings of Trees. IEEE Trans. Software Engineerg. 7 223–228 (1981)Google Scholar
  8. 8.
    Sahni, S., Gonzalez, T.: P-complete Approximation Problems. J. ACM 23, 555–565 (1976)Google Scholar
  9. 9.
    Vaucher, J.G.: Pretty-Printing of Trees. Software-Practice and Experience 10, 553–561 (1980)Google Scholar
  10. 10.
    Wetherell, C., Shannon, A.: Tidy Drawings of Trees. IEEE Trans. Software Engineerg. 5, 514–520 (1979)Google Scholar

Copyright information

© Springer-Verlag 1983

Authors and Affiliations

  • Kenneth J. Supowit
    • 1
  • Edward M. Reingold
    • 1
  1. 1.Department of Computer ScienceUniversity of Illinois at Urbana-ChampaignUrbanaUSA

Personalised recommendations