Hostname: page-component-77c78cf97d-7dld4 Total loading time: 0 Render date: 2026-04-23T12:01:39.561Z Has data issue: false hasContentIssue false

Functional Pearls

Deriving tidy drawings of trees

Published online by Cambridge University Press:  07 November 2008

Jeremy Gibbons
Affiliation:
Department of Computer Science, University of Auckland, Private Bag 92019, Auckland, New Zealand. Email jeremy@cs. auckland. ac.nz
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the 'Save PDF' action button.

The tree-drawing problem is to produce a ‘tidy’ mapping from elements of a tree to points in the plane. In this paper, we derive an efficient algorithm for producing tidy drawings of trees. The specification, the starting point for the derivations, consists of a collection of intuitively appealing criteria satisfied by tidy drawings. The derivation shows constructively that these criteria completely determine the drawing. Indeed, the criteria completely determine a simple but inefficient algorithm for drawing a tree, which can be transformed into an efficient algorithm using just standard techniques and a small number of inventive steps.

The algorithm consists of an upwards accumulation followed by a downwards accumulation on the tree, and is further evidence of the utility of these two higher-order tree operations.

Information

Type
Articles
Copyright
Copyright © Cambridge University Press 1996
Submit a response

Discussions

No Discussions have been published for this article.