The Complexity of Optimal Design of Temporally Connected Graphs
Abstract
We study the design of small cost temporally connected graphs, under various constraints. We mainly consider undirected graphs of n vertices, where each edge has an associated set of discrete availability instances (labels). A journey from vertex u to vertex v is a path from u to v where successive path edges have strictly increasing labels. A graph is temporally connected iff there is a (u, v)journey for any pair of vertices u, v, u ≠ v. We first give a simple polynomialtime algorithm to check whether a given temporal graph is temporally connected. We then consider the case in which a designer of temporal graphs can freely choose availability instances for all edges and aims for temporal connectivity with very small cost; the cost is the total number of availability instances used. We achieve this via a simple polynomialtime procedure which derives designs of cost linear in n. We also show that the above procedure is (almost) optimal when the underlying graph is a tree, by proving a lower bound on the cost for any tree. However, there are pragmatic cases where one is not free to design a temporally connected graph anew, but is instead given a temporal graph design with the claim that it is temporally connected, and wishes to make it more costefficient by removing labels without destroying temporal connectivity (redundant labels). Our main technical result is that computing the maximum number of redundant labels is APXhard, i.e., there is no PTAS unless P = N P. On the positive side, we show that in dense graphs with random edge availabilities, there is asymptotically almost surely a very large number of redundant labels. A temporal design may, however, be minimal, i.e., no redundant labels exist. We show the existence of minimal temporal designs with at least nlogn labels.
Keywords
Temporal graphs Network design Temporally connected Minimal graph APXhard Random input1 Introduction and Motivation
A temporal network is, roughly speaking, a network that changes with time. A great variety of modern and traditional networks are not static and change over time. For example, social networks, wired or wireless networks may change dynamically, transport network connections may only operate at certain times, etc. Dynamic networks in general have been attracting attention over the past years [6, 9, 10, 13, 27], exactly because they model reallife applications. In this work, following the model of [19, 25] and [1], we consider discrete time and restrict our attention to systems in which only the connections between the participating entities may change but the entities remain unchanged. So we consider networks, the links of which are available only at certain discrete time instances, e.g. days or hours. This is a natural assumption when the dynamicity of the system is inherently discrete, e.g., in synchronous mobile distributed systems that operate in discrete rounds. Moreover, it gives a purely combinatorial flavour to the resulting models and problems.
In several such dynamic settings, maintaining connections may come at a cost; consider the transport network example above or an unstable chemical or physical structure, where energy is required to keep a link available. We define the cost as the total number of discrete time instances at which the network links become available. We focus on design issues of temporal networks that are temporally connected; a temporal network is temporally connected if information can travel over time from any node to any other node following journeys, i.e., paths whose successive edges have strictly increasing availability time instances. If one has absolute freedom to design a small cost temporally connected temporal network on an underlying static network, i.e, choose the edge availabilities, then a reasonable design would be to select a rooted spanning tree and choose appropriate availabilities to construct timerespecting paths from the leaves to the root and then from the root back to the leaves. However, in more complicated scenarios one may not be free to choose edge availabilities arbitrarily but instead specific link availabilities might preexist for the network; then, one is able to design a temporally connected temporal network using only the preexisting availabilities or a subset of them. Imagine a hostile network on a complete graph where availability of a link means a break in its security, e.g., when the guards change shifts, and only then are we able to pass a message through the link. So, if we wish to send information through the network, we may only use the times when the shifts change and it is reasonable to try and do so by using as few of these breaks as possible. In such scenarios, we may need to first verify that the preexisting edge availabilities indeed define a temporally connected temporal network. Then, we may try to reduce the cost of the design by removing unnecessary (redundant) edge availabilities if possible, without losing temporal connectivity. Consider, again, the clique network of n vertices with one time availability per edge; it is clearly temporally connected with cost Θ(n ^{2}). However, it is not straightforward if all these edge availabilities are necessary for temporal connectivity. We resolve here the complexity of finding the maximum number of redundant labels in any given temporal graph.
1.1 The Model and Definitions
It is generally accepted to describe a network topology using a graph, the vertices and edges of which represent the communicating entities and the communication opportunities between them respectively. We consider graphs whose edge availabilities are described by sets of positive integers (labels), one set per edge.
Definition 1 (Temporal Graph)
Let G = (V, E) be a (di)graph. A temporal graph on G is an ordered triple G(L) =(V, E, L), where \(L=\{L_{e} \subseteq \mathbb {N}^{*}:e\in E\}\) is an assignment of labels to the edges (arcs) of G. L is called a labelling of G.
Definition 2 (Time edge)
Let e = {u, v} (resp. e = (u, v)) be an edge (resp. arc) of the underlying (di)graph of a temporal graph and consider a label l ∈ L _{ e }. The ordered triplet (u, v, l) is called time edge.
Note that an undirected edge e = {u, v} is associated with 2⋅L _{ e } time edges, namely both (u, v, l) and (v, u, l) for every l ∈ L _{ e }.
The labels of an edge (arc) e are the discrete time instances at which e is available. In many networks and in several applications, the availability of links comes at a cost. For example, in secure networks there is a cost (per discrete time instance) to keep a link secure. We abstract such considerations by the concept of the cost of a temporal graph and wish to have temporal graphs of low cost.
Definition 3 (Cost of a labelling)
Let G(L) = (V, E, L) be a temporal (di)graph and L be its labelling. The cost of L is defined as \(c(L)= {\sum }_{e\in E} L_{e}\).
A basic assumption that we follow here is that when a message or an entity passes through an available link at time t, then it can pass through a subsequent link only at some time t ^{′}>t and only at a time at which that link is available.
Definition 4 (Journey)
A temporal path or journey j from a vertex u to a vertex v ((u, v)journey) is a sequence of time edges (u, u _{1}, l _{1}), (u _{1}, u _{2}, l _{2}), … , (u _{ k − 1}, v, l _{ k }), such that l _{ i } < l _{ i+1}, for each 1 ≤ i ≤ k − 1. We call the last time label, l _{ k }, arrival time of the journey.
Definition 5 (Foremost journey)
A (u, v)journey j in a temporal graph is called foremost journey if its arrival time is the minimum arrival time of all (u, v)journeys’ arrival times, under the labels assigned to the underlying graph’s edges. We call this arrival time the temporal distance, δ(u, v), of v from u.
In this work, we focus on temporally connected temporal graphs, i.e., temporal graphs that have the following property:
Definition 6 (Property TC)
A temporal (di)graph G(L) =(V, E, L) satisfies the property TC, or equivalently L satisfies TC on G, if for any pair of vertices u, v ∈ V, u ≠ v, there is a (u, v)journey and a (v, u)journey in G(L). A temporal (di)graph that satisfies the property TC is called temporally connected.
Example
An undirected complete graph, K _{ n }, is temporally connected under any labelling L with L _{ e }≠∅ for every e ∈ E(K _{ n }). Indeed, there is a (u, v)journey and a (v, u)journey between any u, v ∈ V(K _{ n }), u ≠ v, namely the time edge (u, v, l) and the time edge (v, u, l) respectively, for any l ∈ L _{{u, v}}.
Definition 7 (Minimal temporal graph)
A temporal graph G(L) =(V, E, L) over a (strongly) connected (di)graph is minimal if G(L) has the property TC, and the removal of any label from any L _{ e }, e ∈ E, results in a G(L ^{′}) that does not have the property TC.
Definition 8 (Removal profit)
Let G(L) = (V, E, L) be a temporally connected temporal graph. The removal profit r(G, L) is the largest total number of labels that can be removed from L without violating TC on G.
Here, removal of a label l from L refers to the removal of l only from a particular edge and not from all edges that are assigned label l, i.e., if \(l \in L_{e_{1}} \cap L_{e_{2}}\) and we remove l from both \(L_{e_{1}}\) and \(L_{e_{2}}\), it counts as two labels removed from L.
Notice that if many edges have the same label, we can encounter trivial cases of minimal temporal graphs. For example, the complete graph where every edge appears at time, say t = 5, is minimal but there are no journeys of length larger than 1. To avoid cases where minimality is caused merely due to the assignment of the same label(s) to many (or all) edges, we will often consider a special subcategory of (singlelabelled) temporal graphs:
Definition 9 (SLSE temporal graphs)
A Singlelabelsingleedge (SLSE) temporal graph is a temporal graph, each edge of which has a single label and no two edges have the same label, i.e., each label is assigned to (at most) a single edge. A labelling that gives an SLSE temporal graph is also called SLSE labelling.
1.2 Previous Work and our Contribution
In recent years, there is a growing interest in distributed computing systems that are inherently dynamic. For example, temporal dynamics of network flow problems were considered in a set of pioneering papers [14, 15, 20, 21]. The model we consider here is very closely related to the singlelabelled model of the seminal paper of [19] as well as the multilabelled model of [25]. In [19], the authors consider the case of one real label per edge and examine how basic graph properties change when we impose the temporal condition; here, we extend that model by considering multiple labels per edge but we restrict our focus to integer labels. In [25], the model of [19] is also extended to many labels per edge and the authors mainly examine the number of labels needed for a temporal design of a network to guarantee several graph properties with certainty. The latter also defined the cost notion and, amongst other results, gave an algorithm to compute foremost journeys which can be used to decide property TC. However, the time complexity of that algorithm was pseudopolynomial, as it was dominated by the cube of the maximum label used in the given labelling.
In fact, the problem of testing whether a dynamic graph is temporally connected has been studied before in various settings [7, 9, 33]. The authors of [9] propose an algorithm for computing foremost journeys in a model of evolving graphs, where nodes and edges are associated with lists of time intervals, representing their existence over time, and each edge has a traversal time. In a similar setting, [33] studies temporal reachability graphs, in which a (u, v)edge is present at time t if (in the corresponding timevarying graph) there is a (u, v)journey leaving u after t and arriving at v after at most some specified timeinterval. In [7], the authors investigate discretetime evolving graphs, for which they compute the transitive closure of journeys, i.e., a static directed graph whose edges represent potential journeys. The algorithm they propose depends on the maximum label used, the number of vertices, and the maximum number of edges that simultaneously exist.
Here, we show that if the designer of a temporal graph can select edge availabilities freely, then an asymptotically optimal linearcost (in the size of the graph) design that satisfies TC can be easily obtained (cf. Section 3). We give a matching lower bound to indicate optimality, in the case where the underlying graph is a tree. However, there are pragmatic cases where one is not free to design a temporal graph anew; instead, one is given a set of possible availabilities per edge with the claim that they satisfy TC and the constraint that they may only use them or a subset of them for their design. We also propose a simple algorithm to verify TC in low polynomial time (cf. Section 2). The given design may also be minimal; we partially characterise minimal designs in Section 4. On the other hand, there may be some labels of the initial design that can be removed without violating TC (and also result in a lower cost). In this case, how many labels can we remove at best? Our main technical result is that this problem is APXhard, i.e. it has no PTAS unless P = N P. On the positive side, we show that in the case of complete graphs and random graphs, if the labels are also assigned at random, there is aymptotically almost surely a very large number of labels that can be removed without violating TC. A preliminary version of this work appeared in the 13^{ t h } Workshop on Approximation and Online Algorithms, WAOA 2015 [2].
Stochastic aspects and/or survivability of network design were also considered in [17, 23, 24].
1.2.1 Further related work
Below, we provide a short survey of papers with studies on networks labelled by time units or segments, in addition to the ones mentioned above.
Labelled Graphs
Labelled graphs have been widely used both in Computer Science and in Mathematics, e.g., [29].
Continuous Availabilities (Intervals)
Some authors have assumed the availability of an edge for a whole timeinterval [ t _{1}, t _{2}] or multiple such timeintervals and not just for discrete moments as we assume here. Examples of such studies are [3, 9, 15].
Dynamic Distributed Networks
In recent years, there is a growing interest in distributed computing systems that are inherently dynamic [5, 6, 10, 12, 13, 22, 26, 27, 30, 32].
Distance Labelling
A distance labelling of a graph G is an assignment of unique labels to vertices of G so that the distance between any two vertices can be inferred from their labels alone [16, 18].
Random Labellings
Random temporal networks have been considered before, e.g., in [1, 11, 12]. In [11], the authors model opportunistic mobile networks as a type of random temporal networks, where each edge exists at each timestep with a fixed probability, and show a small diameter in general for that type of networks. In [12], the authors examine the speed of information dissemination in a type of dynamic graphs, where each edge exists at each timestep with some probability depending on whether it existed in the previous timestep. The Expected Temporal Diameter of the model of (random) temporal graphs that we consider here was first examined in [1].
2 A Low Polynomial Time Algorithm for Deciding TC
In this section, we propose a simple polynomialtime algorithm which, given a temporal (di)graph G(L) = (V, E, L) and a source vertex s ∈ V, computes a foremost (s, v)journey, for every v ≠ s, if such a journey exists. We conjecture that our algorithm is optimal.
Theorem 1
 (a)
