Non-Monochromatic and Conflict-Free Colorings on Tree Spaces and Planar Network Spaces

It is well known that any set of n intervals in R1\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {R} ^1$$\end{document} admits a non-monochromatic coloring with two colors and a conflict-free coloring with three colors. We investigate generalizations of this result to colorings of objects in more complex 1-dimensional spaces, namely so-called tree spaces and planar network spaces.

the topology of an arbitrary graph. It is convenient to view a network space N as being embedded in R 2 , although the embedding is actually immaterial. In this view the nodes of N are points in R 2 , and the edges are simple curves connecting pairs of nodes and otherwise disjoint. We let d : N 2 → R + denote the geodesic distance on N . In other words, for two points p, q ∈ Nthese points may lie in the interior of an edge-we let d(p, q) denote the minimum Euclidean length of any path connecting p to q in N . We consider two special types of network spaces, tree spaces and planar network spaces, whose topology is that of a tree and a planar graph, respectively.
The objective of our paper is to investigate the number of colors needed to CF-or NM-color a set A of n objects in a network space, where we consider various classes of connected objects. (Here CF-and NM-colorings are defined as above: in a CF-coloring, for any point p ∈ N the set S p := {o ∈ A | p ∈ o} of objects containing p should have an object with a unique color when it is non-empty, and in an NM-coloring the set S p should not be monochromatic when it consists of at least two objects.) In particular, we consider balls on N -the ball centered at p ∈ N of radius r is defined as B(p, r) := {q ∈ N | d(p, q) r}-and, for tree spaces, we also consider arbitrary connected subsets as objects. Note that, if the given network space is a single curve, then our setting, both for balls and for connected subspaces, reduces to coloring intervals in R 1 . The main question we want to answer is: How does the maximum number of colors needed to NM-or CF-color a set A of objects in a network space depend on the complexity of the network space and of the objects to be colored?
Our results. We assume without loss of generality that the nodes in our network space either have degree 1 or degree at least 3-there are no nodes of degree 2. Nodes of degree 1 are also called leaves, and nodes of degree at least 3 are also called internal nodes.
We start by considering colorings on a tree space, which we denote by T . Let A be the set of n objects that we wish to color, where each object T ∈ A is a connected subset of T . Note that each such object is itself also a tree. From now on we refer to the objects in A as "trees," and always use "tree space" when talking about T . Observe that internal nodes of a tree are necessarily internal nodes of T , but a tree leaf may lie in the interior of an edge of T . We will investigate CF-and NM-chromatic number of trees on tree space as a function of the following parameters: • k, the number of leaves of the tree space T ; • ℓ, the maximum number of leaves of any tree in A; • n, the number of objects in A.
We define the CF-chromatic number X tree,trees cf (k, ℓ; n) as the minimum number of colors sufficient to CF-color any set A of n trees of at most ℓ leaves each, in a tree space of at most k leaves. The NM-chromatic number X tree,trees nm (k, ℓ; n) is defined similarly. Rows 3 and 4 in Table 1 give our bounds on these chromatic numbers. Notice that the upper bounds do not depend on n. In other words, any set of trees in a tree space can be colored with a number of colors that depends only on the complexity of the tree space T and of the trees in A. (Obviously the number of objects, n, is an upper bound on these chromatic numbers as well. To avoid cluttering the statements, we usually omit this trivial bound.) We also study balls in tree spaces. Here it turns out to be more convenient to not use k (the number of leaves) as the complexity measure of T , but • t, the number of internal nodes of T .
We are interested in the chromatic numbers X tree,balls cf (t; n) and X tree,balls nm (t; n). Rows 5 and 6 of Table 1 state our bounds for these chromatic numbers.
After studying balls in tree spaces, we turn our attention to balls in planar network spaces. Our bounds on the corresponding chromatic numbers X planar,balls cf (t; n) and X planar,balls nm (t; n) are contained in row 7 and 8 of Table 1.
Related results. Above we considered CF-and NM-colorings in a geometric setting, but they can also be defined more abstractly. A CF-coloring on a hypergraph H = (V, E) is a coloring of  the vertex set V such that, for every (non-empty) hyperedge e ∈ E, there is a vertex in e whose color is different from that of the other vertices in e. In a NM-coloring any hyperedge with at least two vertices should not be monochromatic. Smorodinsky's survey [10] also gives an overview of results on CF-colorings in this abstract setting. The basic geometric version mentioned above-coloring objects in R 2 with respect to pointscan be phrased in terms of hypergraphs by letting the objects be the node set V and, for each point p in the plane, creating a hyperedge e := S p . Another avenue for constructing a hypergraph H to be colored is to start with a graph N , let the vertices of H be the nodes of N and create hyperedges for (the sets of vertices of) certain subgraphs of N . For example, Pach and Tardos [7] considered the case where hyperedges are all the node neighborhoods. For this case, Abel et al. [1] recently showed that a planar graph can always be CF-colored with only three colors, if we allow some nodes to be uncolored. (Otherwise, we can use a dummy color, increasing the number of colors to four.) As another example, we let the hyperedges be induced by all the paths in the graph. This setting is equivalent to an older notion of node ranking [2], or ordered coloring [6]. Note that in the above results the goal is to color the nodes of a graph. We, on the other hand, do not want to color nodes, but objects (connected subsets) in a network space (which has a graph topology, but is a geometric object).
Preliminaries: the chain methods.We start by describing a folklore technique, called the chain method, to color intervals in R 1 in a non-monochromatic fashion using at most two colors. We order the intervals left-to-right by their left endpoints (in case of ties, we take the longest interval first) and color them in this order using the so-called active color which is defined as follows. We start with blue as the active color. We color the first interval, then change the active color to red. We then use the following procedure: we color the next interval I in the ordering using the active color, then if the right endpoint of I is not contained in any other already colored interval, we change the active color from red to blue or blue to red.
To obtain a CF-coloring the chain method proceeds as follows. First, the interval with the leftmost left endpoint-in case of ties, the longest such interval-is colored blue. Next, the following procedure is repeated until we get stuck: Let I be the interval colored last. Among all intervals whose left endpoint lies in I and that are not contained in it, color the one extending farthest to the right red (if I is blue) or blue (if I is red). This creates a chain of alternating blue and red intervals. Each remaining interval is now either completely covered by the already colored intervals, or it lies completely to the right of them. The former intervals are given a dummy color (grey), the latter intervals are colored by applying the above procedure again.  using three colors.
Proof. We prove the latter coloring is conflict-free; the proof for the NM-coloring is similar. Consider a point p contained in an interval. It is clear that p is contained in either a red or a blue interval. We suppose without loss of generality it is contained in a red interval I 0 = [a 0 , b 0 ]. We show it is not contained in another red interval. Let us suppose by contradiction that it is contained in another red interval I 1 = [a 1 , b 1 ] with a 1 a 0 . Then p must also be contained in a blue interval I 2 = [a 2 , b 2 ], with a 1 a 2 a 0 . Moreover, we have that b 2 < b 1 . Thus, I 2 starts in I 0 and extends further than I 1 , hence should have been chosen to be colored blue, which is a contradiction. Therefore, p is always contained in at most one red interval, and similarly, in at most one blue interval, and is always contained in a blue or in a red interval. Thus the coloring is conflict-free.

