# The Complexity of Optimal Design of Temporally Connected Graphs

- 386 Downloads

## 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 polynomial-time 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 polynomial-time 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 cost-efficient by removing labels without destroying temporal connectivity (redundant labels). Our main technical result is that computing the maximum number of redundant labels is APX-hard, 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 *n*log*n* labels.

### Keywords

Temporal graphs Network design Temporally connected Minimal graph APX-hard Random input## 1 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 real-life 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 time-respecting 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 pre-exist for the network; then, one is able to design a temporally connected temporal network using only the pre-existing 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 pre-existing 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 sub-category of (single-labelled) temporal graphs:

**Definition 9** (SLSE temporal graphs)

A Single-label-single-edge (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 single-labelled model of the seminal paper of [19] as well as the multi-labelled 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 pseudo-polynomial, 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 time-varying graph) there is a (*u*, *v*)-journey leaving *u* after *t* and arriving at *v* after at most some specified time-interval. In [7], the authors investigate discrete-time 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 linear-cost (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 APX-hard, 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^{th} 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 time-interval [ *t*_{1}, *t*_{2}] or multiple such time-intervals 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 time-step 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 time-step with some probability depending on whether it existed in the previous time-step. 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 polynomial-time 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**

*Algorithm 1 satisfies the following, for every vertex v*∈

*V*,

*v*≠

*s*:

- (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**

*The time complexity of Algorithm 1 is O(c(L)⋅ logc(L)).*

*Proof*

The time complexity of the algorithm is dominated by the sorting time of *S*(*L*). One can sort *S*(*L*) by comparison-based sorting resulting in running time *O*(|*S*(*L*)|⋅ log|*S*(*L*)|) = *O*(*c*(*L*)⋅ log*c*(*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*_{start} > 0. Simply, one ignores the time edges with labels smaller than the start time.

## 3 Asymptotically Cost-Optimal 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*

*n*vertices,

*n*≥ 3. Let

*v*

_{n}be the root and

*v*

_{1},

*v*

_{2}, …,

*v*

_{n − 1}be the leaves. In any labelling on the star graph, which assigns only one label to two (or more) edges (

*v*

_{n},

*v*

_{x}), (

*v*

_{n},

*v*

_{y}),

*x*,

*y*= 1, 2, …,

*n*− 1,

*x*≠

*y*, at least one of the vertices

*v*

_{x},

*v*

_{y}cannot reach the other via a journey. Therefore, any TC satisfying labelling on the star graph must assign at least 2 labels to all edges of the graph, except possibly on one edge where it assigns a single label. The TC satisfying labelling which assigns labels 1,3 to all edges except for one and label 2 to the remaining edge has, therefore, minimum cost, namely 2

*n*− 3 (cf. Fig. 1). □

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*) ≥ 2*n*− 3. - (b)
*Given a connected undirected graph G*= (*V, E*)*of n*≥ 2*vertices, we can design a labelling L of cost c*(*L*) = 2*n*− 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 2

*n*− 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 = 2*k*− 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 sub-labelling 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$$\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} $$*v*_{0}, …,*v*_{last}and \(l_{0}<\ldots < l_{z}<l_{small}<l_{big}< l_{z^{\prime }} < {\ldots } <l_{last}\) (cf. Fig. 2).But, then the sub-journey of

*J*which “ignores” the time-edges (*u*^{′},*u*,*l*_{small}), (*u*,*u*^{′},*l*_{big}) 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*^{′}) ≥ 2*k*− 3 (by Induction Hypothesis).If

*c*(*L*^{′}) ≥ 2*k*− 2, then (since*L*assigns at least one label to the edge {*u*,*u*^{′}}), we have*c*(*L*) ≥ 2*k*− 2+1=2*k*− 1 and the Theorem holds.It remains to check the case where*c*(*L*^{′}) = 2*k*− 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)=2*k*− 2. Let*l*_{unique}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*_{unique}. 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*_{unique}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 = 2k-3+2 = 2k-1$$Therefore, in any case, for

