MCP
arXivarXiv
Preprint
Published: July 29, 2026
cs.CG

Minimum-Width Drawing of Trees with Sized Vertices

Abstract
Trees arise in many applications and computing nice tree layouts is a classical problem in information visualization. In many practical settings, vertices need to be represented as rectangles with a given width and height rather than as points. When an order over the children of each vertex is given, polynomial-time algorithms are known that produce drawings adhering to various drawing conventions. However, in many applications, the order of children carries no semantic meaning, and choosing it well can significantly reduce the drawing's width. In this paper, we study the problem \textsc{Min-Width Tree Drawing with Reordering} (\textsc{MWD}): given a rooted tree whose vertices have prescribed widths, find a sibling order at each internal vertex that minimizes the width of the resulting layered drawing. We show that the problem is \textsf{NP}-complete, even on binary trees with unit-width vertices. We present a mixed integer linear program that solves \textsc{MWD} exactly on moderately sized instances, and a heuristic that is fast and delivers good results in practice. We evaluate both approaches against a baseline on synthetic and real-world datasets, where reordering reduces drawing width by a median of ≈20%\approx20\% and by up to ≈55%\approx55\% on individual instances. The heuristic computes its layouts in under a second and, when the MILP proves optimality, it stays within 25%25\% of the optimal width in three-quarters of all instances.
0
AI overview
Reviews
Citation graph
References · 28
Structured
This preview uses generator v1; v2 is available

Overview

This paper studies the minimum-width drawing problem for trees with sized vertices, proves that the problem is NP-complete, and proposes an exact MILP solution and a fast simulated annealing heuristic. Experiments verify that both methods can effectively reduce the width of tree layouts.

Problem Background and Research Gap in Tree Layout with Fixed-Width Vertices

Tree layout is a classic research problem in information visualization. In many practical scenarios, vertices cannot be abstracted as geometric points and must instead be represented as rectangles with specified width and height. When the order of each vertex's children is fixed in advance, existing research has proposed multiple polynomial-time algorithms that produce tree layouts satisfying various drawing conventions. However, in many practical scenarios, the ordering of siblings carries no semantic information, and reasonably optimizing that order can significantly reduce the total width of the final layout.

Currently published related work does not simultaneously cover three core settings: a tidy layered drawing convention, vertices with custom sizes, and free choice of sibling ordering. This insufficiently studied combination is exactly the object of this paper's research. The layout model uses real-valued coordinates, consistent with the previously discussed orderless layered drawing convention.

Definition of the Minimum-Width Drawing with Reordering (MWD) Problem and Core Contributions

The paper gives a rigorous formal definition of minimum-width drawing of trees with reordering (MWD): given a rooted tree T=(V,E,w,h) with custom width and height parameters, the goal is to find an ordering π* of siblings such that the total drawing width W_π*(T) of the tree under that ordering equals the minimum achievable total width W*(T). You can use the accompanying diagram to intuitively understand the core layout parameters involved in this definition and the basic rule of centered placement of parents.

Fig. 1: A tidy layered drawing of a tree with nodes of different preset widths, annotating the relevant layout parameters and illustrating the centered placement rule for parents.

Complexity Proof of the MWD Problem and Solution Design

The paper first establishes the NP-completeness of the MWD problem, and the result holds even in the setting of binary trees where all vertex widths are unit values. The proof first confirms the problem is in NP: given a sibling ordering as a verification certificate, one can check in polynomial time whether the layout width of the given tree is at most a specified threshold; specifically, the van der Ploeg algorithm computes the tidy layered layout for the given ordering in O(n) time, completing the verification.

The exact MILP-based solution has a clear scalability boundary: once the number of vertices of the tree to be processed exceeds 100, solving efficiency drops sharply and larger instances cannot be supported.

Based on the NP-completeness result, for larger tree instances the paper designs a simulated annealing heuristic that searches directly over the space of all possible sibling orderings. Each time a candidate ordering is generated, the van der Ploeg algorithm is called to compute in O(n) time the minimum-width tidy layout for that ordering, yielding the candidate's objective value. The combinatorial nature of MWD makes simulated annealing a highly suitable solution method: its search space is purely combinatorial, each internal node corresponds to an ordering of its children, generating a local move requires only swapping two siblings at extremely low cost, and the objective function can be evaluated exactly and quickly by existing algorithms without any additional approximate estimation overhead.

Multi-Dimensional Experimental Results and Analysis of Performance-Influencing Factors

Empirical results for both the exact MILP solution and the simulated annealing heuristic show that tree shape dominates the effect on layout width optimization, exerting a stronger influence than the tree's maximum degree parameter. With the maximum degree cap fixed, deeper trees consistently achieve better layout width improvements than shallow trees, whereas adjusting only the maximum degree cap for a fixed tree shape changes the median improvement by only about 5 percentage points. You can use the accompanying visualizations to directly examine the per-instance median runtime distributions of the three methods at different node counts, and the trend of the proportion of MILP runs terminating within the time limit as node count grows under different child-count constraints.

Fig. 2: Comparison of the scaling behavior of the three methods: the left figure shows median runtime versus node count on a logarithmic vertical axis for each method, and the right figure shows the proportion of MILP runs terminating successfully within the time limit versus node count.

Complementary Positioning of the Methods and the Problem's Boundaries of Applicability

The heuristic and exact methods are not competitors but complement each other. The simulated annealing heuristic outputs layouts in well under 1 second on all tested instances, fitting the needs of interactive tools. The exact MILP-based method, while too slow for interactive scenarios, can reliably output provably optimal results on instances with roughly up to 100 vertices, and serves as a ground-truth reference, providing a verifiable optimal benchmark for future research on heuristics for the MWD problem—an especially crucial role for evaluating NP-hard problems. Readers can use the tree layouts produced by the different solving strategies to directly compare the width differences among the three.

Fig. 3: The same unordered tree drawn respectively with a random order, the order obtained by the simulated annealing heuristic, and the width-optimal order computed by MILP, comparing the layout width improvements of the different reorderings.

MWD's optimization objective is to unconditionally minimize the drawing width, but layout readability does not grow monotonically with compactness. Blank space serves to separate subtrees and guide the eye; compressing the layout to the theoretical lower bound of total width may instead make adjacent subtrees visually indistinguishable. MWD should therefore be understood as one end of the layout-optimization spectrum. In practical applications, introducing a small blank-space budget or adding a proximity penalty for adjacent subtrees, at only a tiny cost in total width, can produce tree visualizations with much stronger readability.

Rating
No ratings yet
Rate
Community rating
—
/ 5
No ratings yet
Rating
—
Soundness
—
Presentation
—
Contribution
—
Confidence
—
Discussion
Top
Newest
Questions
Replication
Author
No comments yet — be the first