The upper bound
Overview of the coloring procedure. Let T be a tree space with k leaves and let A be a set of n trees in T , each with at most ℓ leaves. We describe an algorithm that NM-colors A in two phases: first, we select a subset C ⊆ A of size at most 6k − 12 and color it with at most min ℓ + 1, 2 √ 6k colors. In the second phase we extend this coloring to the whole set A without using new colors.
An edge e of T is a leaf edge if it is incident to a leaf; the remaining edges are internal. We define C ⊆ A as the set of at most 6k − 12 trees selected as follows. For every pair (e, v), where e is an edge of T and v is an endpoint of e that is not a leaf of T , we choose two trees containing v and extending the furthest into e (if they exist), that is, trees T of A containing v for which length(T ∩ e) is maximal, and place them in A(e, v). If two or more trees of A fully contain e, then A(e, v) contains two of them, chosen arbitrarily. If a tree contains an internal edge e fully, it may be chosen by both endpoints. We now define A(e) := A(e, u) ∪ A(e, v) for each internal edge e = uv, A(e) := A(e, v) for each leaf edge e = uv with non-leaf endpoint v, and C := A(e), with the union taken over all edges e of T . Then A(e) contains at most four trees for any internal edge e and at most two trees for any leaf edge e. If T has at most k leaves, it has at most k leaf edges and at most k − 3 internal edges; recall that T has no degree-two nodes. Thus |C| 6k − 12, as claimed. We first explain how to color C.
Coloring C. We color C in two steps. Let T ∈ C be a tree. We define E(T ) to be the set of edges e of T with T ∈ A(e). Firstly, if ℓ > 2 √ 6k we select all subtrees T with |E(T )| √ 6k, and give each of them a unique color. Since e |A(e)| 6k − 12, there are at most √ 6k − 1 such trees, so we use at most √ 6k − 1 colors. For each uncolored T ∈ C, we create a new tree T ′ , defined as the smallest tree containing e∈E(T ) e ∩ T ; see   The second step is to color C ′ . We need the following lemma, which shows that an NM-coloring of C ′ carries over to C. Lemma 2.1. Any NM-coloring of C ′ corresponds to an NM-coloring of C, that is, if we give each tree T ∈ C the color of the corresponding tree T ′ ∈ C ′ then we obtain an NM-coloring.
Proof. Let q be a point on an edge e of T contained in at least two trees of C (if no such trees exists, the coloring is trivially non-monochromatic at q). Since q is contained in at least two trees of C, it is also contained in two trees of A(e). Call these trees T 1 and T 2 . Note that T 1 either receives a color in the first coloring step-namely, when ℓ > 2 √ 6k and |E(T 1 )| √ k-or T ′ 1 ∈ C ′ contains q, since e ∈ E(T 1 ). A similar statement holds for T 2 . Since the colors used in the first step are unique and C ′ is NM-colored, this implies that T 1 and T 2 have different colors. Hence, C is NM-colored.
Next we show how to NM-color C ′ . Fix an arbitrary internal node r of T and treat T as rooted at r.. Our coloring procedure for C ′ maintains the following invariant: any path from r to a leaf v of T consists of three disjoint consecutive subpaths (some possibly empty), in this order, as illustrated in Fig. 2: • a non-monochromatic subpath containing the root on which at least two trees are colored with at least two different colors, • a singly-colored subpath covered by exactly one colored tree, and • an uncolored subpath containing the leaf on which no tree is colored.
Observation 2.2. Any set of trees containing r and satisfying the invariant described above is NM-colored if we disregard uncolored trees.
We color the trees T ∈ C ′ that contain r in an arbitrary order, using ℓ ′ + 1 colors, as follows: for each leaf v of T , we follow the path from v to the root r to find a singly-colored part. Note that if we find a singly-colored part-by the invariant there is at most one such part on the path from v to r-we cannot use that color for T . Since T has at most ℓ ′ leaves, this eliminates at most ℓ ′ colors. Hence, at least one color remains for T . Lemma 2.3. The procedure described above maintains the invariant and colors all trees of C ′ containing r with at most ℓ ′ + 1 colors.
Proof. Suppose the invariant holds before the coloring of T . Then we need to make sure the invariant still holds after T has been colored. Let w be a leaf of T and π w the path from w to the root. Let v be the closest point to w in π w ∩ T . Note that v always exists as r ∈ π w ∩ T . Now let π v ⊆ π w be the path from v to r. It is obvious that π w ∩ T = π v . Then the part of π v that was uncolored (if it was non-empty) now is singly-colored. The part that was singly-colored now becomes non-monochromatic, as we eliminated that color for T . And the part that was already non-monochromatic stays so. Therefore the invariant is indeed maintained for π w , concluding the proof. r r ′ r ′ r ′ r ′ Figure 3: When recursing on the subspace rooted at r ′ (leftmost), the invariant does not hold anymore (middle left), as the parts are switched on the edge between r and r ′ . To remedy this, we first color the tree extending the farthest into that edge (middle right), starting from r ′ . We then trim the tree to fix the invariant (rightmost).
Once all the trees containing r are colored we delete r from T , that is, we consider the space T \ {r}, and we take the closures of the resulting connected components. This creates a number of subspaces such that each uncolored tree in C ′ is contained in exactly one of them. Consider such a subspace T ′ and let r ′ be the neighbor of r in T ′ . We now want to recursively color the uncolored trees in T ′ , taking r ′ as the root of T ′ . However, the invariant might not hold on the edge e from r ′ to the old root r: Since now r is considered a child of r ′ , the order of the three parts might switch on e-see Fig. 3. Suppose this is the case, and let c e be the color of the singly-colored part on the edge e. (If the singly-colored part is empty, we can cut the tree between the non-monochromatic and the uncolored part and recurse immediately, which maintains the invariant.) Note also that, for the order to switch, the non-monochromatic part needs to end on e, and therefore the only color used in any singly-colored part of the tree rooted at r ′ is c e . We overcome this problem by carefully choosing the order in which we color the trees containing r ′ . Namely, we fist color the tree T extending the farthest into e. In this case, there is only one color forbidden, namely c e . We can therefore easily color T . We can then trim the treespace T ′ to remove any non-monochromatic and singly-colored part and hence restore the invariant and continue with the coloring. Proof. The fact that the procedure above produces an NM-coloring follows from Lemmas 2.1 and 2.3. When ℓ > 2 √ 6k we use √ 6k − 1 colors to deal with trees T with |E(T )| √ 6k and ℓ ′ + 1 min(ℓ, 2 √ 6k) + 1 √ 6k + 1 colors for the other trees, giving 2 √ 6k colors in total. When ℓ 2 √ 6k we do not treat the trees with |E(T )| √ 6k separately, so we just use ℓ ′ + 1 min(ℓ, √ 6k) + 1 ℓ + 1 colors.
Extending the coloring from C to A. Let c : C → N be an NM-coloring on C. We extend the coloring to A as follows. We start by coloring all trees in A \ C containing an internal node of T using an arbitrary color already used. We then treat all edges in an abritrary order, coloring all trees contained in the edge as explained now. Let e = rr ′ be an arbitrary edge of T and A * (e) be the set of uncolored trees contained in e. We color A * (e) as follows. We first color the set of uncolored trees contained in e naively using the chain method. For this we use two new colors, which are used for all chains-we can re-use the same two colors for the chains, since trivially the chains in any two edges e, e ′ do not interact. However, we can avoid using two extra colors and re-use the colors from C as explained next.
First, if c uses fewer than two colors, then each node of T is contained in at most one tree. We then forget the trivial coloring c and use the chain method from scratch on A. We start at a arbitrarily fixed leaf u of T , and for any other leaf u ′ , we consider the path between u and u ′ and use the chain method on the trees restricted to this path. Since for any node v, at most one tree contains v, no tree receives two different colors on two different paths. Moreover, the coloring is conflict-free, since any point in T is contained in a path from u to a certain leaf u ′ .
We may now suppose that c uses at least two colors. Let T r ∈ A(e, r) and T r ′ ∈ A(e, r ′ ), be r r ′ r r ′ Figure 4: If the color of T r ′ changes with the chain method, we swap the labels of the old and new colors of T r ′ in the subspace rooted at r ′ .
the trees extending the farthest into e (arbitrarily chosen in case of a tie). Note that these trees might not exist. Also note that T r and T r ′ are not in A * (e). We define the following colors.
• Let c r be the color of T r , if T r exists, and an arbitrary color otherwise.
• Let c r ′ be the color of T r ′ , if T r ′ exists, and c(T r ′ ) = c(T r ) (if T r does not exist, we assume this is always true), and an arbitrary color different from c r otherwise.
We then do the following.
(a) If T r fully contains e, we color all trees in A * (e) using c r ′ .
(b) If T r ′ fully contains e, we color all trees in A * (e) using c r .
(c) Otherwise, we use the chain method for NM-colorings using c r and c r ′ on A * (e)∪{T r }∪{T r ′ }.
We start from r with color c r so that T r is the first tree colored and keep its color. We then check if the color of T r ′ changed. If so, let C r ′ ⊆ C be the subset of trees contained in the subspace rooted at r ′ (including e but not r) and excluding T r ′ . We exchange c r and c r ′ in C r ′ ; see Fig. 4.
The following lemma proves the extended coloring is non-monochromatic.
Lemma 2.5. Any NM-coloring c on C can be extended to A without using any extra color if c uses two colors or more, and with two colors otherwise.
Proof. Let A 1 be the subset of trees in A \ C that contain an internal node of T , and let A 2 be the remaining trees in A \ C. By Lemma 2.4, we have an NM-coloring on C. To prove that the method described above gives us an NM-coloring on C ∪ A 2 , we show that the following invariant holds each time an edge is colored: the coloring on C ∪ A 2 is non-monochromatic when restricted to colored trees. It is clear that before the first edge is colored, the coloring is non-monochromatic as at this point the only trees colored are exactly those in C. We hence only have to show the invariant still holds after coloring an edge e = {r, r ′ }. If we are in cases (a) or (b), the invariant trivially holds. It remains to consider the third case.
In the case (c) we use the chain method on A * (e) ∪ {T r } ∪ {T r ′ }, which immediately implies the coloring is non-monochromatic on e. To prove it is also non-monochromatic elsewhere, let p / ∈ e be a point contained in at least two trees. Then we only have to show that the label swap we did on one side of e keeps the coloring non-monochromatic. The point p cannot be contained in one tree containing r and one tree containing r ′ at the same time, because no tree contains e fully. Therefore, p is contained in at least two trees from either side of e, hence two trees of different color.
Furthermore, the trees in A 1 received an arbitrary color already used. To prove that this gives an NM-coloring for A = C ∪ A 1 ∪ A 2 , it suffices to prove that each tree T ∈ A 1 is doubly-covered by C, that is, any point q ∈ T is contained in at least two trees in C. To this end, let e be an edge {3, 4} Figure 5: An example of the non-monochromatic lower bound for k = 6, ℓ = 3, and n = 4. The tree T 1 is drawn in red.
such that q ∈ e. Then, since T ∈ C and T contains an endpoint v of e, the two trees in A(e, v) contain q. Hence, T is doubly-covered by C, as claimed.
Proof. For the NM-coloring part of the theorem, we use Lemmas 2.4 and 2.5. For the second part, if ℓ > 2 √ 6k we again reduce C to C ′ using at most √ 6k − 1 colors. Then use the result by Smorodinsky [9] on the NM-coloring on C ′ provided by Lemma 2.3. Since this coloring uses at most ℓ ′ + 1 colors and |C ′ | 6k − 12, the CF-coloring uses O(ℓ log k) colors. We then extend the coloring to A using similar techniques as for the NM-coloring. This coloring uses O( √ k log k) colors if ℓ > 2 √ 6k, which is in O(ℓ log k), and directly O(ℓ log k) colors otherwise. Note that a direct application of the result of Smorodinsty [9] would give a O(ℓ log n) bound instead.