*L*to satisfy TC on*G*, it needs to have cost*c*(*L*) ≥ 2*k*− 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- 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.

*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).

**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*) ≥ 2*n* − 4.

*n*− 4 as the lower bound in the above conjecture is due to the fact that there are graphs, e.g., a cycle with

*n*= 4 vertices, that can be made temporally connected using 2

*n*− 4 labels in total (cf. Fig. 6); therefore, the lower bound 2

*n*− 3 which is shown for trees in Theorem 2(a) cannot be generic.

## 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 non-linear in *n* cost, namely with *O*(*n*log*n*) labels.

#### 4.1.1 A Minimal Temporal Design of *n*log*n* Cost

**Definition 10** (Hypercube graph)

The *k*-hypercube graph, commonly denoted *Q*_{k}, is a *k*-regular graph of 2^{k} vertices and 2^{k − 1}⋅*k* edges. The 1-hypercube is the graph of two vertices and one edge. Recursively, the *n*-hypercube 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 *n*-dimensional space that is congruent to a Euclidean space of lower dimension, e.g., the flats in the two-dimensional space are points and lines. In the *n*-dimensional 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*

*n*vertices. Consider Protocol 2 for labelling the edges of

*G*=

*Q*

_{k}= (

*V*,

*E*). The temporal graph,

*G*(

*L*), that this labelling procedure produces on the hypercube is minimal. Indeed, first we will prove that the temporal graph produced by Protocol 2 satisfies TC on

*G*=

*Q*

_{k}.

*u*,

*v*∈

*V*and the steps described in Protocol 3 to reach

*v*, starting from

*u*, via temporal edges. The procedure described in Protocol 3 gives a journey from

*u*to

*v*, which is also

*unique*. It suffices to consider the

*k*-bit binary representation of the vertices of

*G*. Notice that if the hamming distance of the labels of two vertices

*u*,

*v*∈

*V*(

*G*) is exactly

*m*, then to reach

*v*from

*u*via a temporal path in the temporal graph on

*G*, we need to move through vertices by consecutively swapping the bits in which

*u*and

*v*differ in the order of dimensions. This way, we maintain the strictly increasing order of the time labels we use and, swap by swap, we approach the destination. Note also that swapping only the bits in which

*u*and

*v*differ is the only way to not violate the increasing order of time labels we use: without loss of generality, suppose that the

*j*

^{th}bit of

*u*is 1 and so is

*j*

^{th}bit of

*v*. If, starting from

*u*, we swap the

*j*

^{th}bit to 0, i.e., we use an edge,

*e*, on the

*j*

^{th}dimension, then at a future step, we again need to swap the

*j*

^{th}bit back to 1 (otherwise, we never reach

*v*). However, the two swaps cannot be consecutive, because then we would use edge

*e*twice and we violate the increasing order of labels. So, we would need to move to a higher dimension after the first of the two swaps; but, then, we have used labels that are larger than all the labels of the

*j*

^{th}dimension, so using any edge of the

*j*

^{th}dimension would also violate the increasing order of labels.

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 non-linear 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 sub-cases: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 4-clique 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 4-clique 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 APX-hard

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 Max-XOR(3)* problem. Consider a monotone XOR-boolean formula *ϕ* with variables *x*_{1}, *x*_{2}, …, *x*_{n}, i.e., a boolean formula that is the conjunction of XOR-clauses of the form (*x*_{i}⊕*x*_{j}), where no variable is negated. The clause *α* = (*x*_{i}⊕*x*_{j}) is XOR-satisfied by a truth assignment *τ* if and only if *x*_{i}≠*x*_{j} in *τ*. The number of clauses of *ϕ* that are XOR-satisfied in *τ* is denoted by |*τ*(*ϕ*)|. If every variable *x*_{i} appears in exactly *r* XOR-clauses in *ϕ*, then *ϕ* is called a *monotone XOR*(*r*) formula. The *monotone Max-XOR*(*r*) problem is, given a monotone XOR(*r*) formula *ϕ*, to compute a truth assignment *τ* of the variables *x*_{1}, *x*_{2}, …, *x*_{n} that XOR-satisfies the largest possible number of clauses, i.e., an assignment *τ* such that |*τ*(*ϕ*)| is maximized. The monotone Max-XOR(3) problem essentially encodes the *Max-Cut* problem on 3 -regular (i.e., cubic) graphs, which is known to be APX-hard [4].

