1 Introduction

A pioneering paper by Pach and Wenger [9] studied the problem of computing a planar drawing of a graph G with the constraint that the mapping of the vertices to the points in the plane, that represent the vertices of G, is given as part of the input. Pach and Wenger proved that, for any given mapping, a planar graph with n vertices admits a planar drawing such that the curve complexity, i.e. the number of bends per edge, is O(n). Furthermore, they proved that the bound on the curve complexity is (almost surely) tight as n tends to infinity when G has O(n) independent edges. This implies that the curve complexity of a planar drawing with vertices at fixed locations may be \(\varOmega (n)\) even for structurally very simple graphs such as paths or matchings, for which the number of independent edges is linear in n.

These results have motivated the study of a relaxed version of the problem where the function that associates vertices of the graph to points of the plane is not a bijection. Namely, an instance of the k-colored point set embeddability problem receives as input an n-vertex planar graph G such that every vertex is given one of k distinct colors and a set S of n distinct points, such that, each point is given one of the k distinct colors. The number of points of S having a certain color i is the same as the number of vertices of G having color i. The goal is to compute a planar drawing of G with curve complexity independent of n where every vertex of a specific color is represented by a point of the same color. When \(k=n\) the k-colored point set embeddability problem coincides with the problem of computing a drawing with vertices at fixed locations and thus the lower bounds by Pach and Wenger hold. Therefore several papers have focused on small values of k (typically \(k \le 3\)) to see whether better bounds on the curve complexity could be achieved in this scenario (see, e.g., [1, 4,5,6,7]).

For \(k=1\), Kaufmann and Wiese [8] proved that every planar graph admits a 1-colored point set embedding onto any point set with curve complexity at most 2. For \(k = 2\), outerplanar graphs always admit a 2-colored point set embedding with O(1) curve complexity [2]. However, for \(k \ge 2\), there are 2-connected k-colored planar graphs for which a k-colored point set embedding may require \(\varOmega (n)\) bends on \(\varOmega (n)\) edges [1]. This result extends the lower bound of Pach and Wenger [9] to a much more relaxed set of constraints on the location of the vertices, but it does so by using 2-connected graphs instead of just (not necessarily connected) planar graphs. For example, the problem of establishing tight bounds on the curve complexity of k-colored forests for small values of \(k \ge 3\) is a long standing open problem (see, e.g., [1]). We explicitly address this gap in the literature and consider the k-colored point set embeddability problem for acyclic graphs and \(k \ge 3\). Our main results are as follows.

  • In Sect. 3, we prove that a planar drawing of a forest of three stars and n vertices may require \(\varOmega (n^\frac{2}{3})\) edges with \(\varOmega (n^\frac{1}{3})\) bends each, even if the mapping of the vertices to the points is defined by using a set of k colors with \(k\ge 3\). In contrast, a constant number of bends per edge can always be achieved if the number of stars is at most two (for any number of colors) or the number of colors is at most two (for any number of stars).

  • Since the above result implies that 3-colored point set embeddings of 3-colored caterpillars may have a non-constant curve complexity, in Sect. 4 we study subfamilies of 3-colored caterpillars for which constant curve complexity is possible. We prove that every 3-colored path and every 3-colored caterpillar whose leaves all have the same color admit a 3-colored point-set emebdding with constant curve complexity onto any 3-colored point set.

  • Finally, still in Sect. 4, we prove that any 4-colored path \(\pi \) such that the vertices of colors 0 and 1 precede all vertices of colors 2 and 3 when moving along \(\pi \) has a 4-colored point set embedding with at most five bends per edge onto any 4-colored point-set.

Concerning the lower bound, it is worth mentioning that the argument by Pach and Wenger [9] does not apply to families of graphs where the number of independent edges is not a function of n. Hence, our lower bound extends the one by Pach and Wenger about the curve complexity of planar drawings with vertices at fixed locations also to those graphs for which the number of independent edges does not grow with n. For reasons of space some proofs are omitted in this paper and can be found in [3].

2 Preliminaries

Let \(G=(V,E)\) be a graph. A k -coloring of G is a partition \(\{V_0, V_1, \dots , V_{k-1}\}\) of V. The integers \(0, 1, \dots , k-1\) are called colors and G is called a k -colored graph. For each vertex \(v \in V_i\) we denote by col(v) the color i of v.