The lower bound
We show a lower bound for the number of colors 1 needed to NM-color a set of trees in a tree space.
Theorem 2.7. For all n, k, and ℓ, there exist a tree space T with k leaves and a set A at most n trees on T , each with at most ℓ leaves, such that any non-monochromatic coloring of A uses at least min ℓ + 1, 1+ √ 1+8k 2 , n colors. In other words, Proof. Let T be a star with k leaves. We construct the set A of m trees such that, for each pair of trees T, T ′ ∈ A, there is a leaf of T contained in T and T ′ , and no other tree from A. Consequently, each tree in A must be assigned a distinct color. To this end, we define m := min(ℓ + 1, m ′ , n), where m ′ := ⌊(1+ √ 1 + 8k)/2⌋ is the largest integer such that m ′ 2 k. Then, for every pair {i, j} with 1 i < j m, we choose a distinct leaf of T and associate it with {i, j}. The total number of such pairs is m 2 m ′ 2 k, hence we can indeed associate a distinct leaf to each pair. Let now A := {T 1 , . . . , T m } be the set of trees defined as follows: for each i = 1, . . . , m, the tree T i is defined as the tree containing all the leaves associated with pairs {i, j} for some j = i, i.e., T i is the union, for all j = i, of edges from the root to a leaf associated with {i, j}. Fig. 5 shows an example. We now have to prove that the construction is possible within the parameters. Recall that m n so we have indeed at most n trees in A, and that m m ′ where m ′ is chosen to ensure k leaves are enough. We therefore only have to show that no tree T i , . . . , T m has more than ℓ leaves. However, the number of leaves of each tree T i is at most m − 1, as we only create at most one leaf for T i for each T j with j = i. Hence, since m ℓ + 1, each tree has at most ℓ leaves. Thus, the construction does not violate the parameters.
Since any CF-coloring is also an NM-coloring, the lower bound in Theorem 2.7 holds for CFcoloring as well. The next theorem gives a stronger lower bound for CF-coloring in the case ℓ = 2, that is, when the objects are paths.
Theorem 2.8. For all n and k, there exist a tree space T with k leaves and a set A of at most n paths in T such that any conflict-free coloring of A uses at least ⌊log 2 min(k, n)⌋ colors. In other words, X tree,paths cf (k; n) ⌊log 2 min(k, n)⌋.
Proof. Let T be a rooted complete binary tree of height h = ⌊log 2 min(k, n)⌋. Note that T has at most min(k, n) leaves. For each leaf v of T , we define π v to be the path from v to the root r of T . Our set A of objects is now defined as A := {π v | v a leaf of T }. (Trivially, |A| n.) Let c : A → N be a conflict-free coloring of A. We prove that c uses at least h = ⌊log 2 min(k, n)⌋ colors by induction on the height h of T . If h = 1, then there is only one degenerate path and the claim trivially holds. Suppose now that the claim holds for a tree of height h, and suppose the height of T is h + 1. Since c is a conflict-free coloring, among the paths containing the root r 1 := r of T , there must be a path π 1 of unique color. Since by construction all paths in A contain the root, the color of π 1 is unique among all paths. Let r 2 be the child of r 1 not contained in π 1 . We now use the induction hypothesis on the subtree rooted at r 2 with paths containing r 2 cut above it. Among these paths, there are h that use distinct colors. Moreover, none of these path can use c(π 1 ), as this color is unique among all paths. Hence, we have indeed h + 1 paths using distinct colors. This concludes the proof.
The following theorem is a direct consequence of the previous two. Theorem 2.9. For all n, k, and ℓ, there exist a tree space T with k leaves and a set A at most n trees in T with at most ℓ leaves each such that any conflict-free coloring of A uses at least min ℓ + 1, 1+ √ 1+8k 2 , ⌊log 2 min(k, n)⌋ colors. In other words,