**Lemma 2**

[4] *The monotone Max-XOR(3) problem is APX-hard.*

Now we provide our reduction from the monotone Max-XOR(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 high-level 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 time-labels that can be removed from *G*_{ϕ} without destroying TC. Thus an optimum solution of the monotone Max-XOR(3) problem on *ϕ* corresponds to an optimal removal profit in *G*_{ϕ}.

*G*

_{ϕ}from the formula

*ϕ*. First we construct for every variable

*x*

_{i}, where 1 ≤

*i*≤

*n*, the gadget-graph

*G*

_{ϕ, i}together with a labelling

*L*

_{ϕ, i}of its edges, as illustrated in Fig. 9. In this figure, the labels of every edge in

*L*

_{ϕ, i}are drawn next to the edge. We call the induced subgraph of

*G*

_{ϕ, i}on the 4 vertices \( \{s^{x_{i}},u_{0}^{x_{i}},w_{0}^{x_{i}},v_{0}^{x_{i}}\}\) the

*base*of

*G*

_{ϕ, i}. Moreover, for every

*p*∈ {1, 2, 3}, we call the induced subgraph of

*G*

_{ϕ, i}on the 4 vertices \( \{t_{p}^{x_{i}},u_{p}^{x_{i}},w_{p}^{x_{i}},v_{p}^{x_{i}}\}\) the

*p*

*th branch*of

*G*

_{ϕ, i}. Finally, we call the edges \(\{ u_{0}^{x_{i}} , w_{0}^{x_{i}} \}\) and \( \{ w_{0}^{x_{i}} , v_{0}^{x_{i}} \}\) the

*transition edges*of the base of

*G*

_{ϕ, i}and, for every

*p*∈ {1, 2, 3}, we call the edges \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \}\) and \( \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \}\) the

*transition edges*of the

*p*th branch of

*G*

_{ϕ, i}. For every

*p*∈ {1, 2, 3} we associate the

*p*th appearance of the variable

*x*

_{i}with the

*p*th branch of

*G*

_{ϕ, i}.

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 *p*th 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 *p*th time in *ϕ*.

*α*= (

*x*

_{i}⊕

*x*

_{j}) of

*ϕ*. Assume that the variable

*x*

_{i}(resp.

*x*

_{j}) of

*α*corresponds to the

*p*th (resp. to the

*q*th) appearance of

*x*

_{i}(resp. of

*x*

_{j}) in

*ϕ*. Then we identify the vertices \({u_{p}^{x_{i}},v_{p}^{x_{i}},w_{p}^{x_{i}},t_{p}^{x_{i}}}\) of the

*p*th branch of

*G*

_{ϕ, i}with the vertices \( v_{q}^{x_{i}},u_{q}^{x_{i}},w_{q}^{x_{i}},t_{q}^{x_{i}}\) of the

*q*th branch of

*G*

_{ϕ, j}, respectively (cf. Fig. 10b). Now we add an edge between any possible pair of vertices \(t_{p}^{x_{i}},t_{q}^{x_{j}}\),

*i*,

*j*∈ {1, 2, …,

*n*}, and

*p*,

*q*∈ {1, 2, 3}. We assign to this new edge \(e= \{ t_{p}^{x_{i}} , t_{q}^{x_{j}} \}\) the unique label

*L*