If arrival_time[v] < +∞, then there exists a foremost journey from s to v, the arrival time of which is exactly arrival_time[v]. This journey can be constructed by following the parent[v] pointers in reverse order.
 (b)
If arrival_time[v] = + ∞, then no (s, v)journey exists.
 (c)
The time complexity of Algorithm 1 is dominated by the sorting time of the set of time edges.
Proof sketch
The algorithm actually considers each existing label in the sequence of time labels, from the smallest to the largest one. For each label considered, it computes the foremost journeys from s which arrive at that time^{1}. The algorithm examines each time edge exactly once. □
Corollary 1
Proof
The time complexity of the algorithm is dominated by the sorting time of S(L). One can sort S(L) by comparisonbased sorting resulting in running time O(S(L)⋅ logS(L)) = O(c(L)⋅ logc(L)). □
Conjecture
We conjecture that any algorithm that computes journeys out of a vertex s must sort the time edges by their labels, i.e., we conjecture that Algorithm 1 is asymptotically optimal with respect to the running time.
Note that Algorithm 1 can even compute foremost (s, v)journeys, if they exist, that start from a given time t _{ s t a r t } > 0. Simply, one ignores the time edges with labels smaller than the start time.
3 Asymptotically CostOptimal Design for TC in Undirected Graphs
In this section, we study temporal design issues on connected undirected graphs, so that the resulting temporal graphs are temporally connected. In this scenario, the designer has absolute freedom to choose the edge availabilities of the underlying graph.
Lemma 1
There is an infinite family of graphs G _{ n } of n vertices, for which the cost of any labelling that satisfies TC is at least 2n−3.
Proof
In fact, the result of Lemma 1 is optimal for any tree; it is indeed strictly contained in Theorem 2(a), but the proof of Lemma 1 is significantly simpler. Theorem 2 shows a lower bound for trees and an asymptotically optimal^{2} way of labelling any connected undirected graph to satisfy TC.
Theorem 2
 (a)
For any tree G = (V, E) of n vertices and for any labelling L that satisfies the property TC on G, the cost of L is c(L) ≥ 2n − 3.
 (b)
Given a connected undirected graph G = (V, E) of n ≥ 2 vertices, we can design a labelling L of cost c(L) = 2n − 3 that satisfies the property TC on G. L can be computed in polynomial time.
Proof
 (a)We prove the statement by induction on the number of vertices of the tree.
 Base Case.

It is easy to see that the statement holds for any tree of n ≤ 4 vertices.
 Induction Hypothesis.

Assume that at least 2n − 3 labels are necessary to satisfy TC on any tree of n ≤ k vertices, \(k\in \mathbb {N}\).
 Inductive Step.

We will show that at least 2(k + 1) − 3 = 2k − 1 labels are necessary to satisfy TC on any tree of k + 1 vertices.
Let G = (V, E) be an arbitrary tree of k + 1 vertices and let L be an arbitrary labelling of G that satisfies TC on G. Consider a leaf, u ∈ V, of G and its unique neighbour, u ^{′} ∈ V. Note that L must assign at least one label to the edge {u, u ^{′}} to “enable” a journey between them. Now, let L ^{′} be the sublabelling of L on G∖u. First, we show that, for L to satisfy TC on G, it must be that L ^{′} satisfies TC on G∖u.
Assume, to the contrary, that L ^{′} does not satisfy TC on G∖u. Then, there exist two vertices x, x ^{′} ∈ V(G∖u) such that the only journey(s) from x to x ^{′} in G(L) go through u; let J be a (x, x ^{′})journey in G(L). It must be:for some v _{0}, …, v _{ l a s t } and \(l_{0}<\ldots < l_{z}<l_{small}<l_{big}< l_{z^{\prime }} < {\ldots } <l_{last}\) (cf. Fig. 2).$$\begin{array}{@{}rcl@{}} J &=& \left((x,v_{1},l_{0}), \ldots, (v_{z},u^{\prime},l_{z}), (u^{\prime},u,l_{small}), \right.\\ & & \left.(u,u^{\prime},l_{big}), (u^{\prime},v_{z^{\prime}},l_{z^{\prime}}), \ldots, (v_{last},x^{\prime},l_{last}) \right), \end{array} $$But, then the subjourney of J which “ignores” the timeedges (u ^{′}, u, l _{ s m a l l }), (u, u ^{′}, l _{ b i g }) is still a (x, x ^{′})journey in G(L), which contradicts the fact that all (x, x ^{′})journeys in G(L) go through u. Therefore, L ^{′} must satisfy TC on G∖u. Since G∖u is a tree of k vertices itself, it must be that c(L ^{′}) ≥ 2k − 3 (by Induction Hypothesis).
If c(L ^{′}) ≥ 2k − 2, then (since L assigns at least one label to the edge {u, u ^{′}}), we have c(L) ≥ 2k − 2+1=2k − 1 and the Theorem holds.
It remains to check the case where c(L ^{′}) = 2k − 3 and L ^{′} satisfies TC on G∖u. L ^{′} must assign at least one label to every edge of G∖u to satisfy TC on it. Also, it must assign exactly one label to at least one edge {x, x ^{′}} ∈ E(G∖u); if all edges of G∖u had at least two labels under L ^{′}, then it would be c(L ^{′}) ≥ 2(k − 1)=2k − 2. Let l _{ u n i q u e } be the unique label of the edge {x, x ^{′}}. Also, without loss of generality, assume that x is further from u than x ^{′} is, i.e., the unique path from u to x goes through x ^{′}. For L to enable a (u, x)journey in G(L), it must assign to the edge {u, u ^{′}} (at least) one label l that is strictly smaller than l _{ u n i q u e }. Also, to enable a (x, u)journey, L must assign to the edge {u, u ^{′}} (at least) one label l ^{′} that is strictly greater than l _{ u n i q u e } and, thus, different from label l (cf Fig. 3). So, L assigns to {u, u ^{′}} at least two labels, which makes the cost of L:$$c(L) \geq c(L^{\prime}) +2 = 2k3+2 = 2k1$$Therefore, in any case, for L to satisfy TC on G, it needs to have cost c(L) ≥ 2k − 1.
 (b)Consider a fixed, but arbitrary, spanning tree T of G and let a node, w, of degree 1 be the root of T. Also let w ^{′} be the single child of w in T and denote by T ^{′} the subtree of T that is rooted at w ^{′}. Let r be the length of the longest path from w ^{′} to any leaf of T ^{′}, i.e., r is the radius of T ^{′}. We assign labels to the edges of T as follows:
 Going upwards.

Any edge of T ^{′} incident to a leaf gets label 1. Any edge e = {u, v} of T ^{′}, with d(w ^{′}, v) = d(w ^{′}, u)+1, where the subtree T ^{∗} rooted at v has been labelled going upwards towards w ^{′}, gets a label l _{ e } = m a x{all labels in T ^{∗}}+1 (cf. Fig. 4).
 The edge {w, w ^{′}}

We label the edge {w, w ^{′}} of T with the single label r + 1.
 Going downwards.

Any edge of T ^{′} incident to w ^{′} gets a label r + 2. Any edge e of T ^{′} in a path from w ^{′} to a leaf of T ^{′}, the parent edge ^{3} of which has been labelled, going downwards, with label l ^{′}, gets a label l _{ e } = l ^{′} + 1.
We can easily implement the above process by topologically ordering the vertices of T in levels using Breadth First Search and implement the “going upwards” and “going downwards” procedures accordingly. The above method results in a labelling where:To show 3, just notice that one can go from any vertex u ∈ V to any other vertex v ∈ V, with u, v ≠ w, by going up in T from u to w ^{′} and then going down in T from w ^{′} to v via strictly increasing labels, by construction. Finally, to realize journeys from w to some u ∈ V, one can go down in T, using strictly increasing labels (starting with the label r + 1), and to realize journeys from some u ∈ V to w, one can go up in T, using strictly increasing labels (ending with the label r + 1). 1.
each edge of T has 2 labels, except for the edge {w, w ^{′}}, which has a single label,
 2.
each edge of E∖T has no label and
 3.
