1 Introduction
A graph is universal for a class of graphs if contains every graph in as a subgraph. The study of universal graphs was initiated by Rado [24] in the 1960s. Obviously, the complete graph is universal for any family of vertex graphs. Research focused on finding the minimum size (i.e., number of edges) of universal graphs for various families of sparse graphs on vertices. Babai et al. [4] proved that if is the family of all graphs with edges, then the size of a universal graph for is in and . Alon et al. [1, 2] constructed a universal graph of optimal size for vertex graphs with maximum degree .
Significantly better bounds exist for minorclosed families. Babai et al. [4] proved that there exists a universal graph with edges for vertex planar graphs. For boundeddegree planar graphs, Capalbo [13] constructed universal graphs of linear size, improving an earlier bound by Bhatt et al. [7], which extends to other families with bounded bisection width. Böttcher et al. [10, 11] proved that every vertex graph with minimum degree is universal for vertex boundeddegree planar graphs. For vertex trees, Chung and Graham [15, 16] constructed a universal graph of size , and showed that this bound is asymptotically optimal apart from constant factors.
Rado [24] has introduced universality also for induced subgraphs. A graph is induced universal for a class of graphs if contains every graph in as an induced subgraph. Alon and Nenadov [3] described a graph on vertices that is induced universal for the class of vertex graphs of maximum degree . Recently, Dujmović et al. [19] showed, improving earlier results by Bonamy et al. [8], that for every , there exists a graph with vertices that contains every vertex planar graph as an induced subgraph.
In this paper, we extend the concept of universality to geometric graphs. A geometric graph is a graph together with a straightline drawing in the plane in which the vertices are distinct points and the edges are straightline segments not containing any vertex in their interiors. We investigate the problem of constructing, for a given class of planar graphs, a geometric graph with few vertices and edges that is universal for , that is, it contains an embedding of every graph into . For an (abstract) graph and a geometric graph , an embedding of into is an injective graph homomorphism such that (i) every edge is mapped to a line segment ; and (ii) every pair of edges is mapped to a pair of noncrossing line segments and in the plane.
Previous research in the geometric setting was limited to finding the smallest complete geometric graph that is universal for the planar graphs on vertices. The intersection pattern of the edges of a geometric graph is determined by the location of its vertices; hence universal complete geometric graphs are commonly referred to as universal point sets. De Fraysseix et al. [17] proved that the section of the integer lattice is an universal point set. Over the last 30 years, the upper bound on the size of an universal point set has been improved from to [5]; the current best lower bound is [25] (based on stacked triangulations, i.e., planar graphs of treewidth three; see also [14, 23]). It is known that every set of points in general position is universal for vertex outerplanar graphs [9, 22]. An upper bound is known for vertex stacked triangulations [21].
Our Results.
The results on universal point sets yield an upper bound of for the size of a geometric graph that is universal for vertex planar graphs and for vertex outerplanar graphs, including trees. We improve the upper bound for vertex trees to an optimal , and show that the quadratic upper bound for outerplanar graphs is essentially tight for convex geometric graphs. More precisely, we prove the following results:

For every , there exists a geometric graph with vertices and edges that is universal for forests with vertices (Theorem 1 in Section 2). The bound of edges is asymptotically optimal, apart from constant factors, even in the abstract setting, for caterpillars, and if the universal graph is allowed to have more than vertices [15, Theorem 1]. The proof of universality is constructive and yields a polynomialtime algorithm that embeds any forest with vertices into .

For every and , every vertex convex geometric graph that is universal for the family of vertex cycles with disjoint chords has edges (Theorem 2 in Section 3); this almost matches the trivial upper bound, which hence cannot be improved by polynomial factors even for vertex outerplanar graphs of maximum degree three. For vertex cycles with disjoint chords, there exists an vertex convex geometric graph with edges (Theorem 3 in Section 3), which matches the lower bound above.
2 Universal Geometric Graphs for Forests
In this section, we prove the following theorem.
Theorem 1.
For every , there exists a geometric graph with vertices and edges that is universal for forests with vertices.
2.1 Construction
We adapt a construction due to Chung and Graham [16], originally designed for abstract graphs, to the geometric setting. For a given , they construct a graph with vertices and edges such that contains every forest on vertices as a subgraph. Let us sketch this construction. For simplicity assume that , for some integer . Let be a complete rooted ordered binary tree on vertices. A level is a set of vertices at the same distance from the root. The levels are labeled , from the one containing the root to the one that contains the leaves of . A preorder traversal of (which consists first of the root, then recursively of the vertices in its left subtree, and then recursively of the vertices in its right subtree) determines a total order on the vertices, which also induces a total order on the vertices in each level of . On each level, we call two consecutive elements in this order levelneighbors; in particular, any two siblings are levelneighbors. For a vertex of , we denote by the subtree of rooted at . The graph contains and three additional groups of edges defined as follows (see Figure 1 for an illustration).

