Recognizing and Realizing Temporal Reachability Graphs
Abstract
A temporal graph can be represented by an underlying graph together with a function that assigns to each edge the set of time steps during which is present. The reachability graph of is the directed graph with if and only if there is a temporal path from to . We study the Reachability Graph Realizability (RGR) problem that asks whether a given directed graph is the reachability graph of some temporal graph. The question can be asked for undirected or directed temporal graphs, for reachability defined via strict or non-strict temporal paths, and with or without restrictions on (simple, proper, or both). Answering an open question posed by Casteigts et al. (TCS 2024), we show that all variants of the problem are NP-complete, except for two variants that become trivial in the directed case. For undirected temporal graphs, we consider the complexity of the problem with respect to the solid graph, that is, the graph containing all edges that could potentially receive a label in any realization. We show that the RGR problem is fixed-parameter tractable for the feedback edge set number of the solid graph. As we show, the latter parameter can presumably not be replaced by smaller parameters like feedback vertex set number or treedepth, since the problem is W[2]-hard for them.
Keywords and phrases:
parameterized complexity, temporal graphs, FPT algorithm, feedback edge set, directed graph recognitionFunding:
Nils Morawietz: Supported by the French ANR, project ANR-22-CE48-0001 (TEMPOGRAL).Copyright and License:
2012 ACM Subject Classification:
Theory of computation Design and analysis of algorithmsEditors:
Anne Benoit, Haim Kaplan, Sebastian Wild, and Grzegorz HermanSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Temporal graphs are graphs that change over time. The vertex set is often assumed to be fixed, and the edge set can differ from one time step to the next. The study of temporal graphs has attracted significant attention in recent years [5, 22, 23]. One way to represent a temporal graph with vertex set is as a sequence , where is the graph containing the edges that are present in time step . If an edge is present in time step , we refer to as a time edge, and call a time label of edge . A strict temporal path from vertex to vertex in is a sequence of time edges forming a --path whose time steps are strictly increasing. A non-strict temporal path is defined analogously, except that the time steps only need to be non-decreasing.
In this work, we initiate the study of designing temporal graphs whose dynamics guarantee certain reachability requirements while preventing others, a problem naturally arising in areas like epidemic control, transportation, and logistics. For example, in epidemic control, a central goal is to maintain a minimal degree of societal connectivity for critical services while preventing broader or specific temporal connections that could facilitate disease spread.
Given a temporal graph , its temporal reachability relation can be represented as a directed graph , called the reachability graph of , with for if and only if there exists a (strict or non-strict, respectively) temporal path from to in . We can now state our problem as that of realizing a given reachability graph by finding a temporal graph whose temporal connectivity is specified by : each arc or non-arc of represents a temporal reachability that must or must not be realized in , respectively. In particular, we want to know which directed graphs can arise as reachability graphs of temporal graphs, and how difficult it is to determine for a given directed graph whether there exists a temporal graph with reachability graph . Interestingly, this formulation turns out to have been posed twice recently as an open question, by Casteigts et al. [3, Open question 5] and Döring [11]. In contrast to our work, those papers aim to understand the expressivity of various temporal graph models, using reachability graphs as a tool.
Part of our contribution is to resolve this open question, by showing that the associated decision problem is NP-complete. Actually, there are a number of variations of the question, as we may ask for an undirected or a directed temporal graph , for a temporal graph with a restricted kind of labeling (simple, proper, happy)111simple one label per edge, proper no two adjacent edges share a label, happy both proper and simple, and may consider reachability with respect to strict or non-strict temporal paths. We show that all these variations are NP-hard if we ask for an undirected temporal graph, and also if we ask for a directed temporal graph except for two variations (strict temporal paths with arbitrary or simple labelings) that are known to become trivial in the directed case [11]. See Table 1 for an overview of these results.
On the positive side, we present the following algorithmic results. For a given digraph , we refer to for as a solid edge if both and are in . Let be the undirected graph on whose edge set is the set of solid edges. We refer to as the solid graph of . The structural properties of solid graphs turn out to be crucial for our problem. We show that all undirected problem variants can be solved in polynomial time if the solid graph is a tree. Furthermore, we give an FPT algorithm for the feedback edge set number of the solid graph. This parameter can presumably not be replaced by smaller parameters like feedback vertex set, treedepth, or pathwidth, since two undirected versions of our problem turn out to be W[2]-hard for these parameters.
We believe that reachability graphs of temporal graphs form an interesting class of directed graphs whose study has only recently begun. Our results on their structure and on recognizing such graphs could be of independent interest in the context of algorithmic problems in directed graphs.
| undirected | Strict | Non-strict | directed | Strict | Non-strict |
| Any | Theorem˜14 | Theorem˜14 | Lemma˜21, [11] | Theorem˜22 | |
| Simple | Theorem˜14 | Theorem˜14 | Lemma˜21, [11] | Theorem˜22 | |
| Proper | Theorem˜14 | Theorem˜22 | |||
| Happy | Theorem˜14 | Theorem˜22 | |||
Related work.
As mentioned, our work falls into the area of temporal graph realization problems. In these problems, one is given some data about the behavior of a temporal graph, and the goal is to detect whether there actually is a temporal graph with this behavior (and to compute such a temporal graph if one exists). Klobas et al. [17] introduced the problem of deciding for a given matrix of fastest travel durations and a period whether there exists a simple temporal graph with period with the property that the duration of the fastest temporal path between any pair of nodes in is equal to the value specified in the input matrix. Erlebach et al. [13] extended the problem to a multi-label version, where each edge is allowed up to time labels. Motivated by the design of transportation networks, a related problem with respect to upper-bounded travel durations was considered [19, 20, 21].
In an early example of a temporal network design problem studied by Kempe et al. [15], the goal was to reconstruct a temporal labeling restricted to a single label per edge, so that a designated root reaches via temporal paths all vertices in a set while avoiding those in a set . For multi-labeled temporal graphs, Mertzios et al. [18] studied the problem of designing a temporal graph that preserves the reachability relation or all paths of an underlying static graph while minimizing either the temporality (maximum number of labels per edge) or the temporal cost (total number of labels used). Göbel et al. [14] showed that it is NP-complete to decide whether the edges of a given undirected graph can be labeled with a single label per edge in such a way that each vertex can reach every other vertex via a strict temporal path. Notably, this problem becomes solvable in linear time when only the degree sequence of the underlying graph is given [4]. Other studies have focused on variants of minimizing edge deletions [12], vertex deletions [25], or edge delays [9] to restrict reachability, motivated, for instance, by epidemic containment strategies that limit interactions. Temporal network design is an active area of research, with further related questions explored for example in [1, 16, 7].
Casteigts et al. [3] studied the relationships between the classes of reachability graphs that arise from undirected temporal graphs if different restrictions are placed on the graph (simple, proper, happy [3]) and depending on whether strict or non-strict temporal paths are considered. They showed that reachability with respect to strict temporal paths in arbitrary temporal graphs yields the widest class of reachability graphs while reachability in happy temporal graphs yields the narrowest class. The class of reachability graphs that arise from proper temporal graphs is the same as for non-strict paths in arbitrary temporal graphs, and this class is larger than the class of reachability graphs arising from non-strict reachability in simple temporal graphs. Strict reachability in simple temporal graphs was also shown to lie between the happy case and the general strict case. Döring [11] completed the picture of a two-stranded hierarchy for undirected temporal graphs and also extended the study to directed temporal graphs. As noted earlier, Casteigts et al. [3] also posed the open question of whether there is a characterization of directed graphs that arise as reachability graphs of temporal graphs (or of some restricted subclass of temporal graphs), and how hard it is to decide whether a given directed graph is the reachability graph of some temporal graph. These questions were posed again by Döring [11]. This is in particular of interest because Casteigts et al. [6] showed that several temporal graph problems can be solved in FPT time with respect to temporal parameters defined over the reachability graph. In this paper, we resolve these open questions regarding the complexity of all directed and undirected variants.
Organization of the paper.
In Section 2, we provide a formal problem definition and define the notions used in this work. In Section 3, we show upper and lower bounds for the required number of labels per edge in any realization and provide a single exponential algorithm for all problem variants. Afterwards, in Section 4, we analyze properties and define splitting operations based on bridge edges in the solid graph of the undirected versions of our problem. These structural insights will be mainly used in our FPT algorithm in Section 6, but also immediately let us describe a polynomial-time algorithm for instances where the solid graph is a tree in Section 4.2. In Section 5, we then provide NP-hardness results for all undirected problem versions as well as parameterized intractability results for two of them with respect to feedback vertex set number and treedepth. Afterwards, in Section 6, we provide our main algorithmic result: an FPT algorithm with respect to the feedback edge set number of the solid graph. This algorithm is achieved in three steps: Firstly, we apply our splitting operations of Section 4 and provide a polynomial-time reduction rule to simplify the instance at hand, such that all we need to deal with is a subset of vertices of size for which the remainder of the graph decomposes into edge-disjoint trees that only interact with via two leaves each. We call such trees connector trees. Secondly, we show that we can efficiently extend the set to a set of size such that each resulting connector tree for the set is more or less independent from the remainder of the graph with respect to the interactions of temporal paths in any realization. All these preprocessing steps run in polynomial time. Afterwards, our algorithm enumerates all reasonable labelings on the edges incident with vertices of and tries to extend each such labeling to a realization for . As we show, there are only FPT many such reasonable labelings and for each such labeling, there are only FPT many possible extensions that need to be checked. Finally, in Section 7, we briefly discuss the directed version of the problem and provide NP-hardness results for all but the two trivial cases. Proofs of statements with are deferred to the full version.
2 Preliminaries
For definitions on parameterized complexity, the Exponential Time Hypothesis (ETH), or parameters like treedepth, we refer to the textbooks [10, 8].
For natural numbers with we write for the set and for the set . For an undirected graph , we denote an edge between vertices and as or . By we denote the set of neighbors of . The degree of is the size of . An edge is a bridge or bridge edge in a graph if deleting increases the number of connected components. A vertex of degree is a pendant vertex, and an edge incident with a pendant vertex is called a pendant edge.
We assume directed graphs have no parallel arcs and no self-loops, and we denote an arc from to by . A directed graph is a directed acyclic graph (DAG) if it does not contain a directed cycle. The degree of a vertex is the number of arcs containing . For an undirected graph , the feedback edge set number (feedback vertex set number) denotes the minimum number of edges (vertices) to remove from to obtain an acyclic graph.
A temporal graph with vertex set and lifetime is given by a sequence of static graphs referred to as snapshots or layers. The graph with is called the underlying graph of . Alternatively, can be represented by an undirected graph with and a labeling function that assigns to each edge the (possibly empty) set of time steps during which is present, that is, . We write in this case. In this representation we allow to contain extra edges in addition to the edges of the underlying graph; such edges satisfy . This is useful because in the problems we consider in this paper, there is a natural choice of a graph , the solid graph defined below, that contains all edges of the underlying graph of every realization but may contain additional edges.
We assume that each layer of a temporal graph is an undirected graph unless we explicitly refer to directed temporal graphs. If , we refer to as a time edge. A temporal path from to in is a sequence of time edges for some such that is a - path in and holds in the non-strict case and holds in the strict case.
A temporal graph is proper if no two adjacent edges share a label, simple if every edge has a single label, and happy if it is both proper and simple [3]. The reachability graph of a temporal graph with vertex set is the directed graph with the same vertex set and if and only if and contains a temporal path from to . Note that depends on whether we consider strict or non-strict temporal paths and can be computed in polynomial time in both cases [2]. We are interested in the following problem:
Reachability Graph Realizability (RGR)
Input: A simple directed graph .
Question: Does there exist a temporal graph with ?
For yes-instances of RGR, we are also interested in computing a temporal graph with . We refer to such a temporal graph as a solution or a realization for , and we typically represent it by a labeling function. With the adjacency matrix representation of in mind, we also write for and for .
We can consider RGR with respect to reachability via strict temporal paths or with respect to non-strict temporal paths. Furthermore, we can require the realization of to be simple, proper, or happy. For proper and happy temporal graphs, strict and non-strict reachability coincide. Therefore, the distinct problem variants that we can consider are Any Strict RGR, Any Non-strict RGR, Simple Strict RGR, Simple Non-strict RGR, Proper RGR, and Happy RGR. Finally, we write DRGR instead of RGR if we are asking for a directed temporal graph that realizes . We sometimes write URGR if we want to make it explicit that we are asking for an undirected realization.
The solid graph.
If and for some , we say that there is a solid edge between and . If and , we say that there is a dashed arc from to . We use to denote the graph on whose edge set is the set of solid edges, and we refer to this graph as the solid graph (of ). For URGR it is clear that only solid edges can receive labels in a realization of , as the two endpoints of an edge that is present in at least one time step can reach each other. Bridges of the solid graph must receive labels, but a solid edge that is not a bridge may not receive labels, as the endpoints of could reach each other via temporal paths of length greater than one.
Observation 1.
Let be an instance of Any Strict URGR or Simple Strict URGR. Let be a realization of and let and be solid edges that both receive at least one label under . If contains neither the arc nor the arc , then there is a label such that .
Note that for Proper URGR, Happy URGR, and all versions of Non-strict URGR, no realization for can assign labels to both of two adjacent edges and if contains neither nor .
A path from to in is a dense --path if there exist arcs for all . In each undirected realization of , each temporal path is a dense path in .
We say that a realization is frugal if there is no edge such that the set of labels assigned to can be replaced by a smaller set while maintaining the property that is a realization. We say that a realization is minimal on edge if it is impossible to obtain another realization by replacing with a proper subset. A realization is minimal if it is minimal on every edge . Note that every frugal realization is also minimal.
3 Basic Observations and an Exponential Algorithm
We first provide upper and lower bounds for the number of labels per edge in realizations.
Lemma 2 ().
Let be an instance of URGR, and let be a solid edge of that is not part of a triangle.
-
For Any Strict URGR, in each minimal realization of , receives at most two labels.
-
For all other versions of URGR, in each minimal realization of , receives at most one label.
For general edges, we show a linear upper bound with respect to the number of vertices.
Lemma 3 ().
If a graph is realizable, then each minimal realization for assigns at most labels per edge.
Lemma 3 implies that all versions of URGR and DRGR under consideration are in NP. Next, we show that the bound of Lemma 3 is essentially tight for Any Strict URGR.
Theorem 4 ().
For Any Strict URGR, there is an infinite family of directed graphs , such that for every , where is the solid graph of , (i) is realizable and some edge receives labels in every realization of , where , and (ii) has a feedback vertex set of size 2 and a feedback edge set of size .
The proof of Theorem 4 is based on the construction of an instance with a solid graph that consists of a number of subgraphs, called pages, that all share a common edge, called the spine. The instance is such that all edges of each page (except the spine) must receive the same single label, and the labels increase from one page to the next. Furthermore, for every the reachability matrix specifies that the top of the -th page can reach the bottom of the -th page and of all later pages. This requirement can then only be realized by adding a label whose value lies between the labels of page and to the spine, thus forcing the spine to have a linear number of labels.
Based on the upper bounds on labels per edge/arc from Lemma 3, one can solve all problems under consideration via dynamic programming over subsets of already labeled edges/arcs. Roughly speaking, we design a dynamic program that stores entries for each subset of and each time step , on whether there is a temporal graph with lifetime that has reachability graph . If Simple RGR or Happy RGR is considered, the table also needs to store the already labeled edges/arcs in the first time steps, to ensure that none of these edges/arcs receive another label.
Theorem 5 ().
Each version of URGR and DRGR under consideration can be solved in time, where denotes the arc set of the input graph.
4 Solid Bridge Edges: Properties and Splitting Operations
In this section, we show several structural results as well as three splitting operations for graphs with bridge edges in the solid graph. These insights will be important for our FPT algorithm and will also simplify instances of URGR where the solid graph is a tree.
Consider a bridge edge whose deletion splits the solid graph into connected components and , where contains and contains . A dashed arc spans if and or vice versa. Two arcs and span in the same direction if they span and either or . If has a single label in a realization, then it must be the case that the dashed arcs spanning are “transitive” in the following sense: If dashed arcs and both span in the same direction, then and must also be dashed arcs. This is because for any two temporal paths that pass through in the same direction, the part of one path up to edge can be combined with the part of the other path after .
Definition 6.
Consider a bridge edge whose deletion splits the solid graph into connected components and . The edge is a special bridge edge if there exist vertices in and in such that , and (or if the same condition holds with and exchanged). A bridge edge that is not special is called non-special.
Intuitively, a special bridge edge is a bridge edge such that there are dashed arcs spanning in the same direction for which transitivity (as outlined above) is violated.
Lemma 7 ().
In each frugal realization of , every special bridge edge is assigned two labels and every non-special bridge edge is assigned a single label.
Corollary 8.
Let be an instance of any version of URGR under consideration besides Any Strict URGR. If the solid graph of contains a special bridge edge, then is a no-instance.
4.1 Splitting Into Subinstances
We now define splitting operations on bridges. First, consider non-special bridges.
Lemma 9 (Splitting at a non-special bridge).
Consider any variant of URGR. Let be a non-special bridge edge, and let and be the connected components of resulting from the deletion of . Then the instance is realizable if and only if the subinstances induced by and are realizable.
Proof.
Let and denote the subinstances induced by and , respectively. If is realizable, then the realization induces realizations of the two subinstances and . If and are realizable, their realizations assign a single label to , and these realizations can be chosen so that receives the same label in both realizations. Hence, the union of the two realizations is a realization of .
By applying Lemma 9 repeatedly to a non-pendant non-special bridge edge until no such edge exists, we obtain subinstances in which all non-special bridge edges are pendant.
Now consider special bridges. Special bridge edges cannot occur in yes-instances of any variant of URGR except Any Strict URGR (see Corollary 8), so we only consider Any Strict URGR in the following. Let edge be a special bridge with and defined as above. If the instance is realizable, for every vertex in there are at most three possibilities for which vertices in it can reach, depending on whether it cannot reach , can reach at time , or can reach only at time , where and with are the labels assigned to in the realization. The same holds with and exchanged. If this condition is violated, then the instance cannot be realized. The following definition captures this condition. For each vertex , let , and define for analogously.
Definition 10.
Let be a special bridge with and defined as above. We say that is a special bridge edge with plausible reachability if the following conditions hold:
-
If there exist vertices and such that and , then every vertex satisfies with . Otherwise, every vertex satisfies .
-
The same condition holds with the roles of and exchanged.
If there is a special bridge edge with plausible reachability, we can split the instance into two subinstances that can be solved separately, as illustrated in Figure 1. Each subinstance consists of the edge together with either or . For the subinstance containing and , up to two new leaf vertices are attached to , named and in the figure. Here, represents the vertices in that can reach only by traversing using the larger of its two time labels, and represents the vertices in that can be reached from only by traversing using the larger of its two time labels. The other subinstance is handled analogously.
Lemma 11 ((), Splitting at a special bridge).
Consider Any Strict URGR. Let be a special bridge edge with plausible reachability, and let and be the connected components of resulting from the deletion of . Then the instance is realizable if and only if the two subinstances constructed as follows are realizable:
-
To construct subinstance , take the subgraph of induced by and attach one or two leaves to as follows:
-
–
If there are vertices and with and , then attach a leaf (called out-leaf) to with and for all , and all other entries of involving equal to .
-
–
If there are vertices and with and , then attach a leaf (called in-leaf) to with and for all and if an out-leaf has been added, and all other entries of involving equal to .
Note that at least one of the two conditions above must be satisfied because is a special bridge edge. The resulting instance is the desired subinstance .
-
–
-
Subinstance is constructed analogously, with the roles of and exchanged.
Note that we cannot exhaustively apply the operation behind Lemma 11, since each application on a special bridge results into two new instances in which edge is again a special bridge. However, by recursively applying this operation on special bridges on which the operation has not yet been applied, we eventually obtain instances, where each special bridge has at least one endpoint that has at most two other neighbors and both of them have a degree of .
Finally, we consider the case of two pendant edges that have a common neighbor and must receive the same single label in every realization. We argue that we can remove one of them from the instance provided their reachability requirements from/to the rest of the graph are the same. This is because a realization of the instance with one of the two pendant edges removed gives a realization of the original instance simply by labeling the pendant edge that was removed with the same label as the other pendant edge.
Lemma 12 ((), Removal of redundant pendant vertices).
Let be an instance of URGR and let and be two degree- vertices with the same common neighbor in that satisfy . Then,
-
for all variants of Non-strict URGR (including Proper URGR and Happy URGR), is not realizable, and
-
for Any Strict URGR and Simple Strict URGR, is realizable if and only if (i) the subinstance resulting from by deleting is realizable and (ii) for each , and .
4.2 Algorithms for Instances with a Tree as Solid Graph
Since all edges of trees are bridges, we now describe, based on our insights about labels in frugal realizations, an algorithm for instances of URGR where the solid graph is a tree.
Theorem 13.
There is a polynomial-time algorithm for solving instances of Any Strict URGR for which the solid edges form a tree.
Proof Sketch.
Let denote the tree of solid edges. We first check that satisfies several conditions that must hold if is realizable. For example, if is an arc, then and must also be arcs for every internal node of the unique --path in . If one of these conditions is violated, is not realizable. Otherwise, we construct a linear program (LP) that has two non-negative variables and for each that represent the lower and higher label of , respectively, in a realization. Constraints for non-special edges and for special edges ensure that each edge receives the correct number of labels. For edges and such that , the constraints and ensure that there is a temporal --path but no temporal --path. Call a non-arc minimal if it is the only arc missing in the direction from to on the path from to . For every minimal non-arc , we add constraints for every pair of consecutive edges and on the - path (which we show to consist of special edges except for the first and last edge, which are both non-special). For arcs such that the first and last edge of the --path are non-special and all other edges are special, we add the constraint , where the sum is over all pairs of consecutive edges of the --path. We can show that the LP is feasible if and only if is realizable. Furthermore, any feasible solution of the LP corresponds to a frugal realization with fractional labels, which can be made integral in a straightforward post-processing step. By testing additional conditions (such as the absence of special edges) before constructing the linear program, we can also use the approach to solve all other variants of URGR.
5 Hardness for Undirected Reachability Graph Realizability
In this section, we show that all considered versions of Undirected Reachability Graph Realizability are NP-hard, even on instances with a constant maximum degree. We obtain these hardness results by reductions from SAT, where we have a source and a terminal vertex for each clause , such that contains the dashed arc . The only way to realize such an arc is to follow a dense path that crosses through some variable gadget. We design a variable gadget for each variable , for which the only way to realize it is to ensure that (i) only clauses that contain positively can reach their terminal via this variable gadget, or (ii) only clauses that contain negatively can reach their terminal over this variable gadget.
Theorem 14 ().
Each version of URGR under consideration is NP-hard on directed graphs of constant maximum degree. Moreover, no version of URGR under consideration can be solved in time, unless the ETH fails.
Hence, the running time of Theorem 5 can presumably not be improved significantly.
We now strengthen our hardness result for Any Strict URGR and Simple Strict URGR, which will highly motivate the analysis of parameterized algorithms for the parameter “feedback edge set number” of the solid graph, which we consider in Section 6.
Theorem 15 ().
Any Strict URGR and Simple Strict URGR are W[2]-hard when parameterized by the feedback vertex set number and treedepth of the solid graph.
Proof.
We reduce from Set Cover which is W[2]-hard when parameterized by [10].
Let be an instance of Set Cover with . Assume without loss of generality that each element of is contained in at least one hyperedge and that has size at least , as otherwise could be solved trivially. We obtain a directed graph with solid graph as follows: The graphs contain the vertices , each element as a vertex, and for each the vertex . Additionally, for each and each , contain the vertices , , and .
Next, we describe the solid edges of , that is, the bidirectional arcs of . See Figure 2 for the solid edges and dashed arcs of the main connection gadget of the instance.
The graph contains the edges , , and for each , the edges , , and . Moreover, for each and each , contains the edges , , , , , , , and .
Finally, we describe the dashed arcs: contains the dashed arcs , , , , and . For each , also contains the dashed arcs and . Let . Then, contains the arc . Moreover, contains the arcs , , , and for each . Additionally, for each hyperedge with , contains the arcs , , , , , , , , , , and for each . The only other dashed arcs in are between -vertices. Let with and let and . Then, contains the arc .
This completes the construction of . First, we show the parameter bounds.
Claim 16 ().
has a feedback vertex set of size and treedepth .
We show that is a yes-instance of Set Cover if and only if is realizable via strict temporal paths. More precisely, we show that if is a yes-instance of Set Cover, then there is a simple undirected temporal graph with strict reachability graph . This then implies the correctness of the reduction for both Any Strict URGR and Simple Strict URGR.
We defer this proof to the full version and only provide an informal idea for the correctness. Intuitively, in each realization for , for each , there can be at most one hyperedge for which edges between and vertices of can receive labels. This can be seen as follows: For each , (i) there is no dashed arc between and and (ii) there is no dashed arc between and . Hence, Observation 1 implies that, if receives at least one label, then there is some , such that the edges and receive the label set under . Based on the dashed arcs between the -vertices, the label and the label are distinct for distinct hyperedges and . This then implies that there can be at most one hyperedge for which edges between and vertices of can receive labels, as otherwise, a strict temporal path between distinct -vertices would be realized.
The edges with at least one label between and -vertices thus resemble a selection of at most one hyperedge of for each . Since the only dense paths from a vertex to are of the form for and with , this selection of hyperedges encodes a set cover, as the arcs are realized over such dense paths.
6 Parameterizing by the Feedback Edge Set Number
In this section we generalize our algorithm on tree instances of URGR to tree-like graphs. Recall that a feedback edge set of a graph is a set of edges of , such that is acyclic. We denote by the feedback edge set number of the solid graph of , that is, the size of the smallest feedback edge set of .
Theorem 17.
Each version of URGR can be solved in time.
Recall that the parameter can presumably not be replaced by a smaller parameter like feedback vertex set number or treedepth (see Theorem 15). In the remainder of this section, we present the main idea for the proof of Theorem 17. We will only describe the algorithm for the most general version Any Strict URGR, but for all more restrictive versions, all arguments work analogously.
Definitions and Notations.
Let be the solid graph and let be a minimum size feedback edge set of . We assume without loss of generality that is connected, as otherwise, we can solve each connected component independently, or detect in polynomial time that is not realizable if there are dashed arcs between different connected components of the solid graph. Moreover, let denote the endpoints of the edges of . Note that . We define the set as the (unique) largest subset of vertices of that each have at least two neighbors in , that is, is the 2-core [24] of . This set can be computed in polynomial time. Moreover, we define . Note that , since is a minimum-size feedback edge set. Since is connected, for each vertex , there is a unique vertex which has closest distance to among all vertices of . For a vertex , denote by the set of all vertices of for which is the closest neighbor in . Note that might be empty. Since is in no cycle, removing from would result in ending up in a component that has no vertex of . Hence, is a tree for which we call the root. Moreover, we call the pendant tree of .
Recall that each vertex of has degree at least in . Furthermore, is acyclic and thus is a tree. Let denote the set of all vertices of degree at least in , and let be the neighbors of in . Observe that each leaf of is a vertex of . Moreover, in each tree with leaves, there are vertices having (i) degree at least 3 or (ii) a neighbor of degree at least 3. This implies that . Let . See Figure 3 for an illustration of these sets of vertices and some of the main definitions used in this section. By the above, . Recall that each vertex of has degree exactly in . Moreover, note that each vertex of is part of a unique path where each internal vertex of is from and the endpoints of are from . For each such path, each internal vertex has degree exactly in and there are at most such paths, since is acyclic. Note that contains all vertices that are part of triangles in and thus in . This implies that in each minimal realization of , each edge incident with at least one vertex of receives at most two labels (see Lemma 2). We now define the above mentioned paths between the vertices of is a more general way.
Definition 18.
Let with and let be a path of length at least 2 in with endpoints and in and all internal vertices from . We call a -connector. Moreover, let . We call a -connector tree and the extension of .
Note that the endpoints of each -connector are from and thus have degree in . Moreover, each internal vertex of a -connector has degree exactly in , that is, the only two neighbors of in are the predecessor and the successor of in . This also implies that each endpoint of a -connector has degree exactly 2 in . Since each edge of is incident with at least one vertex of , in each minimal realization of , each edge of each -connector receives at most two labels (see Lemma 2). The latter also holds for each -connector tree.
Observation 19.
Let with . Then, there are edges between vertices of in and there are -connectors. Moreover, for each vertex , there is exactly one -connector tree that contains .
Note that this is a general property of graphs with a feedback edge set of size .
Abstract Description of the Algorithm.
Our algorithm uses two preprocessing steps.
In the first step, we will present a polynomial-time reduction rule based on the splitting operations presented in Section 4. With this reduction rule, we will be able to remove vertices from large pendant trees. After exhaustive application, for each vertex , the pendant tree will have vertices, where denotes the degree of in .
In the second step, we extend the set to a set such that each -connector has some useful properties (we will define connectors with these properties as nice connectors). Intuitively, a connector with extension is nice if (i) in a realization for , the arcs in can only be realized by temporal paths that are contained in the connector tree , and (ii) for each arc between a vertex outside of and a vertex inside of , we can in polynomial time detect over which (unique) edge of the connector incident with one of its endpoints this arc is realized. As we will show, we can compute such a set of size in polynomial time, or correctly detect that the input graph is not realizable. By the first part, we additionally get that the total number of vertices in pendant trees that have their root in is .
The algorithm then works as follows: We iterate over all possible partial labelings on the edges incident with vertices of or vertices of pendant trees that have their root in . As we will show, we can assume that each of these edges will only receive labels in each minimal realization. For each such labeling , we need to check whether we can extend the labeling to the so far unlabeled edges, that is, the edges that are part of any -connector tree. As we will show, we can compute for each such connector with extension in polynomial time a set of labelings for the edges of , such that if can be extended to a realization for , then we can extend (independently from the other connectors) by one of the labelings in . Since has size , there are only many -connectors (see Observation 19) and for each such connector , the set of labelings has constant size. Our algorithm thus iterates over all possible labeling combinations for the connectors and checks whether one of these combinations extends to a realization for . Summarizing, we will show the following.
Proposition 20.
In polynomial time, we can detect that is not realizable, or compute a set with , such that the set of edges that are (i) incident with at least one vertex of or (ii) part of some pendant tree with root in , has size and where for each labeling of the edges of , we can in time (a) compute a labeling that realizes , or (b) detect that there no frugal realization for that agrees with on the labels of all edges of .
The running time of this algorithm is then , since (i) all preprocessing steps run in polynomial time, (ii) we only have to consider labelings (since we prelabel edges with labels each), and (iii) for each labeling , we only have to check for possible ways to extend to a realization for . To see the second part, we show that it is sufficient to assign only labels of in .
6.1 Technical Highlights and Difficulties of the Algorithm
We now describe in more detail the intuition about the two preprocessing steps, as well as the algorithm to compute a constant number of labelings for each nice connector.
Dealing with pendant trees.
Recall that denotes the degree of a vertex in . To reduce each pendant tree with to a size of , we first apply the three splitting operations of Section 4 to each edge of incident with . Since each of these edges is a bridge and part of a tree, one of the two resulting instances produced by the splitting operations is then a tree and can be solved in polynomial time. We thus stick with the one resulting instance which is not a tree. As we show, by applying the splitting operations, we get that (i) for each special bridge of incident with , has at most two neighbors besides (namely, the possible in-leaf and the possible out-leaf) and (ii) for each non-special bridge of incident with , is a leaf. This directly implies that has depth 2 and the number of leaves of is , where denotes the neighbors of in .
Thus, to reduce the size of it suffices to reduce the number of vertices in to . To do so, we show that for each external edge (that is, an edge that is incident with but not contained in ), we can detect in polynomial time a set of at most internal edges (that is, edges between and vertices of ) that “surround” or “block” the edge . Intuitively, in each realization for , no other internal edge can share a label with . This defines a total of internal edges that are surrounding or blocking. Let denote these edges. Based on this set of edges, we then show that we can efficiently (i) detect that is not realizable, or (ii) find a vertex of that (together with its possible leaf-neighbors) can safely be removed from , if has size . Hence, after exhaustive application of this operation, only vertices of remain. Since each of these vertices only has at most two neighbors besides , and these neighbors are leaves, the total size of is then .
Ensuring connectors with nice properties.
We now give a more formal idea behind the definition of nice connectors. Let be a connector with endpoints and , and let be the extension of . Then, is nice, if (i) there is no dense path between and outside of and (ii) for each arc between a vertex of and a vertex outside of , there is no dense -path that goes over or there is no dense -path that goes over .
Since the definition of nice connectors relies on the non-existence of dense paths between specific vertex pairs, detecting whether a connector is nice can presumably not be done in polynomial time.222This is due to the fact that finding a dense path between two specific vertices can be shown to be NP-hard by reducing from Multicolored Clique. To still achieve the goal of finding a desired set where each connector is nice, we show the following: Whenever we have a set and a -connector , then we can in polynomial time (i) detect that is not realizable or (ii) compute a constant number of vertices of , such that each subpath of that is a -connector is nice. That is, even though we cannot check efficiently whether the nice property is fulfilled for a given connector, we can ensure it by adding few vertices to our set. To compute the set , we start with and iteratively add for each -connector the set to . Since and there are -connectors, the resulting set also has size . As we show, the update of preserves the nice property of the connector before and after the update. In this way, we ensure that each -connector is nice.
Dealing with nice connectors.
Recall the definition of nice connectors. The first property essentially ensures that arcs in can only be realized via dense paths in , which makes the local realization of in some sense independent from the remainder of . The second property ensures that we only have one choice (with respect to dense paths inside of ) to realize an arc between an internal and an external vertex.
We make use of these properties, since a nice connector and its extension only interact with the remainder of via exactly two edges and . Moreover, both these edges receive at most two labels in every frugal realization. Assuming we are given the labeling for and , we show that we can compute a constant number of labelings for the edges of , such that if there is a realization for agreeing with the prelabeling of and , then we can replace the labels of on the edges of by the labels of some labeling in . The essential idea behind this algorithm is to build a constant number of tree instances in which we simulate how the connector interacts with the remainder of in any possible labeling. As we show, we only have to (i) consider the cases for each of the edges and , whether there are temporal paths in that enter or exit via () via the smallest or largest label of (), and (ii) consider the cases whether some temporal paths under enter via and leave via and whether they traverse the respective edges at their smallest or largest label. These are in total only a constant number of options. For each such option, we construct a tree instance of the problem obtained from by adding a constant number of vertices each to simulate the specific option. In some sense, these instances are generalizations of the instances built in the splitting rule for special bridges. Afterwards, we check for which of these instances we can find a labeling that agrees with the prelabeling on and and add such a labeling to if it exists. The latter task can be performed in polynomial time, by using our linear program for tree instances.
7 The Complexity of Directed Reachability Graph Realizability
Finally, we consider the complexity of versions of Directed Reachability Graph Realizability. As already discussed by Döring [11], each directed graph can be the strict reachability graph of a simple directed temporal graph. Hence, Any Strict DRGR and Simple Strict DRGR are always yes-instances and can thus be solved in polynomial time.
We now show that all DAGs and all transitive graphs are trivial yes-instances for each version of the problem.
Lemma 21 ().
An instance of DRGR is a yes-instance, if (i) we consider Any Strict DRGR or Simple Strict DRGR, or (ii) is a DAG or a transitive graph.
Here, a directed graph is transitive, if for every distinct vertices with and , the arc is also in .
All other versions of DRGR are NP-hard even on graphs that are close to DAGs. More precisely, on graphs where a DAG can be obtained by removing a constant number of arcs.
Theorem 22 ().
Proper DRGR, Happy DRGR, and all considered versions of Non-strict DRGR are NP-hard on graphs with a constant size feedback arc set. Moreover, none of these versions of DRGR can be solved in time, unless the ETH fails.
8 Conclusion
We studied Reachability Graph Realizability and gave for both directed and undirected temporal graphs the complete picture for the classical complexity of all settings, answering this open problem posed by Casteigts et al. [3] and Döring [11]. For URGR, we additionally showed that the problem can be solved in FPT-time for the feedback edge set number of the solid graph. As we showed, this parameter cannot be replaced by smaller parameters like feedback vertex set number or treedepth of the solid graph, unless FPT = W[2].
There are several directions for future work: First, it would be interesting to see whether (some) versions of URGR admit a polynomial kernel for . Another interesting task is to determine whether Proper URGR, Happy URGR, or Non-strict URGR admits an FPT algorithm for feedback vertex set or treedepth. This is not excluded by our W[2]-hardness result, since that reduction only worked for Any Strict URGR and Simple Strict URGR.
Finally, one could analyze the parameterized complexity of Directed Reachability Graph Realizability with respect to directed graph parameters.
References
- [1] Eleni C. Akrida, Leszek Gąsieniec, George B. Mertzios, and Paul G. Spirakis. The complexity of optimal design of temporally connected graphs. Theory of Computing Systems, 61:907–944, 2017. doi:10.1007/S00224-017-9757-X.
- [2] Binh-Minh Bui-Xuan, Afonso Ferreira, and Aubin Jarry. Computing shortest, fastest, and foremost journeys in dynamic networks. Int. J. Found. Comput. Sci., 14(2):267–285, 2003. doi:10.1142/S0129054103001728.
- [3] Arnaud Casteigts, Timothée Corsini, and Writika Sarkar. Simple, strict, proper, happy: A study of reachability in temporal graphs. Theor. Comput. Sci., 991:114434, 2024. doi:10.1016/J.TCS.2024.114434.
- [4] Arnaud Casteigts, Michelle Döring, and Nils Morawietz. Realization of Temporally Connected Graphs Based on Degree Sequences. In 36th International Symposium on Algorithms and Computation, Leibniz International Proceedings in Informatics (LIPIcs). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. To appear. Full version: https://doi.org/10.48550/arXiv.2504.17743.
- [5] Arnaud Casteigts, Paola Flocchini, Walter Quattrociocchi, and Nicola Santoro. Time-varying graphs and dynamic networks. International Journal of Parallel, Emergent and Distributed Systems, 27(5):387–408, 2012. doi:10.1080/17445760.2012.668546.
- [6] Arnaud Casteigts, Nils Morawietz, and Petra Wolf. Distance to transitivity: New parameters for taming reachability in temporal graphs. In 49th International Symposium on Mathematical Foundations of Computer Science (MFCS 2024), volume 306 of LIPIcs, pages 36:1–36:17. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPICS.MFCS.2024.36.
- [7] Esteban Christiann, Eric Sanlaville, and Jason Schoeters. On inefficiently connecting temporal networks. In 3rd Symposium on Algorithmic Foundations of Dynamic Networks (SAND 2024). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.SAND.2024.8.
- [8] Marek Cygan, Fedor V. Fomin, Lukasz Kowalik, Daniel Lokshtanov, Dániel Marx, Marcin Pilipczuk, Michal Pilipczuk, and Saket Saurabh. Parameterized Algorithms. Springer, 2015. doi:10.1007/978-3-319-21275-3.
- [9] Argyrios Deligkas and Igor Potapov. Optimizing reachability sets in temporal graphs by delaying. Information and Computation, 285:104890, 2022. doi:10.1016/J.IC.2022.104890.
- [10] Rodney G. Downey and Michael R. Fellows. Fundamentals of Parameterized Complexity. Texts in Computer Science. Springer, 2013. doi:10.1007/978-1-4471-5559-1.
- [11] Michelle Döring. Simple, Strict, Proper, and Directed: Comparing Reachability in Directed and Undirected Temporal Graphs. In 36th International Symposium on Algorithms and Computation, Leibniz International Proceedings in Informatics (LIPIcs). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. To appear. Full version: https://doi.org/10.48550/arXiv.2501.11697.
- [12] Jessica Enright, Kitty Meeks, George B. Mertzios, and Viktor Zamaraev. Deleting edges to restrict the size of an epidemic in temporal networks. Journal of Computer and System Sciences, 119:60–77, 2021. doi:10.1016/J.JCSS.2021.01.007.
- [13] Thomas Erlebach, Nils Morawietz, and Petra Wolf. Parameterized algorithms for multi-label periodic temporal graph realization. In 3rd Symposium on Algorithmic Foundations of Dynamic Networks (SAND 2024), volume 292 of LIPIcs, pages 12:1–12:16. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.SAND.2024.12.
- [14] F. Göbel, J. Orestes Cerdeira, and Henk Jan Veldman. Label-connected graphs and the gossip problem. Discret. Math., 87(1):29–40, 1991. doi:10.1016/0012-365X(91)90068-D.
- [15] David Kempe, Jon Kleinberg, and Amit Kumar. Connectivity and inference problems for temporal networks. In Proceedings of the thirty-second annual ACM symposium on Theory of computing, pages 504–513, 2000. doi:10.1145/335305.335364.
- [16] Nina Klobas, George B. Mertzios, Hendrik Molter, and Paul G. Spirakis. The complexity of computing optimum labelings for temporal connectivity. Journal of Computer and System Sciences, 146:103564, 2024. doi:10.1016/J.JCSS.2024.103564.
- [17] Nina Klobas, George B. Mertzios, Hendrik Molter, and Paul G. Spirakis. Temporal graph realization from fastest paths. In 3rd Symposium on Algorithmic Foundations of Dynamic Networks (SAND 2024), volume 292 of LIPIcs, pages 16:1–16:18. Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2024. doi:10.4230/LIPIcs.SAND.2024.16.
- [18] George B. Mertzios, Othon Michail, and Paul G. Spirakis. Temporal network optimization subject to connectivity constraints. Algorithmica, 81(4):1416–1449, 2019. doi:10.1007/S00453-018-0478-6.
- [19] George B. Mertzios, Hendrik Molter, Nils Morawietz, and Paul G. Spirakis. Realizing temporal transportation trees. In Proceedings of the 51st Workshop on Graph-Theoretic Concepts in Computer Science (WG 2025), LNCS. Springer, 2025. To appear. Full version: arXiv:2403.18513.
- [20] George B. Mertzios, Hendrik Molter, Nils Morawietz, and Paul G. Spirakis. Temporal Graph Realization with Bounded Stretch. In Paweł Gawrychowski, Filip Mazowiecki, and Michał Skrzypczak, editors, 50th International Symposium on Mathematical Foundations of Computer Science (MFCS 2025), volume 345 of Leibniz International Proceedings in Informatics (LIPIcs), pages 75:1–75:19, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. Full version: arXiv:2504.14258. doi:10.4230/LIPIcs.MFCS.2025.75.
- [21] Julia Meusel, Matthias Müller-Hannemann, and Klaus Reinhardt. Directed temporal tree realization for periodic public transport: Easy and hard cases. In 36th International Symposium on Algorithms and Computation, Leibniz International Proceedings in Informatics (LIPIcs). Schloss Dagstuhl – Leibniz-Zentrum für Informatik, 2025. To appear. Full version: https://doi.org/10.48550/arXiv.2504.07920.
- [22] Othon Michail. An introduction to temporal graphs: An algorithmic perspective. Internet Mathematics, 12(4):239–280, 2016. doi:10.1080/15427951.2016.1177801.
- [23] Othon Michail and Paul G. Spirakis. Elements of the theory of dynamic networks. Communications of the ACM, 61(2):72–72, 2018.
- [24] Stephen B. Seidman. Network structure and minimum degree. Social Networks, 5(3):269–287, 1983. doi:10.1016/0378-8733(83)90028-X.
- [25] Philipp Zschoche, Till Fluschnik, Hendrik Molter, and Rolf Niedermeier. The complexity of finding small separators in temporal graphs. Journal of Computer and System Sciences, 107:72–92, 2020. doi:10.1016/J.JCSS.2019.07.006.