for each ordered pair of vertices u, v ∈ V, u ≠ v, there is a (u, v)journey.
Example
Conjecture
We conjecture that for any connected undirected graph G of n vertices and for any labelling L that satisfies the property TC on G, the cost of L is c(L) ≥ 2n − 4.
4 Minimal Temporal Designs
Suppose now that a temporal graph on a (strongly) connected (di)graph G = (V, E) is given to a designer with the claim that it satisfies TC. In this scenario, the designer is allowed to only use the given set of edge availabilities, or a subset of them. If the given design is not minimal, they may wish to remove as many labels as possible, thus reducing the cost. Minimality of a design can be verified by running Algorithm 1 (cf. Section 2) for every s ∈ V.
4.1 A Partial Characterisation of Minimal Temporal Graphs
As mentioned earlier, if many edges have the same label, we can encounter trivial cases of minimal temporal graphs. To avoid such cases, we focus our attention here to the class of SLSE temporal graphs, in which every edge only becomes available at one moment in time and no two different edges become available at the same time. Are there minimal SLSE temporal graphs with non linear (in the size of the graph) cost? For example, any complete SLSE temporal graph satisfies TC. Are all these Θ(n ^{2}) labels needed for TC, i.e., are there minimal temporal complete graphs? As we prove in Theorem 4, the answer is negative. However, we give below a minimal temporal graph on n vertices with nonlinear in n cost, namely with O(nlogn) labels.
4.1.1 A Minimal Temporal Design of nlogn Cost
Definition 10 (Hypercube graph)
The khypercube graph, commonly denoted Q _{ k }, is a kregular graph of 2^{ k } vertices and 2^{ k − 1}⋅k edges. The 1hypercube is the graph of two vertices and one edge. Recursively, the nhypercube is produced by taking two isomorphic copies of the (n − 1)hypercube and adding edges between the corresponding vertices.
Definition 11 (Flat)
In geometry, a flat is a subset of the ndimensional space that is congruent to a Euclidean space of lower dimension, e.g., the flats in the twodimensional space are points and lines. In the ndimensional space, there are flats of every dimension from 0, i.e., points, to n − 1, i.e., hyperplanes.
Theorem 3
There exists an infinite class of minimal temporal graphs on n vertices with Θ(n⋅ logn) edges and Θ(n⋅ logn) labels, such that different edges have different labels.
Proof
Since our labelling gives a unique (u, v)journey, for every u, v ∈ V, and since all labels assigned to the edges of E are used in the union of all those journeys, the deletion of any single label will violate TC. Therefore, G(L) is minimal. Finally, note that the temporal graph G(L) on the hypercube graph G = Q _{ k } has n = 2^{ k } vertices, \(\frac {1}{2}n\cdot \log {n}\) edges and \(\frac {1}{2}n\cdot \log {n}\) labels. □
4.1.2 A minimal temporal design of linear in n cost
In the previous section, we showed that there are graphs of nonlinear cost (in the number of vertices) that are minimal. Here, we show that there are classes of minimal graphs whose cost is linear in the number of their vertices.
Indeed, as seen in Lemma 1 (Section 3), the star graph of n vertices needs at least Θ(n) labels to satisfy TC and, in fact, we present there a TC satisfying labelling of Θ(n) labels (cf. Fig. 1). Theorem 2(b) (Section 3) also gives a class of minimal temporal graphs of linear cost in the number of vertices. Therefore, we have the following Corollary:
Corollary 2
There exists an infinite class of minimal temporal graphs on n vertices with Θ(n) edges and Θ(n) labels.
4.1.3 SLSE Cliques of at least 4 vertices are not minimal
The complete graph on n vertices, K _{ n }, with an SLSE labelling L, i.e., a labelling that assigns a single label per edge, different labels to different edges, is an interesting case, since K _{ n }(L) always satisfies TC. However, it is not minimal as the theorem below shows.
Theorem 4
Let \(n\in \mathbb {N},~n\geq 4\) and denote by K _{ n } the complete graph on n vertices. There exists no minimal SLSE temporal graph on K _{ n } (L). In fact, we can remove (at least) \(\lfloor \frac {n}{4} \rfloor \) labels from any SLSE labelling on K _{ n } (L) without violating TC.
Proof
The proof is divided in two parts, as follows:
 (a)
We first show that any SLSE labelling on the complete graph on 4 vertices produces a temporal graph that is not minimal, i.e., the theorem holds for K _{4}. Consider the six different labels a, b, c, d, x, y assigned by an SLSE labelling to the edges of K _{4} as shown in Fig. 7.
Up to their renaming, there are three possible cases for the labels a, b, c, d. Counting all the cases of alternation, cycle, and entanglement (see below) would give us all possible 4! = 24 cases. 1.
(Alternation) a < b>d < c > a.
It is easy to see that in this case, both diagonals can be removed: v _{1} can reach v _{3} using labels a and then c; v _{3} can reach v _{1} using labels d and then b; v _{2} can reach v _{4} using labels a and then b; v _{4} can reach v _{2} using labels d and then c.
 2.
(Cycle) a < b < d < c.
Here, diagonal x can be removed: v _{2} can reach v _{4} using labels a and then b; v _{4} can reach v _{2} using labels d and then c.
 3.
(Entanglement) a < b < c < d.
This is a more complex case, for which we distinguish the following five subcases:Notice that the coverage of the above five cases is complete (cf. Fig. 8). i)
x < b and y < c.
We can remove label a: v _{1} can reach v _{2} using labels y and then c; v _{2} can reach v _{1} using labels x and then b.
 ii)
x < b and y > c.
We can remove label b: v _{1} can reach v _{4} using labels a, then c and then d; v _{4} can reach v _{1} using labels x, then c and then y (notice that x < b < c < y).
 iii)
x > b and y > c.
We can remove label a: v _{1} can reach v _{2} using labels b and then x; v _{2} can reach v _{1} using labels c and then y.
 iv)
x > b and b < y < c.
We can remove label x: v _{2} can reach v _{4} using labels a and then b; v _{4} can reach v _{2} using labels b, then y and then c.
 v)
x > b and y < b.
We can remove label c: v _{2} can reach v _{3} using labels a, then b and then d; v _{3} can reach v _{2} using labels y, then b and then x.
 i)
 1.
 (b)Now, consider the complete graph on n ≥ 4 vertices, K _{ n }= (V, E). Partition V arbitrarily into \(\lceil \frac {n}{4} \rceil \) subsets \(V_{1}, V_{2}, \ldots , V_{\lceil \frac {n}{4} \rceil }\), such that \(V_{i}=4, \forall i=1,2, \ldots , \lceil \frac {n}{4} \rceil 1 \) and \(V_{\lceil \frac {n}{4} \rceil } \leq 4\). In each 4clique defined by \(V_{i},~i=1,2,\ldots , \lfloor \frac {n}{4} \rfloor \), we can remove a “redundant” label, as shown in (a). The resulting temporal graph on K _{ n } still preserves TC since for every ordered pair of vertices u, v ∈ V:

if u, v are in the same V _{ i }, \(i=1,2,\ldots , \lfloor \frac {n}{4} \rfloor \), then there is a (u, v)journey that uses time edges within the 4clique on V _{ i }, as proven in (a).

if u ∈ V _{ i } and v ∈ V _{ j }, i ≠ j, then there is a (u, v)journey that uses the (direct) time edge on {u, v}.