Let S be a set of distinct points in the plane. For any point \(p \in S\), we denote by x(p) and y(p) the x- and y-coordinates of p, respectively. We denote by CH(S) the convex hull of S. Throughout the paper we always assume that the points of S have different x-coordinates (if not we can rotate the plane so to achieve this condition). A k -coloring of S is a partition \(\{S_0, S_1, \dots , S_{k-1}\}\) of S. A set of points S with a k-coloring is called a k -colored point set. For each point \(p \in S_i\), col(p) denotes the color i of p. A k-colored point set S is compatible with a k-colored graph G if \(|V_i| = |S_i|\) for every i. If G is planar we say that G has a topological point-set embedding on S if there exists a planar drawing of G such that: (i) every vertex v is mapped to a distinct point p of S with \(col(p)=col(v)\), (ii) each edge e of G is drawn as simple Jordan arc. We say that G has a k -colored point-set embedding on S if there exists a planar drawing of G such that: (i) every vertex v is mapped to a distinct point p of S with \(col(p)=col(v)\), (ii) each edge e of G is drawn as a polyline \(\lambda \). A point shared by any two consecutive segments of \(\lambda \) is called a bend of e. The maximum number of bends along an edge is the curve complexity of the k-colored point-set embedding. A k -colored sequence \(\sigma \) is a sequence of (possibly repeated) colors \(c_0\), \(c_1\), \(\dots \), \(c_{n-1}\) such that \(0 \le c_j \le k-1\) (\(0 \le j \le n-1\)). We say that \(\sigma \) is compatible with a k-colored graph G if color i occurs \(|V_i|\) times in \(\sigma \). Let S be a k-colored point set. Let \(p_0, \dots , p_{n-1}\) be the points of S with \(x(p_0)< \ldots < x(p_{n-1})\). The k-colored sequence \(col(p_0), \dots col(p_{n-1})\) is called the k -colored sequence induced by S, and is denoted as seq(S). A set of points S is one-sided convex if they are in convex position and the two points with minimum and maximum x-coordinate are consecutive along CH(S). In a k-colored one-sided convex point set, the sequence of colors encountered clockwise along CH(S), starting from the point with minimum x-coordinate, coincides with seq(S).

