Drawing Trees and Cacti with Integer Edge Lengths on a Polynomial-Size Grid
Abstract
A strengthened version of Harborth’s well-known conjecture – known as Kleber’s conjecture – states that every planar graph admits a planar straight-line drawing where every edge has integer length and each vertex is restricted to the integer grid. Positive results for Kleber’s conjecture are known for planar 3-regular graphs, for planar graphs that have maximum degree 4, and for planar 3-trees. However, all but one of the existing results are existential and do not provide bounds on the required grid size. We provide polynomial-time algorithms for computing crossing-free straight-line drawings of trees and cactus graphs with integer edge lengths and integer vertex position on polynomial-size integer grids. We also give an historic overview of planar straight-line graph drawing results.
Keywords and phrases:
Harborth’s conjecture, tree drawings, cactus drawings, grid drawingsCategory:
Poster AbstractCopyright and License:
2012 ACM Subject Classification:
Mathematics of computing Trees ; Mathematics of computing Graph algorithms ; Theory of computation Graph algorithms analysisEditors:
Vida Dujmović and Fabrizio MontecchianiSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 History of planar straight-line graph drawings
Wagner in 1936 [17], Fáry in 1948 [7], and Stein in 1951 [14] proved independently that every planar graph has a crossings-free drawing with edges drawn by straight-line segments. After these first existential results, algorithms that do create such drawings were described by Tutte in 1963 [16], Chiba, Yamanouchi, and Nishizeki in 1984 [5], and Read in 1986 [12]. In the generated drawings, the ratio between longest and shortest edge can be exponential in the size of the graph. For readability, it helps to have vertices at integer coordinates on a polynomial-size grid. In 1990, two algorithms generating such drawings appeared. De Fraysseix, Pach and Polack [6] use canonical orders whereas Schnyder’s algorithm [13] uses a decomposition of the graph into three trees from which barycentric coordinates can be computed. For vertices, both algorithms provide a straight-line drawing on the grid.
Can we also ensure that all edge lengths are integers? These two algorithms [6, 13] can (and do) produce irrational edge lengths. Harborth’s conjecture [9, 10] asks whether every planar graph has a crossings-free realization with straight-line segments of integer lengths, referred to integral Fáry embeddings [4]. A stronger version of Harborth’s conjecture, called Kleber’s conjecture, asks whether an integral Fáry embedding exists with all vertices on the integer grid [11]. We refer to these drawings as truly integral Fáry embeddings.
Sun [15] uses rigidity matrices to prove that all planar (2, 3)-sparse graphs admit integral Fáry embeddings. A graph is (, )-sparse if every subgraph of has at most edges. (2, 3)-sparse graphs include series-parallel, outerplanar, and planar bipartite graphs. In 2024, Chang and Sun [4] show this result also for all planar 4-regular graphs.
Geelen, Guo, and McKinnon [8] show that every planar max-degree-3 graph admits a truly integral Fáry embedding. Biedl [3] observes that this technique can be applied to all planar (2, 1)-sparse graphs, which include all max-degree-4 graphs that are non-4-regular. Independently, Benediktovich [1] shows this result for max-degree-4 graphs that are non-4-regular and for planar 3-trees. The vertices have rational coordinates, thus, can be scaled to integers. However, they make use of a theorem by Berry [2] to position vertices on a rational point in an -disk around a real point, which doesn’t provide guarantees on the distance towards an integral point. If the drawing is scaled to provide a truly integral Fáry embedding, no bound on the area can be provided. To the best of our knowledge, the algorithm by Biedl [3] that produces quadratic truly integral Fáry embeddings for -regular planar graphs is the only algorithm in the literature that provides a polynomial upper bound on the area.
2 Truly integral Fáry embeddings of trees and cacti on a poly-size grid
We show that trees and cacti admit truly integral Fáry embeddings on the and integer grids, respectively. For binary trees, follows from [3]; for constant-depth trees like stars, follows from Theorem 1. To ensure integer edge lengths on an integer grid, we are restricted to using Pythagorean triples. Pythagorean triples are all triples of integers which satisfy . A Pythagorean triple is primitive if , , and are co-prime. The first primitive Pythagorean triples can be computed in time. We denote by the angle-sorted first primitive Pythagorean triples.
Let be a (rooted) tree, which has vertices, leaves, and depth . Denote the root by ; if no root is given, pick arbitrarily. If no rotation system is given, choose it arbitrarily. For a vertex , we denote by the subtree of rooted at vertex and by the number of leaves in . Place at . Assign the first child of the first primitive Pythagorean triples from , assign the second child of the next primitive Pythagorean triples from , etc. Draw each child of at the coordinates where is the first primitive Pythagorean triple assigned to . For each child of , for which is not a leaf of , we draw the subtree recursively: in the recursive call, we assume that the coordinate system is centered at the position of and we use exactly the primitive Pythagorean triples assigned to ; see Figure 1.
Correctness follows from the fact that we use distinct slopes (primitive Pythagorean triples) in distinct subtrees that are sorted such that they fan out. The realization as a linear-time algorithm is straight-forward, however, we add additional running time for computing primitive Pythagorean triples, which needs to be done only once.
Theorem 1.
Let be a (rooted) tree, which has vertices, leaves, and depth . There is a truly integral Fáry embedding on a grid of size , which can be found in time.
With a special handling of cycles, in particular triangles, we can extend the algorithm from trees to cacti and obtain the following result.
Theorem 2.
Let be a (rooted) cactus, which has vertices, leaves, diameter , cycles out of which are triangles. There is a truly integral Fáry embedding on a grid of size , which can be found in time.
References
- [1] Vladimir I. Benediktovich. On rational approximation of a geometric graph. Discret. Math., 313(20):2061–2064, 2013. doi:10.1016/J.DISC.2013.06.018.
- [2] T.G. Berry. Points at rational distance from the vertices of a triangle. Acta Arithmetica, LXII(4):391–398, 1992. doi:10.4064/aa-62-4-391-398.
- [3] Therese Biedl. Drawing some planar graphs with integer edge-lengths. In Proc. CCCG 2011, 2011. URL: http://www.cccg.ca/proceedings/2011/papers/paper36.pdf.
- [4] Daniel J. Chang and Timothy Sun. Harborth’s conjecture for 4-regular planar graphs. In Proc. GD 2024, 2024. doi:10.4230/LIPICS.GD.2024.38.
- [5] Norishige Chiba, Tadashi Yamanouchi, and Takao Nishizeki. Linear algorithms for convex drawings of planar graphs. Progress in graph theory, pages 153–173, 1984.
- [6] Hubert De Fraysseix, János Pach, and Richard Pollack. How to draw a planar graph on a grid. Combinatorica, 10(1):41–51, 1990. doi:10.1007/bf02122694.
- [7] István Fáry. On straight line representation of planar graphs. Acta Sci. Math.(Szeged), 11:229–233, 1948.
- [8] Jim Geelen, Anjie Guo, and David McKinnon. Straight line embeddings of cubic planar graphs with integer edge lengths. J. Graph Theory, 58(3):270–274, 2008. doi:10.1002/jgt.20304.
- [9] Heiko Harborth, Arnfried Kemnitz, Meinhard Möller, and Andreas Süssenbach. Ganzzahlige planare Darstellungen der platonischen Körper. Elem. Math., 45(5):118–122, 1987.
- [10] Arnfried Kemnitz and Heiko Harborth. Plane integral drawings of planar graphs. Discrete Mathematics, 236(1-3):191–195, 2001. doi:10.1016/s0012-365x(00)00442-8.
- [11] Michael Kleber. Encounter at far point. The Mathematical Intelligencer, 30:50–53, 2008. doi:10.1007/bf02985756.
- [12] Ronald C. Read. A new method for drawing a planar graph given the cyclic order of the edges at each vertex. Faculty of Mathematics, University of Waterloo, 1986.
- [13] Walter Schnyder. Embedding planar graphs on the grid. In Proc. SODA 1990, 1990. URL: https://dl.acm.org/doi/10.5555/320176.320191.
- [14] Sherman K Stein. Convex maps. Proc. Am. Math. Soc., 2(3):464–466, 1951.
- [15] Timothy Sun. Rigidity-theoretic constructions of integral fary embeddings. In Proc. CCCG 2011, 2011. URL: http://www.cccg.ca/proceedings/2011/papers/paper20.pdf.
- [16] William Thomas Tutte. How to draw a graph. Proceedings of the London Mathematical Society, 3(1):743–767, 1963. doi:10.1112/plms/s3-13.1.743.
- [17] Klaus Wagner. Bemerkungen zum Vierfarbenproblem. Jahresbericht der Deutschen Mathematiker-Vereinigung, 46:26–32, 1936.