Every vertex is adjacent to all vertices in the subtree ;

every vertex that has a left or right levelneighbor in is adjacent to all vertices in the subtree ; and

every vertex whose parent has a left levelneighbor is adjacent to all vertices in the subtree .
Number of edges.
It is easily checked that has edges. Indeed, the binary tree has vertices on level , for . A vertex on level has descendants (including itself), and its at most two levelneighbors have the same number of descendants. In addition, the left levelneighbor of the parent of (if present) has descendants (excluding itself). Altogether is adjacent to less than vertices at the same or at lower levels of . Hence, the number of edges in is less than
Chung and Graham [16] showed that is universal for forests, that is, contains every forest on vertices as a subgraph.^{1}^{1}1In fact, the construction by Chung and Graham uses fewer edges: in the edge groups (E2) and (E3) in the definition of , they only use siblings instead of left and right levelneighbors. But we were unable to verify their proof with the smaller edge set. Specifically, we do not see why the graph in [16, Fig. 7] is admissible. However, their proof works with the larger edge set we define here.
Geometric representation.
We next describe how to embed the vertices of into ; see Figure 2(left) for an illustration. First, the coordinates of the vertices are assigned in the order determined by a preorder traversal of . For simplicity, let us take these coordinates to be , so that the root of is placed on the axis. The vertex of with coordinate is denoted by .
The coordinates of the vertices are determined by a BFS traversal of starting from the root, in which at every vertex the right sibling is visited before the left sibling. If a vertex is visited before a vertex by this traversal, then gets a larger coordinate than . The gap between two consecutive coordinates is chosen so that every vertex is above every line through two vertices with smaller coordinates; this implies that, for any vertex , all vertices with larger coordinate than , if any, see the vertices below in the same circular order as . The vertices of are in general position, that is, no three are collinear.
Our figures display the vertices of in the correct  and order, but—with the exception of Figure 1(right)—they are not to scale. The coordinates in our construction are rapidly increasing (similarly to constructions in [12, 21]). For this reason, in our figures we draw the edges in as straightline segments and all other edges as Jordan arcs. In particular, we have the following property (see Figure 2(right) for an example).
Observation 1.
If such that (1) has larger coordinate than , , and , and (2) has smaller or larger coordinate than both and , then and do not cross.
Proof.
By (2) we can assume, without loss of generality up to a switch of the labels of and , that is below the line through and . By (1) and by construction, is above the line through and , hence and are separated by the line through and and thus do not cross. ∎
2.2 Intervals and Embeddings
For every interval we define to be the subgraph of that is induced by the vertices with coordinates in . We call the graph an interval of . The length of an interval of is defined as , which is the number of vertices in . If is an interval of integers, then we denote by the corresponding interval of . For a subset , we denote by the subgraph of induced by .
In Section 2.3, we present a recursive algorithm that can embed every tree on vertices into every interval of length of . In some cases, we embed the root of a tree at some vertex of the interval, and recurse on the subtrees. For this strategy, it is convenient to embed the root at the center of a spanning star. The following lemma shows that every interval contains spanning stars.
Lemma 1.
Every interval of on at least two vertices contains two spanning stars: one is centered at the highest vertex ; another is centered at the second highest vertex of . If , then contains a spanning star centered at the highest vertex of (which may or may not be ).
Proof.
We first argue for the star centered at . By construction (preorder traversal and increasing coordinates along each level from left to right), all vertices in belong to . By construction, contains edges from to every vertex in . This completes the proof if . Assume that . Then has a parent ; further, we have , because is the highest vertex of and every vertex is higher than its descendants. Therefore, has a left sibling (which may or may not be in ); and all the vertices in are in and hence are adjacent to . As the vertices are laid out in general position, every star in is noncrossing.
We now argue about the second highest vertex of . We consider two cases.
If , then is the highest vertex of . Therefore, contains a spanning star centered at , as argued above if ; if , then such a star trivially exists. The remaining edge between and exists, as it is part of the star centered at .
Hence, we may assume that . We now show that the highest vertex in is the center of a spanning star for . Note that is a child of : Namely, since no vertex in is higher than , it follows that neither the right levelneighbor of , if it exists, nor a vertex on a higher level than are in , hence is either the left or the right child of . Recall that has a parent with . Therefore, has a left sibling , which may be in or not; regardless, all the vertices in are in and are hence adjacent to . Further, the edge between and exists, as it is part of the star centered at . Finally, each vertex in is either in , hence it is adjacent to as each vertex is adjacent to all its descendants, or in , where is the child of different from , hence it is adjacent to as each vertex is adjacent to all the descendants of a sibling.
If , our proof is complete. Let us assume that is in . Then must be on a higher level than , which is the left child of , and on a lower level than . Hence, is the left sibling of , which implies and . Therefore, is adjacent to all the vertices in , which are its descendants, as well as to all the vertices of , which are descendants of its rightlevel neighbor ; hence, is adjacent to all the vertices of . ∎
The recursive algorithm (Section 2.3) sometimes embeds a subtree of onto an induced subgraph of that is “almost” an interval, in the sense that it can be obtained from an interval of by deleting its highest vertex or by replacing its highest vertex with a vertex that does not belong to the interval. Lemma 3 and Lemma 4 below provide the tools to construct such embeddings.
We first prove that the “structure” of an interval without its highest vertex is similar to that of an interval; this is formalized by the following definition. Let and be two subsets of with . Let and be the vertices of and , respectively, ordered by increasing coordinates. We say that and are crossingisomorphic if the following conditions are satisfied:

For any two distinct integers , the edge belongs to if and only if the edge belongs to .

For any four distinct integers such that the edges and belong to , the edge crosses the edge if and only if the edge crosses the edge .

If is the highest vertex of , for some , then is the highest vertex of .
In this case, the graph isomorphism given by , for all , is a crossingisomorphism. Clearly, the inverse of a crossingisomorphism is a crossingisomorphism. We have the following.
Lemma 2.
Let be the highest vertex in an interval , and assume that contains neither the right child of nor any descendant of the left child of its left sibling (if it exists). Then is crossingisomorphic to some interval of ; the interval can be computed in time.
Proof.
If or , then is the interval or , respectively, and the conclusion is immediate. Assume that and that the subtrees of rooted at the children of have height . Thus, has vertices. Let . We prove that is crossingisomorphic to . Let be the vertices of , ordered by increasing coordinates; further, let be the vertices of , ordered by increasing coordinates. Refer to Figure 3.
Since and is the highest vertex in , it follows that is not the root of and is not the parent of , hence is the right child of its parent and has a left sibling . Since does not contain any descendant of the left child of the left sibling of , it follows that is a subgraph of induced by vertices in the right subtree of the left sibling of . Specifically, is induced by the last vertices (in a preorder traversal) of the subtree of height , rooted at the right child of . Further, consists of the last vertices (in a preorder traversal) of the subtree of height , rooted at the left child of . Hence, is crossingisomorphic to .
Since is the left child of and since the right child of is not a vertex of , it follows that is the subgraph of induced by the first vertices (in a preorder traversal) of the subtree of height . Further, consists of the first vertices (in a preorder traversal) of subtree of height . Hence, is crossingisomorphic to .
Condition (C1).
In order to prove that Condition (C1) is satisfied (that is, is isomorphic to ), it remains to argue about the edges of between (i.e., vertices in ) and (i.e., vertices in ), and about the edges of between (that is, vertices in ) and (that is, vertices in ). Consider an edge in , where and . Since a vertex in is neither an ancestor nor a descendant of a vertex in , it follows that belongs to the edge group (E2) or (E3). We distinguish between two cases:

Suppose that is a descendant of the left levelneighbor of , for some . Then is the left levelneighbor of and is a descendant of . Hence, the edge belongs to the edge group (E2). Similarly, if is a descendant of the right levelneighbor of , for some , then is the right levelneighbor of and is a descendant of . Hence, the edge belongs to the edge group (E2).