4.2 Computing the Removal Profit is APXhard
Note that it is straightforward to check in polynomial time whether a given L satisfies TC on a given (di)graph G, by just checking for every possible (ordered) pair (u, v) of vertices in G whether there is a (u, v)journey in G(L). Recall that the removal profit is the largest number of labels that can be removed from a temporally connected graph without destroying TC. We now show that it is hard to approximate the value of the removal profit arbitrarily well for an arbitrary graph, i.e., there exists no PTAS^{4} for this problem, unless P=NP. In our hardness proof below, we consider undirected graphs.
We prove our hardness result by providing an approximation preserving polynomial reduction from a variant of the maximum satisfiability problem, namely from the monotone MaxXOR(3) problem. Consider a monotone XORboolean formula ϕ with variables x _{1}, x _{2}, …, x _{ n }, i.e., a boolean formula that is the conjunction of XORclauses of the form (x _{ i }⊕x _{ j }), where no variable is negated. The clause α = (x _{ i }⊕x _{ j }) is XORsatisfied by a truth assignment τ if and only if x _{ i }≠x _{ j } in τ. The number of clauses of ϕ that are XORsatisfied in τ is denoted by τ(ϕ). If every variable x _{ i } appears in exactly r XORclauses in ϕ, then ϕ is called a monotone XOR(r) formula. The monotone MaxXOR(r) problem is, given a monotone XOR(r) formula ϕ, to compute a truth assignment τ of the variables x _{1}, x _{2}, …, x _{ n } that XORsatisfies the largest possible number of clauses, i.e., an assignment τ such that τ(ϕ) is maximized. The monotone MaxXOR(3) problem essentially encodes the MaxCut problem on 3 regular (i.e., cubic) graphs, which is known to be APXhard [4].
Lemma 2
[4] The monotone MaxXOR(3) problem is APXhard.
Now we provide our reduction from the monotone MaxXOR(3) problem to the problem of computing r(G, L). Let ϕ be an arbitrary monotone XOR(3) formula with n variables x _{1}, x _{2}, …, x _{ n } and m clauses. Since every variable x _{ i } appears in ϕ in exactly 3 clauses, it follows that \(m=\frac {3}{2}n\). We will construct from ϕ a graph G _{ ϕ }= (V _{ ϕ }, E _{ ϕ }) and a labelling L _{ ϕ } of G _{ ϕ }.
A very highlevel description of the construction is as follows. G _{ ϕ } is composed of gadgets that represent the variables x _{ i } of the formula ϕ. Each variable x _{ i } is assigned a “source” vertex \(s^{x_{i}}\) and three “sink” vertices \(t_{1}^{x_{i}},t_{2}^{x_{i}},t_{3}^{x_{i}}\) in G _{ ϕ }; each of them corresponds to one of the three clauses of ϕ in which x _{ i } appears. The gadgets of G _{ ϕ } are connected in such a way that, if (x _{ i }⊕x _{ j }) is a clause of ϕ, then one of the sink vertices of x _{ i } coincides with one of the sink vertices of x _{ j }. Furthermore it turns out that, by the construction, a journey from each source vertex \(s^{x_{i}}\) to the corresponding sink vertices \(t_{1}^{x_{i}},t_{2}^{x_{i}},t_{3}^{x_{i}}\) represents a truth assignment of the variable x _{ i }. Moreover, the number of clauses of ϕ that can be satisfied by a truth assignment corresponds bijectively to the number of timelabels that can be removed from G _{ ϕ } without destroying TC. Thus an optimum solution of the monotone MaxXOR(3) problem on ϕ corresponds to an optimal removal profit in G _{ ϕ }.
We continue the construction of G _{ ϕ, i } and L _{ ϕ, i } as follows. First, we add an edge between any possible pair of vertices \( w_{p}^{x_{i}},w_{q}^{x_{j}}\), where p, q ∈ {0, 1, 2, 3} and i, j ∈ {1, 2, …, n}, and we assign to this new edge \( e= \{ w_{p}^{x_{i}} , w_{q}^{x_{j}} \} \) the unique label L _{ ϕ }(e) = {7}. The addition of the above described edges is not illustrated in Fig. 9. Note here that we add this edge \( \{ w_{p}^{x_{i}} , w_{q}^{x_{j}} \}\) also in the case where i = j (and p ≠ q).
Intuitively, the base of G _{ ϕ, i } (cf. Fig. 9) corresponds to the variable x _{ i } and, for every p ∈ {1, 2, 3}, the pth branch of G _{ ϕ, i }, together with the two edges \(\{u_{0}^{x_{i}},u_{p}^{x_{i}}\}\) and \(\{v_{0}^{x_{i}},v_{p}^{x_{i}}\}\), correspond to the clause of ϕ in which x _{ i } appears for the pth time in ϕ.
Furthermore, for every i ∈ {1, 2, …, n} and every p ∈ {1, 2, 3} we define for simplicity of notation the temporal paths \( P_{i,p}=(s^{x_{i}},u_{0}^{x_{i}},u_{p}^{x_{i}},t_{p}^{x_{i}})\) and \( Q_{i,p}=(s^{x_{i}},v_{0}^{x_{i}},v_{p}^{x_{i}},t_{p}^{x_{i}})\).
The intuition behind the composition of the gadgetgraphs G _{ ϕ, i } (cf. Fig. 10b) is the following. If variable x _{ i } is false in a truth assignment τ of ϕ, then all edges of the paths P _{ i,1}, P _{ i,2}, P _{ i,3} keep their labels as in L _{ ϕ }. Otherwise, if x _{ i } is true in τ, then all edges of the paths Q _{ i,1}, Q _{ i,2}, Q _{ i,3} keep their labels as in L _{ ϕ }. Furthermore, depending on the value of x _{ i } in the assignment τ, each of the transition edges \(\{u_{p}^{x_{i}},w_{p}^{x_{i}}\}\) and \(\{w_{p}^{x_{i}},v_{p}^{x_{i}}\}\), where p ∈ {1, 2, 3}, keeps exactly one of its two labels from L _{ ϕ }. Consider now a clause α = (x _{ i }⊕x _{ j }) of ϕ which corresponds to the pth branch of G _{ ϕ, i } and to the qth branch of G _{ ϕ, j }. Then the only case where both edges \(\{t_{p}^{x_{i}},u_{p}^{x_{i}}\}\) and \(\{t_{p}^{x_{i}},v_{p}^{x_{i}}\}\) keep their labels from L _{ ϕ }, is when the two variables x _{ i }, x _{ j } have equal truth value in the corresponding truth assignment τ of ϕ; that is, when the clause α = (x _{ i }⊕x _{ j }) is not XORsatisfied by τ. Therefore, intuitively, by a careful counting of the labels it turns out that, if more clauses can be satisfied by a truth assignment τ, then a TC preserving sublabelling L of L _{ ϕ } can be constructed which avoids more labels from L _{ ϕ }, and vice versa (cf. Theorem 5).
To finalize the construction of the graph G _{ ϕ }, we add a new vertex t _{0} to ensure the existence of a temporal path between each pair of vertices of G _{ ϕ }, as follows. This new vertex t _{0} is adjacent to vertex \(w_{0}^{x_{n}}\) and to all vertices in the set \(\{s^{x_{i}},t_{1}^{x_{i}},t_{2}^{x_{i}},t_{3}^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\} \). First we assign to the edge \(\{ t_{0} , w_{0}^{x_{n}} \}\) the unique label \( L_{\phi }(\{ t_{0} , w_{0}^{x_{n}} \} )=\{5\}\) . Furthermore, for every vertex \( t_{p}^{x_{i}}\), where 1 ≤ i ≤ n and 1 ≤ p ≤ 3, we assign to the edge \( \{ t_{0} , t_{p}^{x_{i}} \} \) the unique label \(L_{\phi }(\{ t_{0} , t_{p}^{x_{i}} \} )=\{5\}\). Finally, for each of the vertices \(z\in \{s^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\) we assign to the edge {t _{0}, z} the unique label L _{ ϕ }({t _{0}, z})={6}. The addition of the vertex t _{0} and the labels of the (dashed) edges incident to t _{0} are illustrated in Fig. 10a. Denote the vertex sets \(A= \{s^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\), \( B=\{w_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\) , and \(C=\{t_{p}^{x_{i}}:1 \leq i\leq n,\ 1\leq p\leq 3\}\). Note that V _{ ϕ } = A∪B∪C∪{t _{0}}. This completes the construction of the graph G _{ ϕ } and its labelling L _{ ϕ }.
For every i ∈ {1, 2, …, n} the graph G _{ ϕ, i } has 16 vertices. Furthermore, for every p ∈ {1, 2, 3}, the 4 vertices of the pth branch of G _{ ϕ, i } also belong to a branch of G _{ ϕ, j }, for some j ≠ i. Therefore, together with the vertex t _{0}, the graph G _{ ϕ } has in total 10n + 1 vertices. We now present the auxiliary Lemmas 3–5 which are necessary for the proof of Theorem 5.
Lemma 3
The labelling L _{ ϕ } assigns \(\frac {17}{4}n^{2}+28n+1\) labels to the edges of G _{ ϕ }.
Proof
The vertex t _{0} has in total 3 incident edges (to vertices \( s^{x_{i}},u_{0}^{x_{i}},v_{0}^{x_{i}}\)) to every base of a variable x _{ i } of ϕ, 3 incident edges (to vertices \( t_{p}^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}\), where 1 ≤ p ≤ 3) to every clause (x _{ i }⊕x _{ j }) of ϕ (i.e., to one branch of x _{ i } and one branch of x _{ j }), and one incident edge to vertex \(w_{0}^{x_{n}}\). That is, t _{0} has in total \(3n+3m+1=3n+3\cdot \frac {3}{2}n+1=\frac {15}{2} n+1\) incident edges, each of them having one label in L _{ ϕ }.
Furthermore there exist in total \(\frac {m(m1)}{2} \) edges among the vertices \(\{t_{p}^{x_{i}}:1\leq i\leq n,\ 1\leq p\leq 3\}\) , as well as \( \frac {(n+m)(n+m1)}{2}\) edges among the vertices \(\{w_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\) , each of them having one label in L _{ ϕ }. Therefore, since \(m=\frac {3}{2}n\) , L _{ ϕ } assigns in total \( \frac {17}{4}n^{2} 2n\) labels for these edges.
Moreover, the labelling L _{ ϕ } assigns to every variable x _{ i } of ϕ in total 12 labels, i.e., two labels for each of the transition edges \( \{ u_{0}^{x_{i}} , w_{0}^{x_{i}} \} , \ \{ w_{0}^{x_{i}} , v_{0}^{x_{i}} \}\) and one label for each of the edges \(\{ \{ s^{x_{i}} , u_{0}^{x_{i}} \} ,\ \{ s^{x_{i}} , v_{0}^{x_{i}} \} ,\ \{ u_{0}^{x_{i}} , u_{p}^{x_{i}} \} , \ \{ v_{0}^{x_{i}} , v_{p}^{x_{i}} \} :1\leq p\leq 3\}\).
Finally, L _{ ϕ } assigns to every clause (x _{ i }⊕x _{ j }) of ϕ in total 7 labels, i.e., two labels for each of the transition edges \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \},\ \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} \) and one label for each of the edges \( \{u_{p}^{x_{i}} , t_{p}^{x_{i}} \} ,\ \{ v_{p}^{x_{i}} , t_{p}^{x_{i}} \},\ \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where x _{ i } is associated with the pth branch of G _{ ϕ, i }. That is, L _{ ϕ } assigns in total \(7m=\frac {21}{2}n\) labels for all clauses of ϕ.
Summarizing, the labelling L _{ ϕ } assigns to the edges of the graph G _{ ϕ } a total of \(\left (\frac {15}{2}n+1\right ) +\left (\frac {17}{4}n^{2} 2n\right ) +12n+ \frac {21}{2}n=\frac {17}{4}n^{2}+28n+1\) labels. □
Lemma 4
The labelling L _{ ϕ } satisfies TC on G _{ ϕ }.
Proof
We will prove that there exists a temporal path in L _{ ϕ } between any pair of vertices of V _{ ϕ } = A∪B∪C∪{t _{0}}.
For any two vertices b, b ^{′} ∈ B there exists a temporal path from b to b ^{′} and from b ^{′} to b, due to the edge {b, b ^{′}} with label 7. Similarly, for any two vertices c, c ^{′} ∈ C there exists a temporal path from c to c ^{′} and from c ^{′} to c, due to the edge {c, c ^{′}} with label 7. Let a _{1}, a _{2} ∈ A. There exists a temporal path from a _{1} to a _{2} as follows: start from a _{1}, follow P _{ i, p } (or Q _{ i, p }) upwards until \( t_{p}^{x_{i}}\) with greatest label 4, then go to t _{0} with label 5, and finally from t _{0} to a _{2} with label 6. In the special case where a _{1} and a _{2} lie on the same path P _{ i, p } (resp. Q _{ i, p }) and a _{1} appears before a _{2} in P _{ i, p } (resp. Q _{ i, p }), there exists clearly a temporal path from a _{1} to a _{2} along P _{ i, p } (resp. Q _{ i, p }).
Let a ∈ A and b ∈ B. Note that \(b=w_{p}^{x_{i}}\) for some i ∈ {1, 2, …, n} and some p ∈ {0, 1, 2, 3}. There exists the temporal path from b to a as follows. First follow the edge \( \{ w_{p}^{x_{i}} , u_{p}^{x_{i}} \} \) (with label 1), then follow upwards the path P _{ i, p } until one of the vertices \( \{t_{1}^{x_{i}},t_{2}^{x_{i}},t_{3}^{x_{i}}\}\) (with maximum label 4), then go to t _{0} with label 5 and finally reach a with label 6. Furthermore there exists the temporal path from a to b as follows. Assume first that \(a=s^{x_{i}}\), for some i ∈ {1, 2, …, n}. If \( b=w_{0}^{x_{i}}\) then there exists the temporal path on the edges \( \{ s^{x_{i}} , u_{0}^{x_{i}} \} \) (with label 1) and \( \{ u_{0}^{x_{i}} , w_{0}^{x_{i}} \}\) (with label 2). If \(b\neq w_{0}^{x_{i}}\) then there exists the temporal path from \(s^{x_{i}}\) to \(w_{0}^{x_{i}}\) (with maximum label 2), followed by the edge \(\{ w_{0}^{x_{i}} , b \} \) (with label 7). Assume now that \(a\neq s^{x_{i}}\), for every i ∈ {1, 2, …, n}. That is, \(a=u_{p}^{x_{i}}\) or \(a=v_{p}^{x_{i}}\), for some i ∈ {1, 2, …, n} and some p ∈ {0, 1, 2, 3}. If \(b=w_{p}^{x_{i}}\) then there exists the temporal path from a to b on the edge {a, b} (with label 1). If \(b\neq w_{p}^{x_{i}}\) then there exists the temporal path from a to b through the edges \( \{ a , w_{p}^{x_{i}} \} \) (with label 1) and \( \{ w_{p}^{x_{i}} , b \} \) (with label 7). That is, there exists a temporal path in L _{ ϕ } between any a ∈ A and any b ∈ B.
Let b ∈ B, i.e., \(b=w_{p}^{x_{i}}\) for some i ∈ {1, 2, …, n} and some p ∈ {0, 1, 2, 3}. Then there exists a temporal path from b to every vertex c ∈ C as follows. If p = 0 then start with the edge \( \{ w_{0}^{x_{i}} , u_{0}^{x_{i}} \} \) (of label 1), continue upwards with a temporal path (of maximum label 4) until \(t_{1}^{x_{i}}\in C\) and then continue to any other vertex c ∈ C with the edge \( \{ t_{1}^{x_{i}} , c \} \) (of label 7). If p ∈ {1, 2, 3} then reach \(t_{p}^{x_{i}}\in C\) with the edge \( \{ w_{p}^{x_{i}} , t_{p}^{x_{i}} \} \) (of label 1) and continue to any other vertex c ∈ C with the edge \( \{ t_{p}^{x_{i}} , c \} \) (of label 7). That is, there exists a temporal path from any b ∈ B to any vertex of the set C. Now let c ∈ C, i.e., \(c=t_{p}^{x_{i}}\) for some i ∈ {1, 2, …, n} and some p ∈ {1, 2, 3}. Then there exists a temporal path from c to every vertex b ∈ B as follows. First reach the vertex \(w_{p}^{x_{i}}\in B\) with the edge \( \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \) (of label 1) and then continue to any other vertex c ∈ C with the edge \( \{ w_{p}^{x_{i}} , c \} \) (of label 7). That is, there exists a temporal path in L _{ ϕ } between any b ∈ B and any c ∈ C.
Let a ∈ A, i.e., \(a\in \{s^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}\}\) for some i ∈ {1, 2, …, n} and some p ∈ {0, 1, 2, 3}. Then there exists at least one path from a upwards to a vertex \(c\in \{t_{1}^{x_{i}},t_{2}^{x_{i}},t_{3}^{x_{i}}\}\) (with maximum label 4). Once we have (temporally) reached c from a, we can (temporally) continue to any other c ^{′} ∈ C through the edge {c, c ^{′}} (of label 7 ). That is, there exists a temporal path from any a ∈ A to any vertex of C. Now let c ∈ C, i.e., \(c=t_{p}^{x_{i}}\) for some i ∈ {1, 2, …, n} and some p ∈ {1, 2, 3}. Then there exists a temporal path from c to every vertex a ∈ A as follows. First reach the vertex t _{0} with the edge \( \{ t_{p}^{x_{i}} , t_{0} \}\) (of label 5) and then continue to any vertex a ∈ A with the edge {t _{0}, a} (of label 6). That is, there exists a temporal path in L _{ ϕ } between any a ∈ A and any c ∈ C.
Finally, there exists a temporal path between t _{0} and every vertex of \( A\cup C\cup \{w_{0}^{x_{n}}\}\), since t _{0} is a neighbour with all these vertices. Let b ∈ B, i.e., \(b=w_{p}^{x_{i}}\) for some i ∈ {1, 2, …, n} and some p ∈ {0, 1, 2, 3}. Then there exists a temporal path from \( w_{p}^{x_{i}}\) to t _{0} with the edges \( \{ w_{p}^{x_{i}} , u_{p}^{x_{i}} \} \) (with label 1) and \( \{ u_{p}^{x_{i}} , t_{0} \} \) (with label 6). On the other hand, there exists a temporal path from t _{0} to every vertex \( b=w_{p}^{x_{i}}\in B\), as follows. First reach the vertex \(w_{0}^{x_{n}}\) with the edge \( \{ t_{0} , w_{0}^{x_{n}} \} \) (of label 5) and then, if \(b\neq w_{0}^{x_{n}}\), continue with the edge \( \{ w_{0}^{x_{n}} , b \} \) (of label 7). That is, there exists a temporal path in L _{ ϕ } between t _{0} and any vertex in A∪B∪C.
Summarizing, there exists a temporal path between any pair of vertices of V _{ ϕ } = A∪B∪C∪{t _{0}}, i.e., the labelling L _{ ϕ } satisfies TC on G _{ ϕ }. □
Lemma 5
 (a)