_{ϕ}(

*e*) = {7}.

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 gadget-graphs *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 *p*th branch of *G*_{ϕ, i} and to the *q*th 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* XOR-satisfied 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 sub-labelling *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 *p*th 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 10*n* + 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(m-1)}{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+m-1)}{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 *p*th 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**

*Let L*⊆

*L*

_{ϕ}

*be a labelling of the graph G*

_{ϕ}.

*If L satisfies TC on G*

_{ϕ},

*then L contains:*

- (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 XOR-satisfies *k* clauses of *ϕ*. We construct a labelling *L* of *G*_{ϕ} by removing 9*n* + *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}} \} \).

*L*as follows. Consider an arbitrary clause

*α*= (

*x*

_{i}⊕

*x*

_{j}) of

*ϕ*. Assume that the variable

*x*

_{i}(resp.

*x*

_{j}) of the clause

*α*corresponds to the

*p*th (resp. to the

*q*th) appearance of variable

*x*

_{i}(resp.

*x*

_{j}) in

*ϕ*. Then, by the construction of

*G*

_{ϕ}, the

*p*th branch of

*G*

_{ϕ, i}coincides with the

*q*th branch of

*G*

_{ϕ, j}, i.e., \( u_{p}^{x_{i}}=v_{q}^{x_{j}}\), \(v_{p}^{x_{i}}=u_{q}^{x_{j}}\), \( w_{p}^{x_{i}}=w_{q}^{x_{j}}\), and \(t_{p}^{x_{i}}=t_{q}^{x_{j}}\) (cf. Fig. 10b). Let

*α*be XOR-satisfied in

*τ*, i.e., \(x_{i}=\overline {x_{j}}\). If \(x_{i}=\overline {x_{j}}=0\) (i.e.,

*x*

_{i}=0 and

*x*

_{j}=1) then we keep in

*L*the label 1 of the edge \( \{ v_{p}^{x_{i}} , w_{p}^{x_{i}} \} \) and the label 2 of the edge \( \{ w_{p}^{x_{i}} , u_{p}^{x_{i}} \} \) , cf. Fig. 11a. In the symmetric case, where \(x_{i}=\overline {x_{j}}=1\) (i.e.,

*x*

_{i}=1 and

*x*

_{j}=0), we keep in

*L*the label 1 of the edge \( \{ u_{p}^{x_{i}} , w_{p}^{x_{i}} \} \) and the label 2 of the edge \( \{ w_{p}^{x_{i}} , v_{p}^{x_{i}} \} \). Let now

*α*be XOR-unsatisfied in

*τ*, i.e.,

*x*

_{i}=

*x*

_{j}. Then, in both cases where

*x*

_{i}=

*x*

_{j}=0 and

*x*

_{i}=

*x*

_{j}=1, we keep in

*L*the label 1 of both edges \( \{ v_{p}^{x_{i}} , w_{p}^{x_{i}} \} \) and \( \{ w_{p}^{x_{i}} , u_{p}^{x_{i}} \} \), cf. Fig 11b. This finalizes the labelling

*L*of

*G*

_{ϕ}. It is easy to check that

*L*satisfies TC on

*G*

_{ϕ}.

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 6*n* labels of *L*_{ϕ} for all variables *x*_{1}, *x*_{2}, …, *x*_{n}. For each of the *k* XOR-satisfied 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 *p*th branch of *G*_{ϕ, i}. That is, *L* misses in total 3*k* labels of *L*_{ϕ} for all XOR-satisfied clauses. Furthermore, for each of the *m* − *k* XOR-satisfied 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 *p*th branch of *G*_{ϕ, i}. That is, *L* misses in total 2(*m* − *k*) =3*n* − 2*k* labels of *L*_{ϕ} for all XOR-satisfied clauses. All other labels of *L*_{ϕ} remain in the labelling *L* ⊆ *L*_{ϕ}. Therefore, *L* misses in total 6*n*+3*k*+3*n* − 2*k* = 9*n* + *k* labels from *L*_{ϕ}.