Suppose that is a descendant of the left levelneighbor of the parent of , for some and . Then is the parent of ; further, is the left levelneighbor of ; finally, is a descendant of . Hence, the edge belongs to the edge group (E3).
Analogously, given an edge of with and , the edge belongs to . This concludes the proof that Condition (C1) is satisfied.
Condition (C2).
We now prove that Condition (C2) is satisfied. The proof exploits the following property: a vertex of is visited before a vertex of in the BFS traversal of that determines the coordinate of the vertices of if and only if the vertex of is visited before the vertex of in the same traversal. This property follows from the fact that the vertices (the vertices ) are the last vertices in a preorder traversal of a subtree (resp., of a subtree ) of of height , that the vertices (the vertices ) are the first vertices in a preorder traversal of a subtree (resp., of a subtree ) of of height , and that the vertices of (resp., of ) precede the vertices of (resp., of ) in a preorder traversal of .
Consider two arbitrary edges and of . We prove that and cross each other if and only if the edges and of cross each other. Since the vertices of are in general position, we can assume that the indices , , , and are all distinct (as if two among such indices coincide, then and do not cross each other, and neither do the edges and ). Assume w.l.o.g. that and that . If , then and use disjoint intervals and hence do not cross each other; further, and use disjoint intervals and hence do not cross each other.
There are two remaining cases to consider, namely and .
Assume first that . If or is visited first among , , , and in the BFS traversal of that determines the coordinates of the vertices of , then or is visited first among , , , and in the same traversal. By construction, or is the highest vertex among , , , and ; and or is the highest vertex among , , , and . By Observation 1, and do not cross each other and and do not cross each other. Assume hence that or , say , is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of ; thus, is visited first among , , , and in the same traversal. By construction, is the highest vertex among , , , and , and is the highest vertex among , , , and . We further distinguish between two cases.

If is visited before and in the BFS traversal of that determines the coordinate of the vertices of , then is visited before and in the same traversal. Hence, the coordinate of is larger than those of and (and the coordinate of is larger than those of and ). It follows that and use disjoint intervals and hence do not cross each other, and similarly and use disjoint intervals and hence do not cross each other.

If is visited after or (possibly both) in the BFS traversal of that determines the coordinate of the vertices of , then is visited after or (possibly both) in the same traversal. By construction, either or , whichever is visited first by the BFS traversal of , is assigned a coordinate large enough so that it lies above the line through and the other point in that is visited second by the BFS traversal of . It follows that lies below the line through and and hence the edges and cross each other. Similarly, lies below the line through and and hence the edges and cross each other.
Assume next that . Further, assume that the vertex that is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of is either or , as the case in which it is one of and is analogous (by replacing with and with , respectively). We now distinguish between two cases.

Assume that is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of . Then is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of . By construction, is the highest vertex among , , , and ; further, is the highest vertex among , , , and .

If is visited before and in the BFS traversal of that determines the coordinate of the vertices of , then is visited before and in the same traversal. Hence, the coordinate of is larger than those of and and the coordinate of is larger than those of and . It follows that and use disjoint intervals and hence do not cross each other, and similarly and use disjoint intervals and hence do not cross each other.

If is visited after or (possibly both) in the BFS traversal of that determines the coordinate of the vertices of , then is visited after or (possibly both) in the same traversal. By construction, or , whichever is visited first by the BFS traversal of , is assigned a coordinate large enough so that it lies above the line through and the vertex in that is visited second by the BFS traversal of . It follows that lies below the line through and and hence the edges and cross each other. Similarly, lies below the line through and and hence the edges and cross each other.


Assume next that is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of . Then is visited first among , , , and in the BFS traversal of that determines the coordinate of the vertices of . By construction, is the highest vertex among , , , and ; further, is the highest vertex among , , , and . By construction, lies above the straight line through and , and above the straight line through and . Conversely, the segment lies between these two straight lines. It follows that and do not cross each other. Similarly, lies above the straight line through and , and above the straight line through and . Conversely, the segment lies between these two straight lines. It follows that and do not cross each other.
This concludes the proof that Condition (C2) is satisfied.
Condition (C3).
Finally, note that is the highest vertex of and is the highest vertex of . Since and , Condition (C3) follows.
This concludes the proof that and are crossingisomorphic. ∎
We are now ready to present our tools for embedding trees onto “almost” intervals. The first one deals with subgraphs of obtained by deleting the highest vertex from an interval.
Lemma 3.
Let be the highest vertex in an interval with vertices. Suppose that there is a crossingisomorphism from to some interval of with vertices. Further, suppose that a tree with vertices admits an embedding onto . Then is an embedding of onto , and if is the vertex of such that is the highest vertex of , then is the highest vertex of .
Proof.
Let and be the vertices of and , respectively, ordered by increasing coordinates. Let be the vertices of ordered so that , for . Note that yields for . We now prove that is an embedding of onto with the properties stated in the lemma.
First, for every such that is an edge in , we have that is an edge in . In particular, is an edge in , given that is an embedding of onto . By Condition (C1) for , is an edge of .
Second, for every such that and are distinct edges of , we have that and do not cross each other. In particular, and do not cross each other, given that is an embedding of onto . By Condition (C2) for , this implies that and do not cross each other.
Finally, let be the vertex of such that is the highest vertex of . Condition (C3) for implies that is the highest vertex of . By construction, . This concludes the proof of the lemma. ∎
The second tool deals with subgraphs of obtained by replacing the highest vertex of an interval with another “high” vertex outside the interval; see Figure 4 for an illustration.
Lemma 4.
Let be an interval of with vertices and let be its highest vertex. Let be a vertex of that is higher than all vertices in and that does not belong to . Suppose that a tree with vertices admits an embedding onto . Let be the vertex of such that ; further, let and for every vertex of other than . Then is an embedding of onto .
Proof.
By construction, we have for every vertex of different from ; since is an embedding of onto , we only need to prove that each edge incident to does not cross any other edge of in . Let and two edges of , and let , , and , where . We prove that and do not cross each other. Assume, w.l.o.g., that . Further, assume that , as the case in which is symmetric.