Balls in Tree Spaces and on Planar Network Spaces
In this section we restrict the objects to balls. Let N be a network space, d : N 2 → R a distance function on N , and let A be a set of balls on N . We define the coverage cov x (B) of a node x by a ball B = B(p, r) containing x as cov x (B) := r − d(p, x). Given a node x contained in at least one ball from A, we define B x as the ball maximizing the coverage of x, where we break ties using an arbitrary but fixed ordering on the balls. We say that B x is assigned to x. Note that B x does not exist if no ball contains x, and that a ball can be assigned to multiple nodes. We will regularly use the following lemma regarding the assigned balls. (i) Suppose N is a tree space, and let T 1 , . . . , T deg(x) denote the subtrees resulting from removing x from N or, more precisely, the closures of the connected components of T \ {x}. Let p be a point in some subtree T i and suppose p is contained in a ball B ∈ A whose center lies in T j with j = i. Then p ∈ B x .
(ii) Suppose x is contained in at least one ball in A. Let π be a shortest path from x to the center of B x , and let y be a node on the path π. Then B x is also assigned to y, that is, B x = B y .
Proof. Part (i) follows immediately from the definition of B x . To prove part (ii), suppose for a contradiction that B y = B x for some y ∈ π. Thus, cov y (B y ) cov y (B x ). Because π is a shortest path from x to the center of B x , we have that cov Thus cov x (B x ) = cov x (B y ) and cov y (B x ) = cov y (B y ). However, this is a contradiction as in case of a tie, we use the fixed ordering to choose which ball to assign to a node.