(⇐) Assume that *r*(*G*_{ϕ}, *L*_{ϕ}) ≥ 9*n* + *k* and let *L* ⊆ *L*_{ϕ} be a TC preserving labelling of *G*_{ϕ} with |*L*_{ϕ}∖*L*| = *r*(*G*_{ϕ}, *L*_{ϕ}) ≥ 9*n* + *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 2*n* + 2*m* 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 2*n* transition edges on the different bases of *G*_{ϕ} and 2*m* 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(m-1)}{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+m-1)}{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 4*n* + *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*}.

*L*mentioned above are on different edges, so no subset of labels has been accounted for more than once. Therefore, since \(m=\frac {3n}{2}\),

*L*contains at least:

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 *τ* XOR-satisfies 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* XOR-satisfied by *τ* in *ϕ*. Let *x*_{i} (resp. *x*_{j}) be associated with the *p*th (resp. *q*th) branch of *G*_{ϕ, i} (resp. of *G*_{ϕ, j}). Since *α* is *not* XOR-satisfied, 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*^{th} branch of *G*_{ϕ, i}, which is identified with the *q*^{th} 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 non-satisfied 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 )|\).

*L*contains in total at least:

*L*

_{ϕ}has a total of \(\frac {17}{4} n^{2} +28n +1\) labels. Therefore, we have:

Therefore 9*n* + *k* ≤ |*L*_{ϕ}∖*L*| ≤ 9*n* + |*τ*(*ϕ*)|, 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*_{mon-Max-XOR(3)}*(ϕ) the greatest number of clauses that can be simultaneously XOR-satisfied by a truth assignment of ϕ. Then r(G*_{ϕ}*,L*_{ϕ}*)=9n+OPT*_{mon-Max-XOR(3)}*(ϕ).*

*Proof*

Let *τ* be a truth assignment that satisfies *k* = *OPT*_{mon-Max-XOR(3)}(*ϕ*) clauses of *ϕ*. Then there exists by Theorem 5 a TC satisfying labelling *L* ⊆ *L*_{ϕ} of *G*_{ϕ} such that |*L*_{ϕ}∖*L*| ≥ 9*n* + *k*. Thus, since *r*(*G*_{ϕ}, *L*_{ϕ}) ≥ |*L*_{ϕ}∖*L*|, it follows that *r*(*G*_{ϕ}, *L*_{ϕ}) ≥ 9*n* + *OPT*_{mon-Max-XOR(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*_{ϕ})−9*n* clauses of *ϕ* . Thus OPT _{mon-Max-XOR(3)}(*ϕ*) ≥ *r*(*G*_{ϕ}, *L*_{ϕ})−9*n*, 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 APX-hard.*

*Proof*

_{mon-Max-XOR(3)}(

*ϕ*) the greatest number of clauses that can be simultaneously XOR-satisfied by a truth assignment of

*ϕ*. The proof is done by an

*L-reduction*[31] from the monotone Max-XOR(3) problem, i.e. by an approximation preserving reduction which linearly preserves approximability features. For such a reduction, it suffices to provide a polynomial-time computable function

*g*and two constants

*α*,

*β*>0 such that:

*r*(*G*_{ϕ},*L*_{ϕ}) ≤*α*⋅*OPT*_{mon-Max-XOR(3)}(*ϕ*), for any monotone XOR(3) formula*ϕ*, andfor any TC satisfying labelling

*L*⊆*L*_{ϕ}of*G*_{ϕ},*g*(*L*) is a truth assignment for*ϕ*and OPT_{mon-Max-XOR(3)}(*ϕ*)−|*g*(*L*)| ≤*β*⋅(*r*(*G*_{ϕ},*L*_{ϕ})−|*L*_{ϕ}∖*L*|), where |*g*(*L*)| is the number of clauses of*ϕ*that are satisfied by*g*(*L*).

*α*= 13. Note that a random truth assignment XOR-satisfies each clause of

*ϕ*with probability \(\frac {1}{2} \), and thus there exists an assignment

*τ*that XOR-satisfies at least \( \frac {m}{2}\) clauses of

*ϕ*. Therefore OPT\(_{\text {mon-Max-XOR}(3)}(\phi )\geq \frac {m}{2}=\frac {3}{4}n\), and thus \(n\leq \frac {4}{3}\textit {OPT}_{\text { mon-Max-XOR}(3)}(\phi )\). Now Corollary 3 implies that:

*β*= 1, consider an arbitrary labelling

*L*⊆

*L*

_{ϕ}of

*G*

_{ϕ}. As described in the (⇐ )-part of the proof of Theorem 5, we construct in polynomial time a truth assignment

*g*(

*L*) =

*τ*that satisfies at least |

*L*

_{ϕ}∖

*L*|−9

*n*clauses of

*ϕ*, i.e. |

*g*(

*L*)|=|

*τ*(

*ϕ*)|≥|

*L*

_{ϕ}∖

*L*|−9

*n*. Then:

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 NP-hard in the strong sense, since all numbers used in the reduction are constant integers.

**Open Problem**

Is there a polynomial-time 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ös-Renyi model of random graphs, *G*_{n, p} and we examine whether we can delete labels from such temporal graphs and continue preserving TC.

The (single-labelled) 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 *α* = 4*k* + *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,…,2*k*}, *A*_{3} = {2*k* + 1,…,3*k*}, *A*_{4} = {3*k* + 1,…,4*k*}.