If , then and do not cross each other as they use disjoint intervals.

If , then and do not cross each other by Observation 1.

Finally, assume that . If is visited before and in the BFS traversal of that determines the coordinates of the vertices of , then the coordinate of is larger than the one of and , hence and do not cross each other as they use disjoint intervals. We now show that the case in which is visited after or after (possibly after both) in the BFS traversal of that determines the coordinate of the vertices of does not occur. Suppose the contrary, for a contradiction. It follows that the one between and that is visited first by the BFS traversal of is assigned a coordinate large enough so that it lies above the line through and the one between and that is visited second by the BFS traversal of . Hence, lies below the line through and . However, this implies and cross each other, contradicting the assumption that is an embedding of onto .
This concludes the proof of the lemma. ∎
The following lemma is a variant of the (unique) lemma in [16]. It finds a subtree of a certain size in a rooted tree.
Lemma 5.
Given a rooted tree on vertices and an integer , with , there is a vertex of such that but , for all children of . Such a vertex can be computed in time .
Proof.
We find vertex by the following walk on starting from the root. Initially, let be the root of . While has a child such that , then set . At the end of the while loop, but , for all children of . After precomputing the weight of the subtree for every vertex of , the while loop runs in time. ∎
2.3 Proof of Theorem 1
Given a tree on vertices and an interval of length , we describe an algorithm that recursively constructs an embedding of onto . For a subtree of , we denote by the image of restricted to the vertices and edges of . A step of the algorithm explicitly embeds some vertices; the remaining vertices form subtrees that are recursively embedded into pairwise disjoint subintervals of . In order to control the interaction between the recursively embedded subtrees and the edges connecting vertices of such subtrees to explicitly embedded vertices, we insist that in every subtree at most two vertices, called portals, are adjacent to external vertices (i.e., that are not part of the subtree). We also ensure that whenever a subtree is embedded onto a subinterval, the external vertices that connect to the portals of that subtree are embedded above the whole subinterval.
For a point , we define two quarterplanes: Let denote the set of points above and to the right of ; similarly, let denote the set of points above and to the left of . In Lemma 6 below, we require that these regions are empty of vertices and edges of the embedded graph, so that they can be used to add edges incident to , when a portal is embedded onto it.
We inductively prove the following lemma, which immediately implies Theorem 1 with and a portal chosen arbitrarily.
Lemma 6.
We are given a tree on vertices, an interval of length , and

either a single portal in or

two distinct portals and in .
Then there exists an embedding of onto with the following properties:

If only one portal is given, then

is the highest vertex in ; and

if and is the unique neighbor of in , then does not intersect any vertex or edge of the embedding .


If two distinct portals are given, then

is to the left of ;

does not intersect any edge or vertex of ; and

does not intersect any edge or vertex of .

Proof.
We proceed by induction on the number of vertices of . In the base case, has one vertex, which must be the portal , and the map maps to the highest vertex of . For the induction step we assume that and that the claim holds for all smaller trees.
Case 1: There is only one portal . Let denote the highest vertex in . We need to find an embedding of onto where . Consider to be rooted at . We distinguish two cases depending on the degree of in .
Case 1.1: . Assume that has children . Refer to Figure 5. Partition the set of integers into contiguous subsets such that , for . Without loss of generality assume that contains or , and so is an interval of integers.
By induction, there is an embedding of into such that is mapped to the highest vertex of , for all . Similarly, there is an embedding of onto such that is mapped to the highest vertex of , which is . Note that these embeddings are pairwise noncrossing since they use pairwise disjoint intervals. Let be the combination of these embeddings. Clearly, both Properties 1(a) and 1(b) are satisfied by .
The only edges of between distinct subtrees among are of the form , for . The edges are in and are pairwise noncrossing by Lemma 1. Moreover, does not cross , as is the highest vertex of