Tree spaces: the upper bound
For balls on a tree space T , the upper bounds from Theorem 2.6 with ℓ = k apply. Below we improve upon these bounds using the special structures of balls. Let T be a tree with t internal nodes. We present algorithms to NM-color balls on trees using two colors, and CF-color them with log t + 3 colors. Let A be a set of n balls on T . Let also C := {B = B(c, r) | ∃x : B = B x } be the set of balls assigned to at least one internal node. Recall that an internal node x is assigned the ball maximizing the coverage of x.
NM-coloring. We first explain how to NM-color A. We use a divide-and-conquer approach. If t = 0, that is T consists of a single node or a single edge, we use the chain method for NMcoloring with colors blue and red. If t > 0, then we proceed as follows. Let e = uv be an edge of T . Let T u , respectively T v , be the connected component of T \ e containing u, respectively v. Recall that B u and B v are the balls assigned to u and v, respectively. Note that we may assume that both B u or B v exist, for otherwise recursion is trivial. Also observe that B u and B v may coincide. We define A(u) := {balls B ∈ A whose center lies in T u } ∪ {B u }, We define A(v) similarly. We recursively color A(u) in T u and A(v) in T v , obtaining colorings of A(u) and A(v) with colors blue and red. In the recursive calls on A(u), and similarly for A(v), we "clip" the balls to within T u . Note that the clipped balls are still balls in the space T u . This is clear for the balls whose center lies in T u . The center of B u may not lie in T u , but in that case it behaves within T u as a ball with center u and radius cov u (B u ).
Let A(e) := A \ (A(u) ∪ A(v)) be the set of the remaining balls. In other words, A(e) contains the balls whose center is contained in e, except for B u and B v . We color A(e), possibly swapping colors in A(u) or A(v), as follows.
• If B u = B v , we first ensure that it gets the same color in both A(u) and A(v) by swapping colors in one of the two subsets if necessary. We then color all balls in A(e) blue if B u is red, and red if B u is blue.
• If B u = B v , let π be a longest simple path containing u and v. We color A(e) ∪ {B u , B v } restricted to π using the non-monochromatic chain method. We then possibly swap colors in A(u) and A(v) so that B u and B v match the colors they were given by the chain method.
Both cases are illustrated in Fig. 6. Proof. The coloring obviously uses two colors. It remains to show it is non-monochromatic. We use induction on t. If t = 0, the coloring is non-monochromatic since it uses the chain method. Suppose now that t 1 and that the claim holds for any tree space with fewer than t internal nodes. Let p be a point contained in at least two balls. If p is contained in balls only of A(v), only of A(u), or only of A(e), it is contained in at least two balls of different colors. Indeed, the colorings of A(v) and A(u) are non-monochromatic since they use the method on a tree with fewer than t internal nodes and we can use the induction hypothesis. Moreover A(e) is non-monochromatic due to the chain method.
It remains to consider the case where p is contained in balls from at least two of the sets A(u), A(v), and A(e). We distinguish two cases: p is contained in a ball of A(e) and p is not contained in a ball of A(e).
If p is contained in a ball B of A(e), we can assume without loss of generality that p is also contained in a ball of A(v). By Lemma 3.1(i), we have that p ∈ B v .
If B u = B v then all balls in A(e) are given a different color than B v hence p is contained in two balls of different color. If B u = B v then we use the chain method on π. Hence if p ∈ π, it is contained in two balls of different color. To show that if p / ∈ π then p is still contained in two balls of different colors, it suffices to notice that for any subset of balls of A(e) in which p is contained, the point p ′ ∈ π at distance d(u, p) from u is contained in the same set of balls from A(e) as π is the longest path containing e.
On the other hand, if p is not contained in a ball of A(e), then it is contained in at least one ball from A(u) and one from A(v). By Lemma 3.1 we have that p ∈ B u ∩ B v .
We then have two cases. If B u = B v , then p is contained in another ball of A(u) or A(v), and then the coloring is non-monochromatic by the induction hypothesis. Otherwise B u and B v are part of the chain A(e) ∪ {B u , B v }, and hence p is contained in at least two balls of different color.
CF-coloring. The second algorithm CF-colors A using ⌈log t⌉ + 3 colors. As before, define C := {B = B(c, r) | ∃x : B = B x }. We explain how to color C and then extend the coloring to A. Let r be a node whose removal results in subtrees each of at most t/2 internal nodes. We color B r (if it exists) with color 1. Let T 1 , . . . , T deg(r) be subtrees resulting from removing r, that is, the closures of the connected components of T \ {r}. For each i = 1, . . . , deg(r), we recurse on T i with the balls from C whose centers lie in T i . In such a recursive call, we consider a node to be an internal node when it was an internal node in the original space T and when it has not yet been selected as a splitting node in a previous call. Hence, when t = 0 in a recursive call on a subtree T ′ ⊂ T , then T ′ must be a single edge both of whose endpoints have already been treated.
The recursion stops when there are no more balls left (which must be the case when we have a recursive call with t = 0). Note that the internal nodes are fixed from the beginning, hence at some point of the recursion, a leaf node might still be considered internal for the purposes of the recursion. Lemma 3.3. The above algorithm CF-colors C using ⌈log t⌉ colors.
Proof. The number of colors used comes immediately from the splitting of T into trees of at most t 2 internal nodes. We now show the coloring is indeed confict-free by showing that it is a unimin coloring: for any point p the minimum color among the colors of the balls containing p is unique. Let p ∈ T be a point contained in two balls B 1 = B(p 1 , r 1 ) and B 2 = B(p 2 , r 2 ) both of color i. We show that this implies the existence of a ball of higher color containing p. Let v 1 be the node B 1 is assigned to, and v 2 the node B 2 is assigned to. Since B 1 and B 2 have the color i, they were contained in different trees when they were colored in the recursive process. Let v 0 be the node that disconnected v 1 and v 2 and let B 0 be the ball assigned to v 0 . Note that c(B 0 ) < i.
We prove that p ∈ B 0 . Let π be the unique simple path between p and v 0 . It cannot be the case that both p 1 ∈ π and p 2 ∈ π. Suppose without loss of generality that p 2 / ∈ π. Let d be the distance between p and v 0 . Since p ∈ B 2 , we have that cov v0 (B 2 ) d. And since cov v0 (B 0 ) cov v0 (B 2 ), we have that p ∈ B 0 , concluding the proof.
We now wish to extend the coloring to balls in A \ C. To this end, define T ′ := T \ ( C) to be the part of T that remains after removing all points covered by the balls in C.
We finish the coloring with three more colors (using the chain method for CF-colorings) as explained next, resulting in ⌈log t⌉ + 3 colors. We use the following lemma to show that the remaining balls can be reduced to intervals on disjoint lines. Note that it does not use tree spaces and can hence be applied also for planar network spaces.
Proof. Let T be as follows. We take t + 2 points p 1 , . . . , p t+2 in the plane, with p i = (i, 0) for each i = 1, . . . , t + 2, and we link consecutive points with a unit distance segment. We then take t + 2 additional points p ′ 1 , . . . , p ′ t+2 , with p ′ i = (i, t + 2), and for each i = 1, . . . , t + 2 we link p i and p ′ i with a segment of length t + 2. Note that p 1 and p t+2 do not count as internal nodes as their degree is two. Finally, we place t + 1 balls B 1 = B(c 1 , t + 2), . . . , B t+1 = B(c t+1 , t + 2), for all i = 1, . . . , t + 1, with c i = (i + 2 3 , 0), see Fig. 7. Consider the hypergraph H whose nodes are the balls B i , and whose hyperedges are the subsets of balls such that there is a point p ∈ T contained in exactly that subset (and no other balls). We claim (and will prove below) that the set of hyperedges is exactly the set {{B i , B i+1 , . . . , B j } | i j}. In other words, there is a hyperedge for a subset of balls if and only if there is an interval on the x-axis containing exactly the centers of these balls. Hence, we can apply the ⌈log(t + 1)⌉ lower bound for CF-coloring points with respect to intervals [4].
To prove the claim, note that if p i is the ball center nearest to p then d(p, p 1 ) > d(p, p 2 ) > · · · > d(p, p i ) and d(p, p i+1 ) > · · · > d(p, p t+2 ), which implies that any hyperedge is of the form