For *v* = 1, we use *A*_{1} = {1, …, *k*}, *A*_{2} = {*k* + 1,…,2*k*}, *A*_{3} = {2*k* + 1,…,3*k*}, *A*_{4} = {3*k* + 1,…,4*k* + 1}.

For *v* = 2, we use *A*_{1} = {1, …, *k*}, *A*_{2} = {*k* + 1,…,2*k*}, *A*_{3} = {2*k* + 1,…,3*k* + 1},*A*_{4} = {3*k* + 2,…,4*k* + 2}.

For *v* = 3, we use *A*_{1} = {1, …, *k*}, *A*_{2} = {*k* + 1,…,2*k* + 1},*A*_{3} = {2*k* + 2,…,3*k* + 2},*A*_{4} = {3*k*+3,…,4*k*+3}.

*K*

_{n}receives a single random label

*l*, with:

*k*≥ 1 (because

*α*≥ 4), we have \(\frac {k}{4k+3} \geq \frac {1}{7}\). So, we get the following Lemma:

**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**

*G*=

*K*

_{n}= (

*V*,

*E*) is a subgraph

*R*= (

*V*

_{R},

*E*

_{R}) of

*G*, with 2

*γ*log

*n*+ 1 vertices,

*γ*being a constant such that \(\gamma \geq 4 \cdot \frac {1}{\log _{2}{\frac {2500}{2499}}}\), with the following properties (all logarithms are with base 2 here):

- a)
*V*_{R}is the union of a particular vertex*v*_{0}(called the*centre*of*R*) and two equisized vertex sets*V*_{in}and*V*_{out}, each of*γ*log*n*vertices, and - b)
*R*is the induced subgraph of*G*formed from*V*_{R}(so it is a clique itself).

*R*has \(|E_{R}|=2 \gamma \log {n} + \frac {(2 \gamma \log {n})\cdot (2 \gamma \log {n}-1)}{2}\) edges.

*w*,

*w*

^{′}be any two vertices of the clique that are not in

*V*

_{R}. We consider the edges connecting

*w*to

*V*

_{in}and the edges connecting

*w*

^{′}to

*V*

_{out}; using those edges and the edges of

*R*, there are

*γ*log

*n*edge-disjoint paths of length 4 (each) connecting

*w*and

*w*

^{′}. Let us call those paths

*special paths*and note that every such path uses edges of the form {

*w*,

*v*

_{in}}, {

*v*

_{in},

*v*

_{0}}, {

*v*

_{0},

*v*

_{out}}, {

*v*

_{out},

*w*

^{′}}, where

*v*