at least one label for every transition edge \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \} \) and \( \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \}\), where i ∈ {1, 2, …, n} and p ∈ {0, 1, 2, 3},
 (b)
the label of each edge \( \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where i ∈ {1, 2,…, n} and p ∈ {1, 2, 3},
 (c)
the labels of all edges of G _{ ϕ } among the vertices \( \{t_{p}^{x_{i}}:1\leq i\leq n,\ 1\leq p\leq 3\}\),
 (d)
the labels of all edges among the vertices \(\{w_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\),
 (e)
the label of each edge incident to t _{0}, and
 (f)
the labels of all edges of the path P _{ i,p } or the labels of all edges of the path Q _{ i,p }, where i ∈ {1, 2, …, n} and p ∈ {1, 2, 3}.
Proof
 (a)
First assume that L does not keep any time label on the transition edge \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \}\) (resp. \( \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} \)), where i ∈ {1, 2, …, n} and p ∈ {0, 1, 2, 3}. Then there does not exist in L any temporal path from \(u_{p}^{x_{i}}\) (resp. \(v_{p}^{x_{i}}\)) to \(w_{p}^{x_{i}}\), even if L maintains all other edge labels from L _{ ϕ }. This is a contradiction. Therefore L keeps at least one label on the transition edge \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \}\) (resp. \( \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} \)).
 (b)