Planar network spaces
NM-coloring. We first explain how to NM-color balls on a planar network space N . Let again C be the set {B = B(c, r) | ∃x : B = B x }. We create a graph G C whose node set is C and whose edge set is defined as follows: there is an edge between B and B ′ if and only if there is an edge vv ′ in T with B v = B and B v ′ = B ′ . It follows from Lemma 3.1 that for any ball B, the set of nodes of N to which B is assigned, together with the edges between these nodes, is a connected set. Therefore, G C is planar as well since its nodes correspond to disjoint connected subspaces in the planar space N . We now use the Four Color Theorem to color G C and we give each ball in C the same color as the corresponding node in G C .
Lemma 3.7. The coloring on C is non-monochromatic and uses at most four colors.
Proof. It is clear that the coloring uses at most four colors. Now let p be a point contained in two balls B 1 and B 2 of the same color. Let v 1 and v 2 be nodes of N with B 1 = B v1 and B 2 = B v2 . Let π 1 and π 2 be two shortest paths between p and v 1 , v 2 , respectively. If all the nodes in π 1 ∪ π 2 are either assigned B 1 or B 2 , then there is an edge between B 1 and B 2 in G C and hence B 1 and B 2 are given different colors. Therefore there must be a node v in π 1 ∪ π 2 (we assume without loss of generality that v ∈ π 1 ) with B v / ∈ {B 1 , B 2 } and c(B v ) = c(B 1 ). Note that if c(B v ) = c(B 1 ) for all v ∈ π 1 , then there must be an edge between two balls of the same color in G C which is a contradiction, hence there must be a vertex v ∈ π 1 with c(B v ) = c(B 1 ). Since π 1 is a shortest path between v 1 and p, and since v ∈ π 1 , we have that π 1 contains a shortest path between v and p. Moreover, cov v (B v ) cov v (B 1 ) d(v, p), which implies that p ∈ B v and concludes the proof.
We now wish to extend the coloring to balls in A \ C. To this end, define N ′ := N \ ( C) to be the part of N that remains after removing all points covered by the balls in C. The proof of the following lemma is similar to the proof of Lemma 3.4. For each edge e of N ′ , let A(e) denote the set of balls contained in e. Let u and v denote the endpoints of the edge in N containing e. We color the uncolored balls in e using the chain method with two colors not equal to c(B u ) and c(B v ). We have now colored the balls in C as well as the balls in A \ C that lie at least partially in N ′ . Next we explain how to color the remaining balls, which are fully covered by the balls in C. of N and so B \ B v can be covered by two balls (as just explained), which implies that B can be covered by three balls.
Using this lemma, we can easily finish the NM-coloring. Proof. The coloring obviously uses four colors at most. Moreover, it is easy to see the coloring is non-monochromatic. It remains to show that there is an instance requiring at least four colors. To that purpose, let N be an embedding of K 4 where all edges have length one. Then, for each node v of N , we create the ball B(v, 2/3). Since no two balls can have the same color, we need at least four colors.
CF-coloring. We now explain how to CF-color balls on a planar network. As before, define C := {B = B(c, r) | ∃x : B = B x }. We first CF-color C using the following recursive algorithm introduced by Smorodinsky [9]: we select a maximum independent set in C 1 := C, we give it color 1, place all uncolored balls in C 2 , and recurse. We claim that for all i, the Delauney graph D i := (C i , E i ) on the balls in C i is planar, where E i := {{B 1 , B 2 } | ∃p ∈ N : p ∈ B 1 ∩ B 2 and ∀B / ∈ {B 1 , B 2 } : p / ∈ B}.
Lemma 3.11. D i is planar.
Proof. We draw D i using the drawing of N as follows: each ball is represented by its center. Then, for every edge in D i , we find a witness, that is a point contained in the intersection of the two balls and not in any other ball. We finally draw the edge as two geodesics on N : one from one endpoint to the witness point, and the other from the witness point to the other endpoint. We claim that this drawing is plane. Suppose by contradiction that it is not the case and there is a crossing between the two edges B 1 B 3 and B 2 B 4 . Suppose also that the endpoints of the two edges are distinct: the argument when an endpoint is shared is similar. Since we based our drawing on N , a planar graph, the point where the two edges cross must be a node x in N . Let w 13 be the witness of the edge B 1 B 3 and w 24 the winess of B 2 B 4 . Fig. 8 shows the two crossing edges, with the crossing node x in the middle, and the two witnesses w 13 and w 24 used to draw the geodesics.
Suppose, without loss of generality, that the distance from x to w 24 is greater than or equal to the distance from x to w 13 . Thus, the distance from the center of B 1 to w 24 is greater than or equal to w 13 . Hence, w 13 is also contained in the ball B 1 , which contradicts the definition of a witness. Thus, the drawing is plane.
Using this lemma and the Four Color Theorem, we get a coloring on C using ⌈log 4/3 t⌉ colors. Note that this method does not give an efficient algorithm because of the use of the Four Color Theorem. For a fast algorithm, we can use a linear-time algorithm [3] to find an independent set of size at least n/5, leading to ⌈log 5/4 t⌉ colors.
We then color the balls in A \ C. Using Lemma 3.4, we have that for any such ball B, the set of points contained in B but not in any ball in C is contained in one edge of N . Therefore, if we cut ∪C out of N , the remaining space is a union of disjoint segments, and any object that is not colored is contained in at most one segment. We can therefore use the chain coloring on each segment with the two additional colors and the dummy one.
Finally, any point in ∪C is contained in a ball in C of unique color, and any point not in ∪C, is contained in at most one ball of each of the two additional colors. Therefore, the coloring is conflict-free. This yields the following theorem.

Concluding Remarks
We studied NM-and CF-colorings on network spaces, where the objects to be colored are connected regions of the network space. We showed that the number of colors can be bounded as a function of the complexity (which depends on the type of space and of objects) of the network space and the objects, rather than on the number of objects. All our bounds are tight up to some constants, except for X tree,trees cf (k, ℓ; n) where the upper bound is a factor ℓ away from the lower bound. Closing this gap remains an open problem. It would also be interesting to find bounds on general connected objects on any network space, or other settings where the number of colors depends on the complexity of the space and objects rather the number of objects.