_{in}∈

*V*

_{in}and

*v*

_{out}∈

*V*

_{out}(cf. Fig. 13).

Each special path *P* = (*w*, *v*_{in}, *v*_{0}, *v*_{out}, *w*^{′}) connecting *w* and *w*^{′} becomes a (*w*, *w*^{′})-journey if the label *l*_{1} of {*w*, *v*_{in}} is in *A*_{1}, the label *l*_{2} of {*v*_{in}, *v*_{0}} is in *A*_{2}, the label *l*_{3} of {*v*_{0}, *v*_{out}} is in *A*_{3}, and the label *l*_{4} of {*v*_{out}, *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.

*w*and

*w*

^{′}are edge-disjoint, the probability that none of them is a (

*w*,

*w*

^{′})-journey is:

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*\(1-n^{-\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.

*G*

^{′}of journeys between pairs of vertices

*w*,

*w*

^{′},

*w*≠

*w*

^{′}, none of which is in

*V*

_{R}; there are at most

*n*

^{2}such pairs of vertices. Under the random labelling on

*G*, let \(\mathcal {E}_{1}\) be the event that there exists a pair

*w*,

*w*

^{′}∈

*V*∖

*V*

_{R}such that there is no (

*w*,

*w*

^{′})-journey via a special path through

*R*. Also, let \(\mathcal {E}_{2}\) be the event that for a specific pair

*w*,

*w*

^{′}∈

*V*∖

*V*

_{R}, there is no (

*w*,

*w*

^{′})-journey via a special path through

*R*. Then,

*γ*to be \(\gamma \geq 4 \cdot \frac {1}{\log _{2}{\frac {2500}{2499}}}\). Then, we have:

#### 4.3.2 High removal profit in dense random Erdös-Renyi graphs

In this section, we consider the underlying graph *G* = (*V*, *E*) to be an instance of the Erdös-Renyi 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** (Erdos-Renyi 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]

*X*

_{1}, …,

*X*

_{n}are independent random variables taking values in {0,1}. Let

*X*denote their sum and let

*μ*=

*E*[

*X*] denote the sum’s expected value. Then, for 0 <

*δ*< 1:

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 2ln*n* [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},

*v*

_{2}of

*G*

_{n, p}, a

*temporal router*,

*R*(

*v*

_{1},

*v*

_{2}),

*in an instance*

*I*

*of*

*G*

_{n, p}is a subgraph of

*I*that has vertices

*v*

_{1},

*v*

_{2}and additional vertices

*a*

_{1}, …,

*a*

_{k}and

*b*

_{1}, …,

*b*

_{k}so that:

*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*

*R*(

*v*

_{1},

*v*

_{2}) in an instance

*I*of

*G*

_{n, p}is

*temporally connected*since:

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, andall other (temporal) connections are direct.

**Definition 16**

*R*

_{i}and call it the

*i*

^{th}

*theta subgraph of*

*R*(

*v*

_{1},

*v*

_{2}) the labelled subgraph of

*R*(

*v*

_{1},

*v*

_{2}) induced by the vertices

*v*

_{1},

*v*

_{2},

*a*

_{i}, and

*b*

_{i}, for some

*i*= 1, …,

*k*(cf. Fig. 16).

Note that the following Lemma holds:

**Lemma 9**

*Let I be an instance of G*

_{n, p}

*with a uniform random labelling from the set {1, 2, …, α}, α ≥ 4. Fix two vertices v*

_{1}

*,v*

_{2}

*and 2k vertices a*

_{i}

*,b*

_{i}

*, i = 1, …, k, in I. Then, for each particular i = 1, …, k, the probability that the subgraph induced by the vertices v*

_{1}

*,v*

_{2}

*, a*

_{i}

*, b*

_{i}

*is a theta subgraph is:*

*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}}\).

*I*of a labelled

*G*

_{n, p}has a temporal router