A Hamiltonian cycle of a graph G is a simple cycle that contains all vertices of G. A graph G that admits a Hamiltonian cycle is said to be Hamiltonian. A planar graph G is sub-Hamiltonian if either G is Hamiltonian or G can be augmented with dummy edges (but not with dummy vertices) to a graph \(\mathsf {aug}(G)\) that is Hamiltonian and planar. A subdivision of a graph G is a graph obtained from G by replacing each edge by a path with at least one edge. Internal vertices on such a path are called division vertices. Every planar graph has a subdivision that is sub-Hamiltonian. Let G be a planar graph and let \(\mathsf {sub}(G)\) be a sub-Hamiltonian subdivision of G. The graph \(\mathsf {aug}(\mathsf {sub}(G))\) is called a Hamiltonian augmentation of G and will be denoted as \(\mathsf {Ham}(G)\). Let \(\mathcal C\) be the Hamiltonian cycle of a Hamiltonian augmentation \(\mathsf {Ham}(G)\) of G. Let e be an edge of \(\mathcal C\), let \(\mathcal P= \mathcal C\setminus e\) be the Hamiltonian path obtained by removing e from \(\mathcal C\), and let \(v_0,v_1,\dots ,v_{n'-1}\) be the vertices of G in the order they appear along \(\mathcal P\). Finally, let \(\sigma =c_0,c_1,\dots , c_{n'-1}\) be a k-colored sequence. \(\mathcal P\) is a k -colored Hamiltonian path consistent with \(\sigma \) if \(\mathrm {col}(v_i)=c_i\) (\(0 \le i \le n'-1\)). \(\mathcal C\) is a k -colored Hamiltonian cycle consistent with \(\sigma \) if there exists an edge \(e \in \mathcal C\) such that \(\mathcal P= \mathcal C\setminus e\) is a k-colored Hamiltonian path consistent with \(\sigma \). \(\mathsf {Ham}(G)\) is called a k -colored Hamiltonian augmentation of G consistent with \(\sigma \). The following theorem has been proved in [2] (see also [1, 6]).

Theorem 1

[2] Let G be a k-colored planar graph and S be a k-colored point set consistent with G. If G has a k-colored Hamiltonian augmentation consistent with seq(S) and at most d division vertices per edge then G admits a k-colored point-set embedding on S with at most \(2d+1\) bends per edge.

The next lemma can be easily derived from Theorem 1.

Lemma 1

Let G be a k-colored graph, and S be a k-colored one-sided convex point set compatible with G. If G has a topological k-colored point-set embedding on S such that each edge crosses CH(S) at most b times, then G admits a k-colored point-set embedding on S with at most \(2b+1\) bends per edge.

Let \(G=(V,E)\) be a planar graph. A topological book embedding of G is a planar drawing such that all vertices of G are represented as points of a horizontal line \(\ell \), called the spine. Each of the half-planes defined by \(\ell \) is a page. Each edge of a topological book embedding is either in the top page, or completely in the bottom page, or it can be on both pages, in which case it crosses the spine. Each crossing between an edge and the spine is called a spine crossing. It is also assumed that in a topological book embedding every edge consists of one or more circular arcs, such that no two consecutive arcs are in the same pageFootnote 1. Let G be a k-colored graph and let \(\sigma \) be a k-colored sequence compatible with G. A topological book embedding of G is consistent with \(\sigma \) if the sequence of vertex colors along the spine coincides with \(\sigma \). Let S be a k-colored point set compatible with a k-colored planar graph G and let seq(S) be the k-colored sequence induced by S. The following lemma can be proved similarly to Lemma 1.

Lemma 2

If G admits a topological book embedding consistent with seq(S) and having at most h spine crossing per edge, then G admits a point-set embedding on S with curve complexity at most \(2h +1\).

3 Point-Set Embeddings of Stars

In this section we establish that a 3-colored point-set embedding of a forest of three stars may require \(\varOmega (n^{\frac{1}{3}})\) bends along \(\varOmega (n^{\frac{2}{3}})\) edges by exploiting a previous result about biconnected outerplanar graphs. We start by recalling the result in [2]. An alternating point set \(S_n\) is a 3-colored one-sided convex point set such that: (i) \(S_n\) has n points for each color 0, 1, and 2, and (ii) when going along the convex hull \(CH(S_n)\) of \(S_n\) in clockwise order, the sequence of colors encountered is \(0,1,2,0,1,2,\ldots \). Each set of consecutive points colored 0, 1, 2 is called a triplet.

Fig. 1.
figure 1

A 3-fan \(G_n\) for \(n=12\).

A 3-fan, denoted as \(G_n\), is a 3-colored outerplanar graph with 3n vertices (\(n \ge 2\)) and defined as follows. \(G_n\) consists of a simple cycle formed by n vertices of color 0, followed (in the counterclockwise order) by n vertices of color 1, followed by n vertices of color 2. The vertex of color i adjacent in the cycle to a vertex of color \(i-1\) (indices taken modulo 3) is denoted as \(v_i\). Also, in \(G_n\) every vertex colored i is adjacent to \(v_i\) (\(i=0,1,2\)) and vertices \(v_0,v_1,v_2\) form a 3-cycle of \(G_n\). See, e.g. Fig. 1. The following theorem has been proved in [2].

Theorem 2

[2] Let h be a positive integer and let \(G_n\) be a 3-fan for \(n \ge 79 h^3\), and let \(S_n\) be an alternating point set compatible with \(G_n\). In every 3-colored point-set embedding of \(G_n\) on \(S_n\) there is one edge with more than h bends.

The forest of stars that we use to establish our lower bound is called a 3-sky and is denoted by \(F_n\). It consists of three stars \(T_0\), \(T_1\), \(T_2\) such that: (i) each \(T_i\) (\(i=0,1,2\)) has n vertices (\(n \ge 2\)); (ii) all the vertices of each \(T_i\) (\(i=0,1,2\)) have the same color i.

Let \(\varGamma _n\) be a point-set embedding of \(F_n\) on \(S_n\). An uncrossed triplet of \(\varGamma _n\) is a triplet \(p_i, p_{i+1}, p_{i+2}\) of points of \(S_n\) such that, when moving along \(CH(S_n)\) in clockwise order, no edge of \(\varGamma _n\) crosses \(CH(S_n)\) between \(p_i\) and \(p_{i+1}\) and between \(p_{i+1}\) and \(p_{i+2}\). A triplet is crossed k times if the total number of times that \(CH(S_n)\) is crossed by some edges between \(p_i\) and \(p_{i+1}\) and between \(p_{i+1}\) and \(p_{i+2}\) is k. A leaf triplet of \(\varGamma _n\) is a triplet of \(S_n\) whose points represent leaves of \(F_n\). Analogously, a root triplet is a triplet of \(S_n\) whose points represent the three roots of \(F_n\). The following lemma establishes the first relationship between the curve complexity of some special types of 3-colored point-set embeddings of \(F_n\) and those of a 3-fan \(G_n\).

Lemma 3

Let \(F_n\) be a 3-sky, \(S_n\) be an alternating point set compatible with \(F_n\), and \(\varGamma _n\) be a 3-colored topological point-set embedding of \(F_n\) on \(S_n\). If \(\varGamma _n\) has an uncrossed leaf triplet and each edge of \(\varGamma _n\) crosses \(CH(S_n)\) at most b times, then the 3-fan \(G_n\) has a 3-colored topological point-set embedding on \(S_n\) such that each edge crosses \(CH(S_n)\) at most \(3b + 2\) times.

Proof

We show how to use \(\varGamma _n\) to construct a topological point-set embedding of the 3-fan \(G_n\) on \(S_n\) with at most \(3b + 2\) crossings of \(CH(S_n)\) per edge.

Let \(p_j, p_{j+1}, p_{j+2}\) be an uncrossed leaf triplet. Every point of the triplet represents a leaf of a different star (because they have different color). Denote by \(q_i\) the point of \(\varGamma _n\) representing the root of \(T_i\) (\(i=0,1,2\)) and denote by \(e_i\) the edge connecting \(q_i\) to \(p_{j+i}\). The idea is to connect the three points \(q_0,q_1,q_2\) with a 3-cycle that does not cross any existing edges. For each edge \(e_i\) we draw two curves that from \(q_i\) run very close to \(e_i\) until they reach \(CH(S_n)\). The two curves are drawn on the same side of \(e_i\) such that they are consecutive in the circular order of the edges around \(q_i\) (see Fig. 2(a) for an illustration). These two curves do not intersect any existing edges and cross \(CH(S_n)\) the same number of times as \(e_i\). The six drawn curves are now suitably connected to realize a cycle C connecting \(q_0,q_1,q_2\). Depending on which side the various curves reach \(CH(S_n)\), the connections are different. However in all cases we can connect two curves to form a single edge by crossing \(CH(S_n)\) at most two additional times and without violating planarity (see Fig. 2(b), (c) and (d)). Thus, we have added to \(\varGamma _n\) three edges \(e'_i\) connecting \(q_i\) to \(q_{i+1}\) (indices taken modulo 3), each crossing \(CH(S_n)\) at most \(2b+2\) times. Also, since the two curves that follow an edge \(e_i\) are both drawn on the same side of \(e_i\), the cycle C does not have any vertices inside. Notice that, depending on the case with respect to the connection of the curves, \(q_0\), \(q_1\), and \(q_2\) appear along C either in the clockwise or in the counterclockwise order. W.l.o.g. we assume that the clockwise order is \(q_0\), \(q_1\), and \(q_2\).

Fig. 2.
figure 2

Insertion of a cycle connecting \(q_0\), \(q_1\) and \(q_2\). (a) Drawing of the curves following the edge \(e_1\). (b), (c), and (d) Connection of the six curves to form a cycle.

The obtained drawing is not yet a topological point-set embedding of \(G_n\) because the cycle \(C'\) connecting all the vertices is missing. We first add edges connecting leaves of the same color. Let \(e'_i=\overline{e}_0,\overline{e}_1,\dots ,\overline{e}_{n-2}=e'_{i-1}\) be the edges incident to \(q_i\) in the circular order around \(q_i\) (this is the counterclockwise order under our assumption that \(q_0\), \(q_1\), and \(q_2\) are located in the clockwise order along C). We add an edge between the leaf of \(\overline{e}_j\) and the leaf of \(\overline{e}_{j+1}\) (for \(j=0,1,\dots ,n-3\)) as follows. Starting from the leaf of \(\overline{e}_j\), we draw a curve following the edge \(\overline{e}_j\) until we arrive very close to \(q_{i}\) and then we follow \(\overline{e}_{j+1}\) until we reach the leaf of \(\overline{e}_{j+1}\). The added edges do not cross any existing edges and cross \(CH(S_n)\) a number of times equal to the number of times that \(\overline{e}_j\) crosses \(CH(S_n)\) plus the number of times that \(\overline{e}_{j+1}\) crosses \(CH(S_n)\), so at most 2b.

It remains to add the edges of \(C'\) connecting vertices of different colors. There are three such edges and they connect vertex \(v_i\) (\(i=0,1,2\)) of \(G_n\) to a vertex of color \(i+1\) (indices taken modulo 3). We add an edge connecting \(q_i\) to a leaf of color \(i+1\) as follows. Let \(e''_{i+1}\) be the edge incident to \(q_{i+1}\) that follows \(e'_i\) in the clockwise order around \(q_{i+1}\) (this is an edge connecting \(q_{i+1}\) to a leaf of color \(i+1\)). Starting from \(q_i\) we draw a curve following the edge \(e'_i\) until we arrive very close to \(q_{i+1}\) and then we follow \(e''_{i+1}\) until we reach the leaf of \(e''_{i+1}\). The constructed curve connects \(q_{i}\) to a leaf of color \(i+1\) and does not cross any existing edge. It crosses \(CH(S_n)\) at most the number of times that \(e'_{i+1}\) crosses \(CH(S_n)\) (that is \(2b+2\)) plus the number of times that \(e''_{i+1}\) crosses \(CH(S_n)\) (that is b). Thus the total number of crossing of \(CH(S_n)\) is at most \(3b+2\).   \(\square \)

The next two lemmas explain how to obtain a 3-colored topological book embedding that satisfies Lemma 3.

Lemma 4

Let \(F_n\) be a 3-sky, \(S_n\) be an alternating point set compatible with \(F_n\), and \(\varGamma _n\) be a 3-colored topological point-set embedding of \(F_n\) on \(S_n\) with a root triplet. If \(\varGamma _n\) has a leaf triplet \(\tau \) that is crossed c times (\(c < n\)) and each edge crosses \(CH(S_{n})\) at most b times, then there exists a 3-sky \(F_{n'}\) which is a subgraph of \(F_n\) and an alternating point set \(S_{n'}\) which is a subset of \(S_n\) such that: (i) \(n' \ge n-c\); (ii) there exists a 3-colored topological point-set embedding \(\varGamma _{n'}\) of \(F_{n'}\) on \(S_{n'}\) such that each edge crosses \(CH(S_{n'})\) at most \(b+1\) times; (iii) \(\tau \) is an uncrossed leaf triplet of \(\varGamma _{n'}\).

Lemma 5

Let \(F_n\) be a 3-sky, \(S_n\) be an alternating point set compatible with \(F_n\), and \(\varGamma _n\) be a 3-colored topological point-set embedding of \(F_n\) on \(S_n\). If each edge of \(\varGamma _n\) crosses \(CH(S_n)\) at most b times, then there exists a 3-sky \(F_{n'}\) which is a subgraph of \(F_n\) and an alternating point set \(S_{n'}\) which is a subset of \(S_n\) such that: (i) \(n' \ge \frac{n}{3}-3\); (ii) there exists a 3-colored topological point-set embedding \(\varGamma _{n'}\) of \(F_{n'}\) on \(S_{n'}\) such that each edge crosses \(CH(S_{n'})\) at most \(b+2\) times; (iii) \(\varGamma _{n'}\) has a root triplet.

Lemma 6

Let h be a positive integer, \(F_n\) be a 3-sky for \(n = 520710h^3\), and \(S_n\) be an alternating point set compatible with \(F_n\). In every 3-colored point-set embedding of \(F_n\) on \(S_n\) there exist at least \(h^2\) edges with more than h bends.

Proof

(sketch). Let \(F_{n_i}\), \(i=1,2,\dots ,h^2\), be a 3-sky for \(n_i=520689 h^3+21h \cdot i\) and let \(S_{n_i}\) be an alternating point set compatible with \(F_{n_i}\). We prove by induction on i that in every 3-colored point-set embedding of \(F_{n_i}\) on \(S_{n_i}\) there exist i edges with more than h bends. Notice that for \(i=h^2\), we have \(n_i=n\).

Base case: \(i=1\) : We have to prove that in any 3-colored point-set embedding of \(F_{n_1}\) on \(S_{n_1}\) with \(n_1=520689 h^3+21h\), there exists one edge with more than h bends. Suppose as a contradiction that there exists a 3-colored point-set embedding \(\varGamma _{n_1}\) of \(F_{n_1}\) on \(S_{n_1}\) with curve complexity h. \(\varGamma _{n_1}\) is also a 3-colored topological point-set embedding of \(F_{n_1}\) on \(S_{n_1}\) such that each edge crosses \(CH(S_{n_1})\) at most 2h times (each edge consists of at most \(h+1\) segments). By Lemma 5 there exists a 3-colored point-set embedding \(\varGamma _{n'}\) of a 3-sky \(F_{n'}\) on an alternating point set \(S_{n'}\) such that: (i) \(n' \ge \frac{n_1}{3}\); (ii) each edge of \(\varGamma _{n'}\) crosses \(CH(S_{n'})\) at most \(2h+2\) times; (iii) \(\varGamma _{n'}\) has a root triplet.

Since each edge of \(\varGamma _{n'}\) crosses \(CH(S_{n'})\) at most \(2h+2\) times and there are \(3(n'-1)\ge n_1-3\) edges in total, there are at most \((2h+2)(n_1-3)\) crossings of \(CH(S_{n_1})\) in total. The number of leaf triplets in \(\varGamma _{n'}\) is \(n'-1 \ge \frac{n_1}{3}-1\). It follows that there is at least one leaf triplet \(\tau \) crossed at most \(\frac{3(2h+2)(n_1-3)}{(n_1-3)} = 6h+6 \le 7h\) times. By Lemma 4 there exists a 3-colored point-set embedding \(\varGamma _{n''}\) of a 3-sky \(F_{n''}\) on an alternating point set \(S_{n''}\) such that: (i) \(n'' \ge n'- 7h\); (ii) each edge of \(\varGamma _{n''}\) crosses \(S_{n''}\) at most \(2h+3\) times; (iii) \(\tau \) is uncrossed. By Lemma 3, the 3-fan \(G_{n''}\) has a 3-colored topological point-set embedding on \(S_{n''}\) such that each edge crosses \(CH(S_{n''})\) at most \(6h+11\) times and by Lemma 1 a 3-colored point set embedding with curve complexity at most \(12h+23\). On the other hand, since \(n_1 = 520689 h^3+21h\), we have that \(n'' \ge n'-7h \ge \frac{n_1}{3}-7h = \frac{520689 h^3 +21 h}{3}-7h=\frac{520689}{3}h^3 \ge \frac{520689}{3}h^3=79 (13h)^3\) and by Theorem 2, in every 3-colored point-set embedding of \(G_{n''}\) on \(S_{n''}\) at least one edge that has more than 13h bends – a contradiction.

Inductive step: \(i>1\) . We have to prove that in any 3-colored point-set embedding of \(F_{n_i}\) on \(S_{n_i}\) with \(n_i=520689 h^3+21h \cdot i\), there exist i edges with more than h bends.

We first prove that there exists at least one edge with more than h bends. Suppose as a contradiction that there exists a 3-colored point-set embedding \(\varGamma _{n_i}\) of \(F_{n_i}\) on \(S_{n_i}\) with curve complexity h. With the same reasoning as in the base case, there would exist a 3-colored point set embedding with curve complexity at most \(12h+23\) of a 3-fan \(G_{n''}\), with \(n'' \ge \frac{n_i}{3}-7h\). Since \(n_i = 520689 h^3+21h \cdot i\), we have that \(n'' \ge \frac{n_i}{3}-7h = \frac{520689 h^3 +21 h\cdot i}{3}-7h=\frac{520689}{3}h^3+7h(i-1) \ge \frac{520689}{3}h^3=79 (13h)^3\) and by Theorem 2, in every 3-colored point-set embedding of \(G_{n''}\) on \(S_{n''}\) at least one edge has more than 13h bends – again a contradiction.

This proves that there is at least one edge e crossed more than h times. We now remove this edge and the whole triplet that contains the point representing the leaf of e. We then arbitrarily remove \(21h-1\) triplets. The resulting drawing is a 3-colored point-set embedding \(\varGamma _{n'''}\) of \(F_{n'''}\) on \(S_{n'''}\) for \(n'''=n_{i-1}\). By induction, it contains \(i-1\) edges each having more than h bends. It follows that \(\varGamma _{n_i}\) has i edges each having more than h bends. Since for \(i=h^2\) we have \(n_i=n\), the statement follows.    \(\square \)

Theorem 3

For sufficiently large n, there exists a 3-colored forest \(F_n\) consisting of three monochromatic stars with n vertices and a 3-colored point set \(S_n\) in convex position compatible with \(F_n\) such that any 3-colored point-set embedding of \(F_n\) on \(S_n\) has \(\varOmega (n^{\frac{2}{3}})\) edges having \(\varOmega (n^{\frac{1}{3}})\) bends.

We conclude this section with some results deriving from Theorem 3 and/or related to it. Firstly, Theorem 3 extends the result of Theorem 2 since it implies that a 3-colored point set embedding of \(G_n\) may require \(\varOmega (n^{\frac{2}{3}})\) edges with \(\varOmega (n^{\frac{1}{3}})\) bends each. Moreover, the result of Theorem 3 implies an analogous result for a k-colored forest of at least three stars for every \(k \ge 3\). In particular, when \(k=n\) we have the following result that extends the one by Pach and Wenger [9].

Corollary 1

Let F be a forest of three n-vertex stars. Every planar drawing of F with vertices at fixed vertex locations has \(\varOmega (n^{\frac{2}{3}})\) edges with \(\varOmega (n^{\frac{1}{3}})\) bends each.

One may wonder whether the lower bound of Theorem 3 also holds when the number of colors or the number of stars is less than three. However, it is immediate to see that this is not the case, i.e., the following theorem holds.

Theorem 4

Let F be a k-colored forest of h stars and S be a set of points compatible with F. If \(\max \{k,h\}=2\) then F has a k-colored point-set embedding on S with curve complexity at most 2.

Since a caterpillar can be regarded as a set of stars whose roots are connected in a path, the lower bound of Theorem 3 also holds for caterpillars. This answers an open problem in [1] about the curve complexity of k-colored point-set embeddings of trees for \(k \ge 3\). Note that O(1) curve complexity for 2-colored outerplanar graphs has been proved in [2].

Corollary 2

For sufficiently large n, a 3-colored point-set embedding of a 3-colored caterpillar may require \(\varOmega (n^{\frac{2}{3}})\) edges having \(\varOmega (n^{\frac{1}{3}})\) bends.

4 Point-Set Embeddings of Paths and Caterpillars

In the light of Corollary 2, one may ask whether there exist subclasses of 3-colored caterpillars for which constant curve complexity can be guaranteed. In this section we first prove that this is the case for 3-colored paths and then we extend the result to 3-colored caterpillars whose leaves all have the same color.

Based on Lemma 2, we prove that a 3-colored path P has a topological book embedding consistent with seq(S) and having a constant number of spine crossings. Namely, we first remove the vertices and points of one color from P and S, obtaining a 2-colored path \(P'\) and a compatible 2-colored point set \(S'\). Next, we construct a topological book embedding \(\gamma _{P'}\) of \(P'\) consistent with \(seq(S')\) with at most two spine crossings per edge and with suitable properties. Then we use such properties to reinsert the third color and obtain a topological book embedding of P consistent with seq(S).

\(P'\) and \(\sigma '=seq(S')\) can be regarded as two binary strings of the same size where one color is represented by bit 0 and the other one by bit 1. \(P'\) and \(\sigma '\) are balanced if the number of 0’s (1’s, resp.) in \(P'\) equals the number of 0’s (1’s, resp.) in \(\sigma '\). \(P'\) and \(\sigma '\) are a minimally balanced pair if there does not exist a prefix of \(P'\) and a corresponding prefix of \(\sigma '\) that are balanced.

Lemma 7

Let P and \(\sigma \) be a minimally balanced pair of length \(k>1\). Let \(b_j(P)\) denote the j-th bit of P and \(b_j(\sigma )\) denote the j-th bit of \(\sigma \). Then \(b_1(P) \ne b_k(P)\), \(b_k(P) = b_1(\sigma )\), and \(b_1(P) = b_k(\sigma )\).

Let \(\varGamma \) be a topological book embedding, \(\ell \) be the spine of \(\varGamma \), and p be a point of \(\ell \) (possibly representing a vertex). We say that p is visible from above (below) if the vertical ray with origin at p and lying in the top (bottom) page does not intersect any edge of \(\varGamma \). We say that the segment \(\overline{pq}\) is visible from above (below) if each point r in the segment is visible from above (below). Let u and v be two vertices of \(\varGamma \) that are consecutive along the spine \(\ell \), we say that segment \(\overline{uv}\) is accessible if it contains a segment that is visible from below. A vertex v of \(\varGamma \) is hook visible if there exists a segment \(\overline{pq}\) of the spine such that \(\overline{pq}\) is visible from below and for any point r of \(\overline{pq}\) we can add an edge in the top page of \(\varGamma \) connecting v with r without crossing any other edges of \(\varGamma \) (see Fig. 3(a)); \(\overline{pq}\) is the access interval for vertex v. If the access interval is to the right (left) of v we say that v is hook visible from the right (left).

Fig. 3.
figure 3

(a) Illustration of the hook visibility property. The bold segment is the access interval. (b)-(d) Proof of Lemma 8: (b) Base cas; (c) Case 1; (d) Case 2.

Lemma 8

Let P be a 2-colored path and \(\sigma \) be a 2-colored sequence compatible with P. Path P admits a topological book embedding \(\gamma \) consistent with \(\sigma \) and with the following properties: (a) Every edge of \(\gamma \) crosses the spine at least once and at most twice. (b) For any two vertices u and v that are consecutive along the spine \(\ell \) of \(\gamma \), segment \(\overline{uv}\) is accessible from below. (c) Every spine crossing is visible from below. (d) The first vertex \(v_1\) of P is visible from above; the last vertex \(v_n\) of P is hook visible from the right; to the right of its access interval there is only one vertex and no spine crossing.

Proof

We prove the statement by induction on the length n of P (and of \(\sigma \)). If \(n=1\) the statement trivially holds. If \(n=2\) we draw the unique edge of P with one spine crossing immediately to the left of the leftmost vertex in the drawing (see Fig. 3(b)). Also in this case the statement holds. Suppose that \(n>2\) and that the statement holds for every \(k<n\). We distinguish between two cases.

Case 1: P and \(\sigma \) are a minimally balanced pair. By Lemma 7 the first vertex of P has the same color as the last element of \(\sigma \), the last element of P has the same color as the first element of \(\sigma \) and these two colors are different. This means that by removing the first and the last elements from both P and \(\sigma \), we obtain a new 2-colored path \(P'\) of length \(n-2\) and a new 2-colored sequence \(\sigma '\) compatible with \(P'\). By induction, \(P'\) admits a topological book embedding \(\gamma '\) consistent with \(\sigma '\) and satisfying properties (a)–(d). To create a topological book embedding of P consistent with \(\sigma \), we add a point \(p_1\) before all the points of \(\gamma '\), whose color is the same as the last vertex \(v_n\) of P, and a point \(p_2\) after all points of \(\gamma '\), whose color is the same as the first vertex \(v_1\) of P. Vertex \(v_1\) is mapped to \(p_2\) and vertex \(v_n\) is mapped to \(p_1\). We connect \(v_1\) to the first vertex \(u_1\) of \(P'\) with an edge incident to \(p_2\) from above, crossing the spine once immediately before \(p_1\) and once immediately after \(p_1\) and arriving to \(u_1\) from above (by property (d), \(u_1\) is visible from above). We then connect the last vertex \(u_{n'}\) of \(P'\) to \(v_n\). Since \(u_{n'}\) is hook visible by property (d), we connect it to \(v_n\) with an edge that starting from \(u_{n'}\) reaches the access interval of \(u_{n'}\), crosses the spine between the last vertex of \(\gamma '\) and \(p_2\) and reaches \(p_1\) from above. As shown in Fig. 3(c) the two edges \((v_1,u_1)\) and \((u_{n'},v_n)\) can be added without creating any crossing. Property (a) holds by construction. About properties (b) and (c), we added two arcs in the bottom page. The first one connects a point immediately before \(v_n\) and a point immediately after it, so the segment of the spine between \(v_n\) and its following vertex is accessible from below; also, the addition of this arc does not change the accessibility of the spine crossing of \(\gamma '\). The second arc added in the bottom page connects a point q in the access interval of \(u_{n'}\) with a point immediately after \(u_1\); by property (d) of \(\gamma '\) there is no vertex or spine crossings between q and \(u_1\). Thus the segments connecting \(u_1\) to its preceding and to its following vertices are visible from below and property (b) holds; furthermore the addition of this arc does not change the accessibility to existing spine crossings. Since the new created spine crossings are visible from below, property (c) also holds. It is immediate to see that also property (d) holds; see for example Fig. 3(c).

Case 2: P and \(\sigma \) are not a minimally balanced pair. In this case there exists a prefix (i.e. a subpath) \(P'\) of P and a corresponding prefix \(\sigma '\) of \(\sigma \) that are balanced. \(P'\) is 2-colored path and \(\sigma '\) is a 2-colored sequence compatible with \(P'\) and their length is less than n. By induction, \(P'\) admits a topological book embedding \(\gamma '\) consistent with \(\sigma '\) and statisfying properties (a)–(d). On the other hand, \(P''=P\setminus P'\) is also a 2-colored path and \(\sigma ''=\sigma \setminus \sigma '\) is a 2-colored sequence consistent with \(P''\). Thus, \(P''\) also admits a topological book embedding \(\gamma ''\) consistent with \(\sigma ''\) and statisfying properties (a)–(d). Since the last vertex \(u_n\) of \(P'\) is hook visible in \(\gamma '\) and the first vertex \(w_1\) of \(P''\) is visible from above in \(\gamma ''\), the two vertices can be connected with an edge that crosses the spine twice (see Fig. 3(d)), thus creating a topological book embedding \(\gamma \) of P consistent with \(\sigma \). Property (a) holds by construction. The only arc added in the bottom page connects a point q in the access interval of \(u_n\) and a point \(q'\) immediately after the first vertex \(u_1\) of \(P'\). By property (d) of \(\gamma '\) there is no vertex or spine crossing between q and \(u_1\) and between \(u_1\) and \(q'\), thus properties (b) and (c) hold for \(\gamma \). Property (d) holds because it holds for \(\gamma '\) and \(\gamma ''\).    \(\square \)

Lemma 9

A 3-colored path admits a topological book embedding with at most two spine crossings per edge consistent with any compatible 3-colored sequence.

Proof

(sketch). Let \(c_2\) be a color distinct from the colors of the end-vertices of P. Let \(v_1,v_2,\dots ,v_k\) be a maximal subpath of P colored \(c_2\). Let \(u_1\) and \(u_2\) be the vertices along P before \(v_1\) and after \(v_k\), respectively. We replace the subpath \(u_1,v_1,v_2,\dots ,v_k,u_2\) with an edge \((u_1,u_2)\). We do the same for every maximal subpath colored \(c_2\). Let \(P'\) be the resulting 2-colored path and \(\sigma '\) be the 2-colored sequence obtained from \(\sigma \) by removing all elements of color \(c_2\).

By Lemma 8, \(P'\) admits a topological book embedding \(\gamma '\) consistent with \(\sigma '\) that satisfies properties (a), (b), (c) and (d). We add to \(\gamma '\) a set Q of points colored \(c_2\) to represent the removed vertices that will be added back. These points must be placed so that the sequence of colors along the spine coincides with \(\sigma \). By property (b) of \(\gamma '\) all these points can be placed so that they are accessible from below. We now have to replace some edges of \(P'\) with paths of vertices colored \(c_2\). Let \((u_1,u_2)\) be an edge that has to be replaced by a path \(u_1,v_1,v_2,\dots ,v_k,u_2\). For each vertex \(v_i\) to be added (\(i=1,2,\dots ,k\)) we add an image point to the drawing. The image points are added as follows. By property (a), the edge \((u_1,u_2)\) crosess the spine at least once. Let \(\chi \) be the point where \((u_1,u_2)\) crosses the spine for the first time when going from \(u_1\) to \(u_2\). By property (c) \(\chi \) is visible from below. This means there is a segment s of \(\ell \) with \(\chi \) as an endpoint that is visibile from below. We place \(k-1\) image points \(p_1,p_2,\dots ,p_{k-1}\) inside this segment, while \(\chi \) is the k-th image point \(p_k\) (it is the leftmost if s is to the left of \(\chi \), while it is the rightmost if s is to the right of \(\chi \)). The first arc of the edge \((u_1,u_2)\) is replaced by an arc connecting \(u_1\) to \(p_1\). Each image point \(p_i\) is connected to the \(p_{i+1}\) (\(i=1,2,k-1\)) by means of an arc in the top page. Finally, the last image point \(p_k\) is already connected to \(u_2\) by means of the remaining part of the original edge \((u_1,u_2)\). Notice that the edge \((u_1,p_1)\) does not cross the spine, and the same is true for any edge \((p_i,p_{i+1})\), while the edge \((p_k,u_2)\) crosses the spine at most once (the original edge had at most two spine crossing one of which was at \(\chi =p_k\)). We have replaced the edge \((u_1,u_2)\) with a path \(\pi =\langle u_1, p_1,p_2,\dots ,p_k, u_2 \rangle \) with \(k+1\) edges, as needed. However, the points representing the intermediate vertices of this path are not the points of the set Q. The idea then is to “connect” the image points to the points of Q. To this aim, we add matching edges in the bottom page between the image points and the points of Q. Since both the points of Q and the image points are visible from below, these matching edges do not cross any other existing edge. Moreover, by using a simple brackets matching algorithm, we can add the matching edges so that they do not cross each other. Finally the matching edges can be used to create the actual path that represent \(u_1,v_1,v_2,\dots ,v_k,u_2\).    \(\square \)

The following theorem is a consequence of Lemmas 2 and 9.

Theorem 5

Every 3-colored path admits a 3-colored point-set embedding with curve complexity at most 5 on any compatible 3-colored point set.

Theorem 5 can be extended to a subclass of 3-colored caterpillars.

Theorem 6

Every 3-colored caterpillar with monochromatic leaves admits a 3-colored point-set embedding with curve complexity at most 5 on any compatible 3-colored point set.

The above results motivate the study of 4-colored graphs, in particular a natural question is whether 4-colored paths admit point-set embedding on any set of points with constant curve complexity.

Theorem 7

Let P be a 4-colored path with n vertices and let S be a 4-colored point set compatible with P. If the first \(h \ge 2\) vertices along P only have two colors and the remaining \(n-h\) only have the other two colors, then P has a 4-colored point-set embedding on S with curve complexity at most 5.

5 Open Problems

Motivated by the results of this paper we suggest the following open problems: (i) Investigate whether the lower bound of Theorem 3 is tight. We recall that an upper bound of O(n) holds for all n-colored planar graphs [9]. (ii) Study whether constant curve complexity can always by guaranteed for 4-colored paths. (iii) Characterize the 3-colored caterpillars that admit a 3-colored point-set embedding with constant curve complexity on any given set of points.