Now assume that L does not contain the label of some edge \( \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where i ∈ {1, 2, …, n} and p ∈ {1, 2, 3}. Then there does not exist in L any temporal path from \( t_{p}^{x_{i}}\) to any vertex \(w_{q}^{x_{j}}\in B\), even if L maintains all other edge labels from L _{ ϕ }. This is a contradiction to the assumption that L satisfies TC on G _{ ϕ }. Therefore L contains the label of each edge \( \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where i ∈ {1, 2, …, n} and p ∈ {1, 2, 3}.
 (c)
Consider two vertices \(t_{p}^{x_{i}}\neq t_{q}^{x_{j}}\), 1 ≤ i < j ≤ n, 1 ≤ p, q ≤ 3. If L does not contain the label of the edge \( \{ t_{p}^{x_{i}} , t_{q}^{x_{j}} \} \), then there does not exist in L any temporal path from \(t_{p}^{x_{i}}\) to \(t_{q}^{x_{j}}\), which is a contradiction. Therefore L contains the labels of all edges of G _{ ϕ } among the vertices \(\{t_{p}^{x_{i}}:1\leq i\leq n,\ 1\leq p\leq 3\}\).
 (d)
Assume that L does not contain the label of the edge \( \{ w_{p}^{x_{i}} , w_{q}^{x_{j}} \} \), for some i, j ∈ {1, 2, …, n} and p, q ∈ {0, 1, 2, 3}. Then there does not exist in L any temporal path from \(w_{p}^{x_{i}}\) to \(w_{q}^{x_{j}}\), which is a contradiction. Therefore L contains the labels of all edges among the vertices \( \{w_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\).
 (e)
We now prove that L contains the label of each edge incident to t _{0}. Recall that the neighbours of t _{0} in G _{ ϕ } are exactly the vertices of the set \(A\cup C\cup \{w_{0}^{x_{n}}\}\). Assume L does not have the label of the edge \(e= \{ t_{0} , w_{0}^{x_{n}} \} \). Then there exists no temporal path in L from t _{0} to any vertex \( w_{p}^{x_{i}}\in B\), even if L maintains all other edge labels from L _{ ϕ }. This is a contradiction to the assumption that L satisfies TC on G _{ ϕ }. Now assume that there exists a vertex \(a\in A=\{s^{x_{i}},u_{p}^{x_{i}},v_{p}^{x_{i}}:1\leq i\leq n,\ 0\leq p\leq 3\}\) such that L does not have the label of the edge e = {t _{0}, a}. Then there does not exist in L any temporal path from vertex t _{0} to vertex a, which is again a contradiction. Finally assume that there exists a vertex \(t_{p}^{x_{i}}\in C\), such that L does not have the label of the edge \(e= \{ t_{0} , t_{p}^{x_{i}} \} \). Then there does not exist in L any temporal path from vertex \(u_{p}^{x_{i}}\) to vertex \( s^{x_{i}}\), which is a contradiction. Therefore L contains the label of each edge incident to t _{0}.
 (f)
Assume that L misses from L _{ ϕ } at least one label of the path P _{ i, p } and at least one label of the path Q _{ i, p } , for some i ∈ {1, 2, …, n} and p ∈ {1, 2, 3}. Then there does not exist any temporal path from \(s^{x_{i}}\) to \(t_{p}^{x_{i}}\), which is a contradiction. Therefore L contains the labels of all edges of the path P _{ i, p } or the labels of all edges of the path Q _{ i, p }, where i ∈ {1, 2, …, n} and p ∈ {1, 2, 3}.
We are now ready to provide the proof of Theorem 5.
Theorem 5
There exists a truth assignment τ of ϕ with τ(ϕ)≥k if and only if there exists a TC satisfying labelling L⊆L _{ ϕ } of G _{ ϕ } such that L _{ ϕ } ∖L≥9n+k.
Proof
(⇒) Assume that there is a truth assignment τ that XORsatisfies k clauses of ϕ. We construct a labelling L of G _{ ϕ } by removing 9n + k labels from L _{ ϕ }, as follows. First we keep in L all labels of L _{ ϕ } on the edges incident to t _{0}. Furthermore we keep in L the label {7} of all the edges \( \{ t_{p}^{x_{i}} , t_{q}^{x_{j}} \} \) and the label {7} of all the edges \(w_{p}^{x_{i}}w_{q}^{x_{j}}\). Moreover we keep in L the label {1} of all the edges \( \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \). Let now i = 1, 2, …, n. If x _{ i }=0 in τ, we keep in L the labels of the edges of the paths P _{ i,1}, P _{ i,2}, P _{ i,3}, as well as the label 1 of the edge \( \{ v_{0}^{x_{i}} , w_{0}^{x_{i}} \} \) and the label 2 of the edge \( \{ w_{0}^{x_{i}} , u_{0}^{x_{i}} \} \). Otherwise, if x _{ i }=1 in τ, we keep in L the labels of the edges of the paths Q _{ i,1}, Q _{ i,2}, Q _{ i,3}, as well as the label 1 of the edge \( \{ u_{0}^{x_{i}} , w_{0}^{x_{i}} \} \) and the label 2 of the edge \( \{ w_{0}^{x_{i}} , v_{0}^{x_{i}} \} \).
Summarizing, the labelling L misses in total 6 labels of L _{ ϕ } for the edges \( \{ \{ s^{x_{i}} , u_{0}^{x_{i}} \} ,\ \{ s^{x_{i}} , v_{0}^{x_{i}} \} ,\ \{ u_{0}^{x_{i}} , w_{0}^{x_{i}} \} ,\ \{ w_{0}^{x_{i}} , v_{0}^{x_{i}} \} ,\ \{ u_{0}^{x_{i}} , u_{p}^{x_{i}} \} ,\ \{ v_{0}^{x_{i}} , v_{p}^{x_{i}} \} :1\leq p\leq 3,~ i = 1,2,{\ldots } ,n \}\). That is, L misses in total 6n labels of L _{ ϕ } for all variables x _{1}, x _{2}, …, x _{ n }. For each of the k XORsatisfied clauses (x _{ i }⊕x _{ j }) of ϕ, the labelling L misses in total 3 labels of L _{ ϕ } for the edges \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \} ,\ \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} ,\ \{ u_{p}^{x_{i}} , t_{p}^{x_{i}} \} ,\ \{ v_{p}^{x_{i}} , t_{p}^{x_{i}} \} ,\ \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where x _{ i } is associated with the pth branch of G _{ ϕ, i }. That is, L misses in total 3k labels of L _{ ϕ } for all XORsatisfied clauses. Furthermore, for each of the m − k XORsatisfied clauses (x _{ i }⊕x _{ j }) of ϕ, the labelling L misses in total 2 labels of L _{ ϕ } for the edges \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \} ,\ \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} ,\ \{ u_{p}^{x_{i}} , t_{p}^{x_{i}} \} ,\ \{ v_{p}^{x_{i}} , t_{p}^{x_{i}} \} ,\ \{ t_{p}^{x_{i}} , w_{p}^{x_{i}} \} \), where x _{ i } is associated with the pth branch of G _{ ϕ, i }. That is, L misses in total 2(m − k) =3n − 2k labels of L _{ ϕ } for all XORsatisfied clauses. All other labels of L _{ ϕ } remain in the labelling L ⊆ L _{ ϕ }. Therefore, L misses in total 6n+3k+3n − 2k = 9n + k labels from L _{ ϕ }.
(⇐) Assume that r(G _{ ϕ }, L _{ ϕ }) ≥ 9n + k and let L ⊆ L _{ ϕ } be a TC preserving labelling of G _{ ϕ } with L _{ ϕ }∖L = r(G _{ ϕ }, L _{ ϕ }) ≥ 9n + k, i.e., G _{ ϕ }(L) is minimal. Let i ∈ {1, 2, …, n}. For every p ∈ {1, 2, 3}, L contains by Lemma 5(f) the labels of all edges of the path P _{ i, p } or the labels of all edges of the path Q _{ i, p }. Therefore, there exist at least two indices p _{1}, p _{2}∈{1,2,3} such that L contains the labels of all edges of the paths \(P_{i,p_{1}},P_{i,p_{2}}\) or the labels of all edges of the paths \(Q_{i,p_{1}},Q_{i,p_{2}}\). Without loss of generality let p _{1}=1 and p _{2}=2 and let L contain the labels of all edges of the paths P _{ i,1}, P _{ i,2} (the other cases can be dealt with in the same way by symmetry). Assume that L also contains the labels of all edges of the path \( Q_{i,3}=(s^{x_{i}},v_{0}^{x_{i}},v_{3}^{x_{i}},t_{3}^{x_{i}})\). Then we can modify the labelling L to a labelling L ^{′} as follows. First remove from L the labels of the edges \( \{ s^{x_{i}} , v_{0}^{x_{i}} \} \) and \( \{ v_{0}^{x_{i}} , v_{3}^{x_{i}} \} \) and add instead the labels of the edges \( \{ u_{0}^{x_{i}} , u_{3}^{x_{i}} \} \) and \( \{ u_{3}^{x_{i}} , t_{3}^{x_{i}} \} \) (if they do not exist yet in L). Furthermore change the labels of the transition edges \( \{ v_{0}^{x_{i}} , w_{0}^{x_{i}} \} \) and \( \{ w_{0}^{x_{i}} , u_{0}^{x_{i}} \} \) to the labels 1 and 2, respectively. Note that in the resulting labelling L ^{′}, both edges \( \{ u_{3}^{x_{i}} , t_{3}^{x_{i}} \} \) and \( \{ v_{3}^{x_{i}} , t_{3}^{x_{i}} \} \) are labelled. Furthermore L ^{′} ⊆ L _{ ϕ } and L ^{′} does not have more labels than L, and thus L _{ ϕ }∖L ^{′}≥L _{ ϕ }∖L = r(G _{ ϕ }, L _{ ϕ }). Moreover, it is easy to check that L ^{′} still satisfies TC on G _{ ϕ }, as L satisfies TC as well. So, it must also be L _{ ϕ }∖L ^{′} = r(G _{ ϕ }, L _{ ϕ }), i.e., G _{ ϕ }(L ^{′}) is also minimal. Therefore, we may assume without loss of generality that for any minimal labelling L ⊆ L _{ ϕ }, L contains the labels of all edges of the paths P _{ i,1}, P _{ i,2}, P _{ i,3} or the labels of all edges of the paths Q _{ i,1}, Q _{ i,2}, Q _{ i,3}.
From Lemma 5(a), L contains at least 2n + 2m labels on the edges of the form \(\{u_{p}^{x_{i}}, w_{p}^{x_{i}}\}\) or \(\{w_{p}^{x_{i}}, v_{p}^{x_{i}}\}\), since there are exactly 2n transition edges on the different bases of G _{ ϕ } and 2m transition edges on the different branches of G _{ ϕ }. From Lemma 5(b), L contains m additional labels, one for each branch, more specifically for the respective edge \(\{t_{p}^{x_{i}}, w_{p}^{x_{i}} \}\) of the branch. From Lemma 5(c), L contains \(\frac {m(m1)}{2}\) extra labels among the vertices \(\{t_{p}^{x_{i}}: 1 \leq i \leq n, 1 \leq p \leq 3\}\). From Lemma 5(d), L also contains \(\frac {(n+m) (n+m1)}{2}\) additional labels among the vertices \(\{w_{p}^{x_{i}}: 1\leq i \leq n, 0\leq p \leq 3 \}\) . From Lemma 5(e), L also contains \(\frac {15}{2}n+1\) labels on the edges incident to t _{0}. Finally, from Lemma 5(f), L contains at least 4n + m additional labels: for each G _{ ϕ, i }, L contains at least 4 labels, namely one label on the base edge \(\{s^{x_{i}}, u_{0}^{x_{i}}\}\) or on the base edge \(\{s^{x_{i}}, v_{0}^{x_{i}}\}\) and, for every p ∈ {1, 2, 3}, one label on the edge \(\{u_{0}^{x_{i}},u_{p}^{x_{i}}\}\) or on the edge \(\{v_{0}^{x_{i}},v_{p}^{x_{i}}\}\); also, for each branch of G _{ ϕ }, L contains at least 1 label, namely a label on the edge \(\{u_{p}^{x_{j}}, t_{p}^{x_{j}}\}\) or on the edge \(\{v_{p}^{x_{j}}, t_{p}^{x_{j}}\}\), for some p ∈ {1, 2, 3} and j ∈ {1, 2, …, m}.
Now we construct from the labelling L ⊆ L _{ ϕ } a truth assignment τ for the formula ϕ as follows. For every i ∈ {1, 2, …, n}, if L contains the labels of all edges of the paths P _{ i,1}, P _{ i,2}, P _{ i,3}, then we define x _{ i }=0 in τ. Otherwise, if L contains the labels of all edges of the paths Q _{ i,1}, Q _{ i,2}, Q _{ i,3}, then we define x _{ i }=1 in τ. We will prove that τ(ϕ)≥k, i.e., that τ XORsatisfies at least k clauses of the formula ϕ.
Let α = (x _{ i }⊕x _{ j }), where i, j ∈ {1, 2, …, n}, be a clause of ϕ that is not XORsatisfied by τ in ϕ. Let x _{ i } (resp. x _{ j }) be associated with the pth (resp. qth) branch of G _{ ϕ, i } (resp. of G _{ ϕ, j }). Since α is not XORsatisfied, either x _{ i } = x _{ j }=0 or x _{ i } = x _{ j }=1 in τ. If x _{ i } = x _{ j }=0 in τ, it follows by the definition of the assignment τ that the labelling L contains the labels of all edges of the path P _{ i, p } and of the path P _{ j, q }. Therefore, the p ^{ t h } branch of G _{ ϕ, i }, which is identified with the q ^{ t h } branch of G _{ ϕ, j }, has both edges \(\{t_{p}^{x_{i}}, u_{p}^{x_{i}} \} \equiv \{t_{q}^{x_{j}}, v_{q}^{x_{j}} \}\) and \(\{t_{p}^{x_{i}}, v_{p}^{x_{i}} \} \equiv \{t_{q}^{x_{j}}, u_{q}^{x_{j}} \}\) labelled under L, with one label each. The same holds if x _{ i } = x _{ j }=1, where all edges of both paths Q _{ i, p } and Q _{ j, q } are labelled. So, for all the branches of G _{ ϕ } that correspond to nonsatisfied clauses of ϕ by the truth assignment τ, L contains an additional label (to the ones accounted for by using the result of Lemma 5(f)). The number of clauses that are not satisfied by τ in ϕ is exactly \(m\tau (\phi )= \frac {3}{2} n  \tau (\phi )\).
Therefore 9n + k ≤ L _{ ϕ }∖L ≤ 9n + τ(ϕ), and thus τ(ϕ) ≥ k, i.e., the truth assignment τ satisfies at least k clauses of ϕ. This completes the proof of the theorem. □
The next corollary follows immediately by Theorem 5.
Corollary 3
Let OPT _{ monMaxXOR(3) } (ϕ) the greatest number of clauses that can be simultaneously XORsatisfied by a truth assignment of ϕ. Then r(G _{ ϕ } ,L _{ ϕ } )=9n+OPT _{ monMaxXOR(3) } (ϕ).
Proof
Let τ be a truth assignment that satisfies k = OPT _{monMaxXOR(3)}(ϕ) clauses of ϕ. Then there exists by Theorem 5 a TC satisfying labelling L ⊆ L _{ ϕ } of G _{ ϕ } such that L _{ ϕ }∖L ≥ 9n + k. Thus, since r(G _{ ϕ }, L _{ ϕ }) ≥ L _{ ϕ }∖L, it follows that r(G _{ ϕ }, L _{ ϕ }) ≥ 9n + OPT _{monMaxXOR(3)}(ϕ). Conversely, let L ⊆ L _{ ϕ } be a labelling of G _{ ϕ } such that L _{ ϕ }∖L = r(G _{ ϕ }, L _{ ϕ }). Then there exists by Theorem 5 a truth assignment τ that satisfies at least r(G _{ ϕ }, L _{ ϕ })−9n clauses of ϕ . Thus OPT _{monMaxXOR(3)}(ϕ) ≥ r(G _{ ϕ }, L _{ ϕ })−9n, which completes the proof. □
Using Theorem 5 and Corollary 3, we are now ready to prove the main theorem of this section.
Theorem 6
The problem of computing r(G,L) on an undirected temporally connected graph G(L) is APXhard.
Proof

r(G _{ ϕ }, L _{ ϕ }) ≤ α⋅OPT _{monMaxXOR(3)}(ϕ), for any monotone XOR(3) formula ϕ, and

for any TC satisfying labelling L ⊆ L _{ ϕ } of G _{ ϕ }, g(L) is a truth assignment for ϕ and OPT _{monMaxXOR(3)}(ϕ)−g(L) ≤ β⋅(r(G _{ ϕ }, L _{ ϕ })−L _{ ϕ }∖L), where g(L) is the number of clauses of ϕ that are satisfied by g(L).
This completes the proof of the Theorem. □
Note
In fact, we have also shown (Theorem 5) that the problem of computing the removal profit is NPhard in the strong sense, since all numbers used in the reduction are constant integers.
Open Problem
Is there a polynomialtime constant factor approximation algorithm to compute r(G, L)?
4.3 Temporally connected random labellings have high removal profit
In this section, we show that dense graphs with random labels have the property TC and have a very high removal profit asymptotically almost surely. More specifically, we consider the complete graph and the ErdösRenyi model of random graphs, G _{ n, p } and we examine whether we can delete labels from such temporal graphs and continue preserving TC.
The (singlelabelled) model of temporal graphs that we consider here is that of uniform random temporal graphs [1].
Definition 12
[1] A uniform random temporal graph is a graph G on n vertices, \(n \in \mathbb {N}\), each edge of which receives exactly one label uniformly at random from a set \(\{1,2,\ldots , \alpha \},~\alpha \in \mathbb {N}\) and the selection of the label of an edge is independent from the selection of the label of any other edge.
4.3.1 High removal profit in the complete graph
Theorem 7
In the uniform random temporal graph where the underlying graph G is the complete graph (clique) of n vertices and α≥4, we can delete all but Θ(nlogn) labels without violating TC, with probability at least \(1\frac {1}{n^{2}}\).
Proof
First, note that any set {1, 2, …, α} of α consecutive natural numbers can be partitioned into 4 disjoint almost equal subsets of consecutive numbers, A _{1}, A _{2}, A _{3}, A _{4}. Indeed, let α = 4k + v, where \(k\in \mathbb {N}\) and v ∈ {1,2,3,4}.
For v = 0, we use A _{1} = {1, …, k}, A _{2} = {k + 1,…,2k}, A _{3} = {2k + 1,…,3k}, A _{4} = {3k + 1,…,4k}.
For v = 1, we use A _{1} = {1, …, k}, A _{2} = {k + 1,…,2k}, A _{3} = {2k + 1,…,3k}, A _{4} = {3k + 1,…,4k + 1}.
For v = 2, we use A _{1} = {1, …, k}, A _{2} = {k + 1,…,2k}, A _{3} = {2k + 1,…,3k + 1},A _{4} = {3k + 2,…,4k + 2}.
For v = 3, we use A _{1} = {1, …, k}, A _{2} = {k + 1,…,2k + 1},A _{3} = {2k + 2,…,3k + 2},A _{4} = {3k+3,…,4k+3}.
Lemma 6
For each particular edge e of K _{ n } and for the label l that it receives, it holds that \(Prob[l \in A_{i}] \geq \frac {k}{4k+3},~ \forall i=1,2,3,4\).
Now, colour green(g), yellow(y), blue(b) and red(r) the edges that are assigned a label in A _{1}, A _{2}, A _{3} and A _{4} respectively.
Definition 13
 a)