*R*(

*v*

_{1},

*v*

_{2}) of at least \(k=\frac {n}{6} \left (\frac {p}{7} \right )^{5}\) theta subgraphs. By Lemma 10, we know that:

*R*(

*v*

_{1},

*v*

_{2}) exists, any vertex

*u*that is not in

*R*(

*v*

_{1},

*v*

_{2}) can reach any vertex

*u*

^{′}that is also not in

*R*(

*v*

_{1},

*v*

_{2})

*through*

*R*(

*v*

_{1},

*v*

_{2}) via a journey, if

*u*connects to some

*a*

_{i}directly with a green edge, and

*b*

_{i}connects to

*u*

^{′}directly with a red edge. Then, (

*u*,

*a*

_{i},

*v*

_{1},

*b*

_{i},

*u*

^{′}) is a journey.

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**

*Condition on the event*\(\mathcal {E}_{1}\)

*of the existence of R(v*

_{1}

*,v*

_{2}

*) in G*

_{n,p}

*with at least*\(k= \frac {n}{6} \left (\frac {p}{7} \right )^{5}\)

*theta subgraphs. Let u,u*

^{′}

*be any two (different) vertices of G that are not in R(v*

_{1}

*,v*

_{2}

*). Then:*

*Proof*

*u*,

*u*

^{′}as described above and any one of the

*k*possible journeys of the form (

*u*,

*a*

_{i},

*v*

_{1},

*b*

_{i},

*u*

^{′}), the probability that such a journey fails (i.e., is not realized) is at most \(1-\left (\frac {p}{7} \right )^{2}\). Therefore, given \(\mathcal {E}_{1}\), we have:

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.

*u*,

*u*

^{′}that are not in

*R*(

*v*

_{1},

*v*

_{2}) that fails to connect as described above. Since the number of possible pairs of vertices

*u*,

*u*

^{′}is less than

*n*

^{2}, we have:

*u*∉

*V*(

*R*(

*v*

_{1},

*v*

_{2})), keep one of its green edges (to some

*a*

_{i}) and one of its red edges (to the corresponding

*b*

_{i}), since by \(\mathcal {E}_{2}\), those exist. Then, remove all edges of

*I*except for the edges of

*R*(

*v*

_{1},

*v*

_{2}) and the two edges we keep for every vertex that is not in

*R*(

*v*

_{1},

*v*

_{2}). Notice that the resulting labelled subgraph of

*I*is temporally connected, since:

- 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., time-edges) that is at most 2*n*+Θ(*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}*) time-edges to be temporally connected, with probability at least*\(1-2e^{-\frac {\gamma }{24} \ln {n}}\).

*Proof*

*I*of

*G*

_{n, p}becomes temporally connected by using at most Θ(

*n*+

*n*

*p*

^{5}) edges (and, thus, labels) as described above, with probability at least:

*γ*≥ 24, we have that \(\frac {\gamma }{6} -2 \geq \frac {\gamma }{24}\). Therefore, from relation (7), we get:

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 cost-optimal temporal networks that are temporally connected. It remains an open problem to provide a polynomial-time 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 in-depth 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 2*n*− 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 Polynomial-Time 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/978-3-319-28472-9_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 finite-state sensors. Distrib. Comput., 235–253 (2006)Google Scholar
- 6.Avin, C., Koucký, M., Lotker, Z.: How to explore a fast-changing 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.Bui-Xuan, 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.: Time-varying 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 edge-markovian 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 ACM-SIAM 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 continuous-time dynamic network flow algorithms. Oper. Res. Lett.
**23**(3-5), 71–80 (1998)MathSciNetCrossRefMATHGoogle Scholar - 16.Gavoille, C., Peleg, D., Perennes, S., Raz, R.: Distance labeling in graphs. In: Proceedings of the 12th Annual ACM-SIAM 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**(4-5), 119–127 (1998). doi:10.1016/S0167-6377(98)00009-1 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/s00186-011-0357-2 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 (DIALM-POMC), 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/0022-0000(91)90023-X 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 Access**This 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.