V _{ R } is the union of a particular vertex v _{0} (called the centre of R) and two equisized vertex sets V _{ i n } and V _{ o u t }, each of γlogn vertices, and
 b)
R is the induced subgraph of G formed from V _{ R } (so it is a clique itself).
Each special path P = (w, v _{ i n }, v _{0}, v _{ o u t }, w ^{′}) connecting w and w ^{′} becomes a (w, w ^{′})journey if the label l _{1} of {w, v _{ i n }} is in A _{1}, the label l _{2} of {v _{ i n }, v _{0}} is in A _{2}, the label l _{3} of {v _{0}, v _{ o u t }} is in A _{3}, and the label l _{4} of {v _{ o u t }, w ^{′}} is in A _{4}. Then, the probability that P is a journey is at least \(\left (\frac {1}{7} \right )^{4}\), due to independence of the labels’ selection.
Therefore, we have:
Lemma 7
For any two particular vertices w,w ^{′} of V∖V _{ R } , the probability that there is a special path P from w to w ^{′} that is a (w,w ^{′} )journey is at least \(1n^{\gamma \log _{2}{\frac {2500}{2499}}}\).
Now, we consider only the edges and labels of R and, for each w ∈ V∖V _{ R }, we consider only the edges connecting w to each vertex of R; the sparsified graph G ^{′}= (V, E ^{′}) has, thus, \(E^{\prime }= \frac {(2\gamma \log {n} +1) \cdot 2 \gamma \log {n}}{2} +\left (n(2\gamma \log {n}+1) \right ) \cdot (2\gamma \log {n} +1)={\Theta }(n\log {n}+ \log ^{2}{n}) = {\Theta }(n\log {n}) \) edges. We will show that we need only consider the edges (and labels) of G ^{′} to maintain TC in G, i.e., that G ^{′} itself is temporally connected, with probability at least \(1\frac {1}{n^{2}}\).
Consider any pair, w, w ^{′}, of vertices of the uniform random temporal graph on K _{ n } and a temporal router R. Also, consider the graph G ^{′} as described above, with the labelling implied by the uniform random labelling on the clique. If w, w ^{′} ∈ V _{ R }, then they are directly connected via a labelled edge in G ^{′} and thus a journey exists both ways between them. If w ∈ V _{ R } and w ∈ V∖V _{ R }, then again there is a direct labelled edge in G ^{′} connecting w and w ^{′}, so there is a journey between them either way.
4.3.2 High removal profit in dense random ErdösRenyi graphs
In this section, we consider the underlying graph G = (V, E) to be an instance of the ErdösRenyi graph model, G _{ n, p }, with n ≥ 14 and \(p\geq 7 \left (\frac {\gamma \ln {n}}{n} \right )^{\frac {1}{7}},~\gamma \geq 24\).
Definition 14 (ErdosRenyi graphs̈)
An instance of G _{ n, p } is formed when for every pair of vertices u, v among a total number of n vertices, the edge {u, v} is chosen to exist with probability p independently of any other edge.
We will also use the Multiplicative Chernoff bound, as described below:
Fact Chernoff Bound [28]
Notice that G _{ n, p } is almost surely connected for any \(p \geq 2 \frac {\ln {n}}{n}\) [8]. As in the previous section, we consider here a uniform random temporal graph on G, i.e., we consider each edge of G to receive exactly one label uniformly at random from a set {1, 2, …, α}, with α ≥ 4. The selection of the label of an edge is independent of the selection of the label of any other edge. Also, the label selection process is independent of the process of selection of edges in G _{ n, p }. As in Theorem 7, we consider partitioning {1, 2, …, α} into four consecutive subsets, A _{1}, A _{2}, A _{3}, A _{4}, of consecutive positive integers, where each subset is of size either \(\lfloor \frac {\alpha }{4} \rfloor \) or \(\lfloor \frac {\alpha }{4} \rfloor +1\); such a partition is always possible. Now colour green(g), yellow(y), blue(b) and red(r) the edges that are assigned a label in A _{1}, A _{2}, A _{3} and A _{4}, respectively. As in Lemma 6, we have:
Lemma 8
For each particular edge of G and for the label l that it receives, it holds that \(Prob[l \in A_{i}] \geq \frac {1}{7},~ \forall i=1,2,3,4\).
In such instances of G _{ n, p }, we cannot assume the existence of cliques such as the clique of the temporal router used in the previous section. Indeed, even for very dense instances of G _{ n, p }, with \(p=\frac {1}{2}\), the largest clique is at most of size 2lnn [8].
In order to “sparsify” labelled instances G of G _{ n, p }, by removing labels without violating TC, we need to guarantee the existence of much sparser routing subsets of G.
Definition 15

v _{1} connects directly to each a _{ i }, b _{ i }, i = 1, …, k,

v _{2} connects directly to each a _{ i }, b _{ i }, i = 1, …, k,

each pair a _{ i }, b _{ i } is directly connected, i = 1, …, k,

each edge {a _{ i }, b _{ i }} receives a green label, i = 1, …, k,

each edge {a _{ i }, v _{1}} receives a yellow label, i = 1, …, k,

each edge {v _{1}, b _{ i }} receives a blue label, i = 1, …, k,

each edge {v _{2}, a _{ i }} receives a blue label, i = 1, …, k,

each edge {b _{ i }, v _{2}} receives a yellow label, i = 1, …, k.
Note 1

any a _{ i } can reach any b _{ j }, via a journey through v _{1}, i.e., (a _{ i }, v _{1}, b _{ j }) is a journey,

any b _{ i } can reach any a _{ j }, via a journey through v _{2}, i.e., (b _{ i }, v _{2}, a _{ j }) is a journey,

any a _{ i } can reach any a _{ j } ≠ a _{ i }, via a journey through b _{ i } and then v _{2}, i.e., (a _{ i }, b _{ i }, v _{2}, a _{ j }) is a journey,

any b _{ i } can reach any b _{ j } ≠ b _{ i }, via a journey through a _{ i } and then v _{1}, i.e., (b _{ i }, a _{ i }, v _{1}, b _{ j }) is a journey,

v _{1} can reach v _{2}, via any a _{ i }, i.e., (v _{1}, a _{ i }, v _{2}) is a journey,

v _{2} can reach v _{1}, via any b _{ i }, i.e., (v _{2}, b _{ i }, v _{1}) is a journey, and

all other (temporal) connections are direct.
Definition 16
Note that the following Lemma holds:
Lemma 9
Proof
Each edge of R _{ i } is realized in G _{ n, p } with probability p and receives the correct type of label (green, yellow, blue, or red) with probability at least \(\frac {1}{7}\). Note also that the edges of different theta subgraphs R _{ i } and R _{ j }, i ≠ j, are disjoint. Thus, in G _{ n, p }, the random experiments of each of the theta subgraphs R _{ i } appearing are independent from each other and each succeeds with probability at least \(\left (\frac {p}{7} \right )^{5}\). □
Now, consider the set of vertices V∖{v _{1}, v _{2}} and partition it into two almost equal sets V _{1} and V _{2}; note that \(V_{i} \geq \lfloor \frac {n}{2} \rfloor 2 \geq \frac {n}{3} = n^{\prime },~i=1,2\) (since n ≥ 14). Consider a pairing of n ^{′} vertices of V _{1} to n ^{′} vertices of V _{2} and let the n ^{′} different pairs be the possible pairs of vertices a _{ i }, b _{ i } in a theta subgraph R _{ i }. By Lemma 9 and since the random experiments are independent, the number of appearances of R _{ i } is at least the number of successes in a Bernoulli distribution of n ^{′} trials, with success probability \(\left (\frac {p}{7} \right )^{5}\) per trial. Therefore, by the Chernoff bound, we have the following Lemma:
Lemma 10
Consider an instance I of a G _{ n,p } that has been labelled uniformly at random and fix two vertices v _{1} ,v _{2} in I. The probability that there is a temporal router R(v _{1} ,v _{2} ) consisting of at least \(k= \frac {n^{\prime }}{2} \left (\frac {p}{7} \right )^{5} = \frac {n}{6} \left (\frac {p}{7} \right )^{5} \) theta subgraphs R _{ i } is at least \(1 e^{\frac {1}{8} n^{\prime } \left (\frac {p}{7} \right )^{5}} = 1 e^{\frac {n}{24} \left (\frac {p}{7} \right )^{5}} \).
Corollary 4
Note that, again by the Chernoff bound, k asymptotically almost surely does not exceed \(\frac {3}{2}n^{\prime } \left (\frac {p}{7} \right )^{5} \) , since \(Pr[k> \left (1+\frac {1}{2} \right ) E(k)] \leq e^{\frac {n}{36} \left (\frac {p}{7} \right )^{5}}\).
The probability of the edge {u, a _{ i }} being green and the edge {b _{ i }, u ^{′}} being red, for any i, is \(\left (\frac {p}{7} \right )^{2}\) and it is independent of edge experiments inside R(v _{1}, v _{2}). So, we have:
Lemma 11
Proof
Let \(\mathcal {E}_{2}\) be the event that given k pairs of vertices a _{ i }, b _{ i } in a possible R(v _{1}, v _{2}), each vertex pair u, u ^{′}, with u ≠ u ^{′} and u, u ^{′}∉V(R(v _{1}, v _{2})), satisfies the following: there is at least one pair of vertices a _{ i }, b _{ i } such that u connects to a _{ i } with a green edge and u ^{′} connects to b _{ i } with a red edge.
 a)
R(v _{1}, v _{2}) is temporally connected itself, by construction,
 b)
any u∉V(R(v _{1}, v _{2})) has a journey via R(v _{1}, v _{2}) to any other u ^{′} ∈ V in the graph,
 c)
any a _{ i } or b _{ j } can reach any u∉V(R(v _{1}, v _{2})) via a journey through v _{1}(using first a green edge, if we start from a b _{ j } vertex, and then using a yellow, a blue and a red edge to reach u), and
 d)
v _{1} and v _{2} can reach any u∉V(R(v _{1}, v _{2})) via a journey through some vertex b _{ i } (using first a blue or yellow, respectively edge to b _{ i }, and then a red edge to u).
The temporally connected instance I of G _{ n, p } after the removal of redundant edges as described above has a number of labelled edges (i.e., timeedges) that is at most 2n+Θ(k). Since \(k=\frac {n}{6} \left (\frac {p}{7}\right )^{5}\), I has at most Θ(n + n p ^{5}) labels after the removal of the redundant edges.
Recall that we require \(p \geq 7 \left (\frac {\gamma \ln {n}}{n} \right )^{\frac {1}{7}},~\gamma \geq 24\). Therefore, we get the following:
Theorem 8
Consider a G _{ n,p } , with \(p \geq 7 \left (\frac {\gamma \ln {n}}{n} \right )^{\frac {1}{7}}\) , for some γ≥24, labelled uniformly at random. Then, any instance I of G _{ n,p } needs only Θ(n+np ^{5} ) timeedges to be temporally connected, with probability at least \(12e^{\frac {\gamma }{24} \ln {n}}\).
Proof
Note that for the sparsest possible G _{ n, p } here, i.e., for \(p= 7 \left (\frac {\gamma \ln {n}}{n} \right )^{\frac {1}{7}} \) , we need only \({\Theta }(n+n^{\frac {2}{7}} (\ln {n})^{\frac {5}{7}}) = {\Theta }(n)\) edges (and, thus, labels) to satisfy TC, with probability at least \(1  2e^{\frac {\gamma }{24} \ln {n}},~ \gamma \geq 24\).
5 Conclusions and Further Research
In this work, we study the complexity of testing and designing issues of nearly costoptimal temporal networks that are temporally connected. It remains an open problem to provide a polynomialtime constant factor approximation algorithm for the computation of the removal profit in a given temporally connected temporal graph. Further research could also investigate the complexity of computing the removal profit in special classes of graphs, e.g., planar graphs or the grid. Extensions of this research also include the study of the interval temporal networks model, where edges can be available for continuous intervals of time, as well as a more indepth study of models of random temporal networks.
Footnotes
 1.
One can prove this by induction.
 2.
Any connected undirected graph needs at least n − 1 labels on its edges to be temporally connected, and we show a TC satisfying labelling of 2n − 3 = Θ(n) labels.
 3.
The edge before it in the sequence of edges from the root w ^{′} to the respective leaf.
 4.
PTAS stands for PolynomialTime Approximation Scheme.
Notes
Acknowledgements
The authors wish to thank the anonymous reviewers for their comments and suggestions that helped correct the initial manuscript and improve the quality of the work. We wish to give special thanks to the reviewers for the suggestion of the theoretical proof of Theorem 4(a), which now replaces the program code previously used in the proof.
This work was supported in part by:
(i) the School of EEE/CS and its NeST initiative at the University of Liverpool
(i) the FET EU IP Project MULTIPLEX under contract No. 317532, and
(i) the EPSRC Grant EP/K022660/1.
References
 1.Akrida, E.C., Gąsieniec, L., Mertzios, G.B., Spirakis, P.G.: Ephemeral networks with random availability of links: diameter and connectivity. In: Proceedings of the 26th ACM Symposium on Parallelism in Algorithms and Architectures (SPAA) (2014)Google Scholar
 2.Akrida, E.C., Gąsieniec, L., Mertzios, G.B., Spirakis, P.G.: On temporally connected graphs of small cost. In: Proceedings of the 13th Workshop on Approximation and Online Algorithms (WAOA) (2015)Google Scholar
 3.Akrida, E.C., Spirakis, P.G.: On verifying and maintaining connectivity of interval temporal networks. In: Bose, P., Gasieniec, L.A., Römer, K., Wattenhofer, R. (eds.) Algorithms for Sensor Systems  11th International Symposium on Algorithms and Experiments for Wireless Sensor Networks, ALGOSENSORS 2015, September 17–18, 2015, Revised Selected Papers, Lecture Notes in Computer Science, vol. 9536, pp 142–154. Springer, Patras, Greece (2015). doi: 10.1007/9783319284729_11 Google Scholar
 4.Alimonti, P., Kann, V.: Hardness of approximating problems on cubic graphs. In: Proceedings of the Third Italian Conference on Algorithms and Complexity, CIAC ’97, pp 288–298. Springer, London, UK (1997). http://dl.acm.org/citation.cfm?id=648256.752884 Google Scholar
 5.Angluin, D., Aspnes, J., Diamadi, Z., Fischer, M., Peralta, R.: Computation in networks of passively mobile finitestate sensors. Distrib. Comput., 235–253 (2006)Google Scholar
 6.Avin, C., Koucký, M., Lotker, Z.: How to explore a fastchanging world (cover time of a simple random walk on evolving graphs). In: Proceedings of the 35th International Colloquium on Automata, Languages and Programming (ICALP), pp. 121–132 (2008)Google Scholar
 7.Barjon, M., Casteigts, A., Chaumette, S., Johnen, C., Neggaz, Y.M.: Testing Temporal Connectivity in Sparse Dynamic Graphs. arXiv:1404.7634 (2014)
 8.Bollobás, B.: Random Graphs, 2nd edn. Cambridge University Press, Cambridge (2001)CrossRefGoogle Scholar
 9.BuiXuan, B.M., Ferreira, A., Jarry, A.: Computing shortest, fastest, and foremost journeys in dynamic networks. Int. J. Found. Comput. Sci. 14(2), 267–285 (2003)MathSciNetCrossRefMATHGoogle Scholar
 10.Casteigts, A., Flocchini, P., Quattrociocchi, W., Santoro, N.: Timevarying graphs and dynamic networks. Int. J. Parallel Emergent Distrib. Syst. (IJPEDS) 27(5), 387–408 (2012)CrossRefGoogle Scholar
 11.Chaintreau, A., Mtibaa, A., Massoulié, L., Diot, C.: The diameter of opportunistic mobile networks. In: Kurose, J., Schulzrinne, H. (eds.) Proceedings of the 2007 ACM Conference on Emerging Network Experiment and Technology, CoNEXT 2007, New York, NY, USA, December 10–13, 2007, p. 12. ACM (2007). doi: 10.1145/1364654.1364670
 12.Clementi, A.E.F., Macci, C., Monti, A., Pasquale, F., Silvestri, R.: Flooding time of edgemarkovian evolving graphs. SIAM J. Discret. Math. (SIDMA) 24(4), 1694–1712 (2010)MathSciNetCrossRefMATHGoogle Scholar
 13.Dutta, C., Pandurangan, G., Rajaraman, R., Sun, Z., Viola, E.: On the complexity of information spreading in dynamic networks. In: Proceedings of the 24th Annual ACMSIAM Symposium on Discrete Algorithms (SODA), pp. 717–736 (2013)Google Scholar
 14.Fleischer, L., Skutella, M.: Quickest flows over time. SIAM J. Comput. 36(6), 1600–1630 (2007). doi: 10.1137/S0097539703427215 MathSciNetCrossRefMATHGoogle Scholar
 15.Fleischer, L., Tardos, É.: Efficient continuoustime dynamic network flow algorithms. Oper. Res. Lett. 23(35), 71–80 (1998)MathSciNetCrossRefMATHGoogle Scholar
 16.Gavoille, C., Peleg, D., Perennes, S., Raz, R.: Distance labeling in graphs. In: Proceedings of the 12th Annual ACMSIAM Symposium on Discrete Algorithms (SODA), pp. 210–219 (2001)Google Scholar
 17.Gupta, A., Krishnaswamy, R., Ravi, R.: Online and stochastic survivable network design. SIAM J. Comput. 41(6), 1649–1672 (2012). doi: 10.1137/09076725X MathSciNetCrossRefMATHGoogle Scholar
 18.Katz, M., Katz, N.A., Korman, A., Peleg, D.: Labeling schemes for flow and connectivity. SIAM J. Comput. 34(1), 23–40 (2004)MathSciNetCrossRefMATHGoogle Scholar
 19.Kempe, D., Kleinberg, J.M., Kumar, A.: Connectivity and inference problems for temporal networks. In: Proceedings of the 32nd Annual ACM Symposium on Theory of Computing (STOC), pp. 504–513 (2000)Google Scholar
 20.Klinz, B., Woeginger, G.J.: One, two, three, many, or: complexity aspects of dynamic network flows with dedicated arcs. Oper. Res. Lett. 22(45), 119–127 (1998). doi: 10.1016/S01676377(98)000091 MathSciNetCrossRefMATHGoogle Scholar
 21.Koch, R., Nasrabadi, E., Skutella, M.: Continuous and discrete flows over time  a general model based on measure theory. Math. Meth. OR 73(3), 301–337 (2011). doi: 10.1007/s0018601103572 MathSciNetCrossRefMATHGoogle Scholar
 22.Kuhn, F., Lynch, N.A., Oshman, R.: Distributed computation in dynamic networks. In: Proceedings of the 42nd Annual ACM Symposium on Theory of Computing (STOC), pp. 513–522 (2010)Google Scholar
 23.Lau, L.C., Naor, J., Salavatipour, M.R., Singh, M.: Survivable network design with degree or order constraints. SIAM J. Comput. 39(3), 1062–1087 (2009). doi: 10.1137/070700620 MathSciNetCrossRefMATHGoogle Scholar
 24.Lau, L.C., Singh, M.: Additive approximation for bounded degree survivable network design. SIAM J. Comput. 42(6), 2217–2242 (2013). doi: 10.1137/110854461 MathSciNetCrossRefMATHGoogle Scholar
 25.Mertzios, G.B., Michail, O., Chatzigiannakis, I., Spirakis, P.G.: Temporal network optimization subject to connectivity constraints. In: Proceedings of the 40th International Colloquium on Automata, Languages and Programming (ICALP), Part II, pp. 657–668 (2013)Google Scholar
 26.Michail, O., Chatzigiannakis, I., Spirakis, P.G.: New Models for Population Protocols. Synthesis Lectures on Distributed Computing Theory Morgan & Claypool Publishers (2011)Google Scholar
 27.Michail, O., Chatzigiannakis, I., Spirakis, P.G.: Causality, influence, and computation in possibly disconnected synchronous dynamic networks OPODIS, pp. 269–283 (2012)Google Scholar
 28.Mitzenmacher, M., Upfal, E.: Probability and Computing: Randomized Algorithms and Probabilistic Analysis. Cambridge University Press (2005). https://books.google.co.uk/books?id=0bAYl6d7hvkC
 29.Molloy, M., Reed, B.: Graph Colouring and the Probabilistic Method, Algorithms and Combinatorics, vol. 23. Springer (2002)Google Scholar
 30.O’Dell, R., Wattenhofer, R.: Information dissemination in highly dynamic graphs. In: Proceedings of the 2005 Joint Workshop on Foundations of Mobile Computing (DIALMPOMC), pp. 104–110 (2005)Google Scholar
 31.Papadimitriou, C.H., Yannakakis, M.: Optimization, approximation, and complexity classes. J. Comput. Syst. Sci. 43(3), 425–440 (1991). doi: 10.1016/00220000(91)90023X MathSciNetCrossRefMATHGoogle Scholar
 32.Scheideler, C.: Models and techniques for communication in dynamic networks. In: Proceedings of the 19th Annual Symposium on Theoretical Aspects of Computer Science (STACS), vol. 2285, pp. 27–49 (2002)Google Scholar
 33.Whitbeck, J., Dias de Amorim, M., Conan, V., Guillaume, J.L.: Temporal reachability graphs. In: Proceedings of the 18th Annual International Conference on Mobile Computing and Networking, Mobicom ’12, pp 377–388. ACM, New York, NY, USA (2012). doi: 10.1145/2348543.2348589 CrossRefGoogle Scholar
Copyright information
Open AccessThis article is distributed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits unrestricted use, distribution, and reproduction in any medium, provided you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license, and indicate if changes were made.