FO and MSO Model Checking on Temporal Graphs
Abstract
Algorithmic meta-theorems provide an important tool for showing tractability of graph problems on graph classes defined by structural restrictions. While such results are well established for static graphs, corresponding frameworks for temporal graphs are comparatively limited.
In this work, we revisit past applications of logical meta-theorems to temporal graphs and develop an extended unifying logical framework. Our first contribution is the introduction of logical encodings for the parameters vertex-interval-membership width () and tree-interval-membership width (), parameters that capture the signature of vertex and component activity over time. Building on this, we extend existing monadic second-order (MSO) meta-theorems for bounded lifetime and temporal total degree to the parameters and , and establish novel first-order (FO) meta-theorems for all four parameters.
Finally, we signpost a modular lexicon of reusable FO and MSO formulas for a broad range of temporal graph problems, and give an example. This lexicon allows new problems to be expressed compositionally and directly yields fixed-parameter tractability results across the four parameters we consider.
Keywords and phrases:
temporal graphs, dynamic graphs, time-varying graphs, parameterized complexity, logic, meta-theorems, monadic second-order logic, first-order logic, treewidth, planar, nowhere dense, lifetime, temporal total degree, vertex-interval membership width, tree-interval membership widthCopyright and License:
2012 ACM Subject Classification:
Theory of computation Logic ; Mathematics of computing Graph algorithms ; Theory of computation Fixed parameter tractabilityAcknowledgements:
We thank Sebastian Siebertz for his valuable feedback.Editors:
George B. Mertzios and Andréa W. RichaSeries and Publisher:
Leibniz International Proceedings in Informatics, Schloss Dagstuhl – Leibniz-Zentrum für Informatik
1 Introduction
Many networks of interest, such as public-transport systems or communication and interaction networks, consist of time-sensitive connections. A standard abstraction of such networks is a temporal graph , that is, a static graph as footprint together with an edge labelling assigning to each edge the time steps at which it is available. This model strictly generalises static graphs, which are recovered as the special case in which all edges are available at all times. While temporal graphs are more expressive, this comes at a computational costs: many problems that are polynomial-time solvable on static graphs are computationally hard on temporal graphs (see e. g., the survey [24, Section 3]), motivating an extensive line of work in parameterised complexity (e. g., [33, 22, 6, 23, 35]).
The core question in parameterised complexity is whether a problem is fixed-parameter tractable () when parameterised by some measure that captures relevant properties of the input. For static graphs, one of the most studied parameters is treewidth (). Two standard approaches to obtain algorithms parameterised by treewidth are: (i) developing a dynamic program (see [11, Section 7.3]), or (ii) expressing the problem in a suitable logic and applying a logical meta-theorem.
First-order (FO) logic and monadic-second order (MSO) logic provide formal languages that can be used for expressing combinatorial problems on graphs. A key benefit of this logical perspective is that it allows for logical meta-theorems which unify algorithmic results by establishing tractability for entire classes of problems on entire classes of graphs, often based on the fragment of logic required. The most prominent example is Courcelle’s theorem [9], which implies that every property definable in MSO logic can be decided in linear time on graphs of bounded treewidth. On sparse graphs, FO model checking has a long history on increasingly general graph classes, culminating in the result of Grohe, Kreutzer, and Siebertz [26] showing that FO model checking is fixed-parameter tractable on nowhere dense graph classes – a broad notion of sparsity that, in particular, includes planar graphs and graph classes of bounded treewidth, degree, or expansion. For a detailed background on logic and algorithmic meta-theorems we refer to the surveys [25, 30].
For temporal graphs, applications of logical meta-theorems so far exclusively use MSO formulations to obtain results under bounded treewidth combined with lifetime (largest time label) or temporal degree (number of temporal edges incident to one vertex) [12, 13, 20, 21, 24, 27, 31, 35]. In contrast, the FO meta-theorem route on planar or nowhere dense graphs has not yet been considered for temporal graphs. Moreover, it is still common to obtain results via problem-specific dynamic programs with long technical proofs (see, e.g., [8, 28]), even in settings where a logical approach could yield a simpler and more modular proof. Here, we provide a unifying framework for encoding temporal graphs along with example associated formulas. We also extend existing applications of logical meta-theorems to temporal graphs beyond bounded treewidth by enabling applications of FO meta-theorems for nowhere-dense footprints.
Beyond proof techniques, a central question is which parameters meaningfully capture temporal and structural complexity. Recently, two new parameters have been introduced that are sensitive to the order of snapshots and thus capture temporal structure more intrinsically: vertex-interval-membership width () by Bumpus and Meeks [3], and tree-interval-membership width () by Enright, Hand, Larios-Jones and Meeks [19]. The latter work studies parameterised complexity with respect to and , and proposes a general procedure for deriving dynamic programs. Concretely, any problem satisfying certain locality properties admits a dynamic program on graphs with bounded , and under even more restrictive locality requirements on graphs with bounded . A drawback of their approach is that verifying the locality properties is quite involved for and becomes even more demanding for . Since bounded and imply bounded treewidth of the footprint, it is a question whether these parameters support logical meta-theorems as for and . We answer this affirmatively: we show that and admit encodings within our framework that preserve the structure needed to apply FO and MSO meta-theorems, yielding the first such results for purely temporal parameters.
1.1 Our contribution
We provide a unifying framework including the pre-existing encodings for lifetime () and temporal total degree (), and introduce novel encodings for the parameters and . These encodings are given in Section 3.
In Section 4, we show that all four encodings admit the application of FO and MSO meta-theorems. Concretely, we analyse the Gaifman graph induced by each encoding and prove that its structure is bounded by the respective parameter. This allows us to lift the static meta-theorems to temporal graphs, yielding the following temporal meta-theorems: any property expressible in FO/MSO logic over the corresponding encoding yields an algorithm parameterised by the respective parameter.
Theorem 1.
MSO Model Checking on a temporal graph is when parameterised by (i) , (ii) , (iii) , or (iv) .
Theorem 2.
FO Model Checking on a temporal graph is when parameterised by (i) if the footprint is nowhere dense, (ii) , (iii) , or (iv) .
Finally, we provide the Logic Cookbook (see Section 5 in the full version): a collection of FO and MSO formulas for over a dozen temporal graph problems studied in the literature. Besides serving as a reusable reference for future work, this section highlights the simplicity and modularity of this logical tool. For example, in each of [3, 7, 8, 19, 28], a substantial contribution is an result proven via a specialised dynamic program and lengthy correctness arguments; in our cookbook, the same result follows from a compact formula combined with the meta-theorem.
Some results and proofs are omitted due to space constraints and can be found in the full version of the paper.
1.2 Related Work
The first work in logic that bears resemblance to temporal graph encodings is by [1] who provided an alternative proof of Courcelle’s MSO meta-theorem and considered, in particular, edge-labelled static graphs. This perspective was later adopted by [35] to obtain an algorithm for Temporal -Separator parameterised by , introducing what we call the lifetime encoding.
Independently, [32] studied different models of time-varying graphs (including temporal graphs) with bounded lifetime and proposed an encoding that was claimed to extend the MSO and FO meta-theorems of Courcelle and Frick–Grohe to this setting. However, their encoding contains a fundamental flaw, which was later identified and shown to be irreparable in the survey by [24]. That survey gives a comprehensive exploration of possible notions of treewidth for temporal graphs (since no singular temporal treewidth definition exists), discussing both the lifetime and degree encodings in detail. The degree encoding was introduced by [20]. They used it to show that Temporal Reachability Edge Deletion is in with respect to , and solution size combined.
Subsequent work that uses an MSO approach: [27] prove by for Temporal Feedback Edge/Connection Set; [31] show by for Temporal Reachability Dominating Set; [21] show by for Counting Temporal Paths via a counting variant of MSO; [13] show by and by for Open and Closed Temporal Connected Component; [33] use Courcelle-type reasoning over a static MSO formulation on the footprint for Temporal Graph Realization with Fixed Stretch; and [14] show by plus maximum deadline for ReachFast using an MSO encoding which is similar to the lifetime encoding but tailored specifically to this label-shifting problem.
Concurrently to our work, [2] obtain MSO and restricted-FO meta-theorems for temporal graphs by encoding the static expansion graph as a relational structure, with treewidth and twin-width of as the respective parameters. They define a custom temporal logic (, ) which can equivalently be defined as a relational encoding of the static expansion within our framework. They also study a local time-window variant (differentials), yielding meta-theorems parameterised by the maximum treewidth or twin-width over sliding windows. In the full version, we discuss in how their results fit into our framework.
2 Preliminaries
A temporal graph consists of a static graph , known as the footprint, and a labelling function assigning to every static edge a finite set of time labels . The largest value assigned by is referred to as the lifetime . Alternatively, a temporal graph can be defined as a sequence of static snapshots . A temporal graph is (un)directed if the footprint is (un)directed. A pair , where and , is a temporal edge with label . We denote the set of all temporal edges of by . A temporal path of length is a sequence of temporal edges where forms a path in the footprint and the time labels are non-decreasing. If the time labels are strictly increasing, the path is strict; otherwise, it is non-strict. If there is a temporal path from to , we say reaches . A temporal graph is temporally connected if for all , reaches and vice versa. A temporal graph where reachability is considered exclusively using (non-)strict paths is called a (non-)strict temporal graph.111Formally, strictness is a property of the path model rather than of the temporal graph itself. We use this terminology, analogously to speaking of weighted or unit-weight static graphs, as a convention about the travel time of temporal edges: one in the strict case and zero in the non-strict case.
We distinguish two families of parameters for temporal graphs: static parameters, which constrain the structure of the (undirected) footprint, and temporal parameters, which bound the temporal structure locally or the activity over time. See Table 1 for an overview.
Static graph parameters.
The static degree of a vertex is defined as and denotes the maximum static degree of . The treewidth of a graph measures how structurally close it is to being a tree. Small treewidth means that the graph can be organised into small, overlapping pieces with a tree-like skeleton. The treewidth of a temporal graph always refers to the undirected footprint; for directed temporal graphs we take the treewidth of the underlying undirected graph of the directed footprint.
Definition 3 (Tree Decomposition, Treewidth [11]).
Let be an undirected static graph. A tree decomposition of is a pair consisting of a tree and a family of bags such that (i) , (ii) for every there exists with , and (iii) for every , the set induces a connected subtree of . The width of is defined as . The treewidth of a static graph is .
A path decomposition is a tree decomposition in which the underlying tree is restricted to be a path; the pathwidth is defined analogously as the minimum width over all path decompositions of . Since every path is a tree, we have for all graphs . A class of graphs has bounded treewidth (respectively bounded pathwidth) if there exists a constant such that every graph in the class satisfies (resp. ).
| Symbol | Name | Family | What it controls |
|---|---|---|---|
| static degree | static | #static edges locally | |
| pathwidth | static | footprint path-likeness | |
| treewidth | static | footprint tree-likeness | |
| denseness function | static | sparsity measure | |
| lifetime | temporal | largest time label | |
| temporal total degree | temporal | #temporal edges locally | |
| vertex-interval membership width | temporal | #relevant vertices at a time | |
| tree-interval membership width | temporal | #relevant vertices connected at a time |
We use standard notions from topological minor theory; for details we refer to the book [34]. Two graphs and are isomorphic if there is a bijection between and that preserves adjacency. For , an -subdivision of is obtained by selecting an arbitrary subset of edges and replacing each edge of that set by a path of length at most such that all paths are pairwise internally vertex-disjoint. The graph is a depth- topological minor of , denoted , if some -subdivision222The standard definition uses a -subdivision. We drop the factor for notational simplicity; this only rescales the depth parameter by a constant factor and yields an equivalent notion. of is isomorphic to a subgraph of (the in stands for topological and should not be confused with a time step ). A graph class is nowhere dense if there exists a function such that for every and every we have . We call a denseness-function of .
Temporal graph parameters.
The lifetime of a temporal graph is its largest time label. The temporal total degree of a vertex at time is defined as and denotes the maximum temporal total degree of . The vertex-interval membership (VIM) width and tree-interval membership (TIM) width capture the maximum number of vertices that are simultaneously “participating” in the temporal graph. Both measures use the activity-interval of a vertex , which starts at the first time at which has an incident edge and ends after the last time at which has an incident edge. For every snapshot outside this interval, does not interact with the rest of the graph.
Definition 4 (Activity-interval).
For , let and . The activity-interval of vertex is defined as and the activity-interval of a static edge as . We say or is alive at time if or , respectively.
Note that an edge can be alive at time without being active (i. e., and ), but not vice versa.
The VIM decomposition of a temporal graph consists of a path with one bag per time step containing exactly the vertices that are alive at that time. Note that every temporal graph has a unique VIM decomposition and that a temporally connected graph has VIM width exactly . See Figure 1 left for an illustration of a VIM decomposition.
Definition 5 (Vertex-Interval-Membership Width (Bumpus and Meeks [3])).
The vertex-interval-membership (VIM) decomposition of a temporal graph is a sequence of bags with . The vertex-interval-membership width of a temporal graph is .
The TIM width parameter generalises VIM width from a decomposition as a path over time to a tree. This is motivated by the fact that for many temporal problems, vertices that are alive at the same time but far from one another in the graph can be considered independently. The bags of a TIM decomposition have the property that any connected component of a snapshot is entirely contained in a bag at that time. Each bag at time is connected to the bags at time and with which it shares vertices. This forms a tree-shape (see Figure 1 right). Since the complexity of computing a minimum-width TIM decomposition is unknown, we have a trade off between time required to decompose the temporal graph and size of the decomposition. For this reason, we discuss both parameters in this work despite similarities in the proofs for each.
Definition 6 (Tree-Interval-Membership Width [19]).
A tree-interval-membership (TIM) decomposition of a temporal graph is a triple consisting of a labelled directed tree , a family of bags , and a node labelling function such that:
-
(i)
for every and there exists a unique with and ,
-
(ii)
for every there exists an with and , and
-
(iii)
the directed edges of are .
The width of a TIM decomposition is defined as . The TIM width of a temporal graph is .
Since the VIM bags form a (not necessarily optimal) path decomposition of the undirected footprint, it follows that (and hence ). Analogously, the TIM bags form a tree decomposition of the undirected footprint, and thus .
2.1 Logic in Static Graphs
First-order (FO) logic and monadic second-order (MSO) logic provide a uniform language to express graph properties and, in turn, define whole graph classes. Since we only recall the basic notions needed in this paper, we point the reader to [30] as an accessible entry point with a focus on meta-theorems and a concise introduction to FO and MSO logic. For a more detailed treatment of FO and MSO logic, we refer to [10, 16, 17].
To reason about graphs using logic, each graph is represented as a relational structure: An undirected graph is encoded with universe and an incidence relation satisfying if and only if . A directed graph is encoded with universe and relations satisfying if and only if , and if and only if .
An FO formula uses element variables ranging over the universe and builds formulas from atomic predicates or via the logical connectives , the existential quantifier , and the universal quantifier . An MSO formula is an FO formula which can additionally use set variables , the membership relation , and is allowed to quantify over sets.
A formula is interpreted in a relational structure of a graph in the natural way: denotes equality of elements or sets, denotes containment in the relation , denotes set containment, and denote negation, disjunction, conjunction, implication, and biimplication, respectively. Furthermore, is true in if and only if there is an element in the universe such that is true in when is interpreted by . Analogously, is true in if and only if is true in for all interpretations of by elements in the universe. For MSO formulas, and are analogously defined for sets by which is interpreted. A formula is satisfied by a if is true interpreted in . The algorithmic task of deciding whether a given graph satisfies a specific formula is the model checking problem.
Model Checking (MC)
| Input: | A static graph and a logical formulas . |
| Problem: | Does satisfy ? |
For FO and MSO there exist general meta-theorems that characterise the static graph classes on which their respective MC problem is tractable.
Theorem 7 (Grohe–Kreutzer–Siebertz: FO MC on nowhere dense [26]).
Let be a graph class with denseness function , i.e., for all and all . Then for every there exists a computable function and a computable radius function such that, given a graph and an FO formula , one can decide whether satifies in time .
Theorem 8 (Courcelle: MSO MC on bounded treewidth, [10]).
There exists a computable function such that, given a graph of treewidth and an MSO formula , one can decide whether satisfies in time .
3 Temporal Graph Encodings
To apply logical meta-theorems to temporal graphs, we encode them as relational structures resembling the static graph encoding with additional structure to represent time. Different encodings make different aspects of the temporal structure explicit and directly influence the structure of the resulting representation as well as the expressive power of any logic.
We present four relational encodings – two known (the lifetime encoding [27] and the degree encoding [20]) and two novel (the VIM and TIM encodings, introduced in this work) – each tailored to a specific notion of static or temporal sparsity. These encodings serve as the foundation for the temporal meta-theorems in Section 4, yielding tractability of FO and MSO model checking under bounded (i) , (ii) , (iii) , and (iv) , possibly combined with static parameters. All encodings are presented for strict, undirected temporal graphs. Directed variants can be obtained by replacing the incidence relation with source and target relations. Non-strict reachability is obtained via adapting the successor relation in the degree encoding, or on the formula level for the lifetime, VIM, and TIM encoding.
The lifetime encoding represents a temporal graph as a time-labelled static graph, mirroring the standard mathematical definition. The universe contains the vertices, temporal edges, and time steps. An incidence relation identifies the endpoints of each temporal edge, while a presence relation records when a temporal edge is present. A total linear order on the time steps encodes the global timeline.
Definition 9 (lifetime encoding).
Let be an undirected strict temporal graph with lifetime , and let . The lifetime encoding is the relational structure defined as:
universe
unary relations
binary relations
-
where ,
-
where ,
-
where .
The degree encoding abstracts away from the concrete time labels of edges and instead focuses on the relative order of neighbouring temporal edges. Rather than representing when an edge appears, the encoding captures which temporal edges can be taken consecutively along a temporal path. In contrast to static graphs – where succession is determined simply by shared endpoints – this relation additionally depends on the order at which the edges are present. As a result, the encoding directly represents temporal reachability via a partial order on temporal edges.
Definition 10 (degree encoding).
Let be an undirected strict temporal graph with temporal total degree . The degree encoding is the relational structure defined as:
universe
unary relations
binary relations
-
, where ,
-
, where and there
exists such that and .
The VIM encoding directly represents the VIM decomposition of the temporal graph at the level of the relational structure. The encoding contains a sequence of bag elements, one for each bag of the VIM decomposition. Vertices and temporal edges are related to the bag elements in which they are alive, and successive bags are connected by a linear successor relation. In contrast to the lifetime encoding, the bags are not pairwise adjacent; this avoids introducing a clique over time and ensures that the density of the structure is bounded by the VIM width of the graph.
Definition 11 (VIM encoding).
Let be an undirected strict temporal graph with VIM decomposition . The relational VIM structure is defined as:
universe
unary relations
binary relations
-
where ,
-
where ,
-
where ,
-
where .
The TIM encoding is a generalisation of the VIM encoding. In a TIM decomposition, vertices in the same connected component of a snapshot must be in the same bag at that time, while those in different connected components may be in different bags.
Definition 12 (TIM encoding).
Let be an undirected strict temporal graph with TIM decomposition . The relational TIM structure is defined as:
universe
unary relations
binary relations
-
where ,
-
where ,
-
where ,
-
where .
4 Temporal Meta–Theorems
In this section, we establish meta-theorems for FO and MSO model checking on temporal graphs. Using the relational encodings from Section 3, we show that FO/MSO-definable temporal properties are fixed-parameter tractable under bounded (i) , (ii) , (iii) , or (iv) , possibly in combination with structural assumptions on the footprint. See 1 See 2 Both results are obtained by analysing the Gaifman graph of a relational structure.
Definition 13 (Gaifman graph).
Let be any finite relational structure with universe and some set of relations . The Gaifman graph is a static, simple, undirected graph with vertex set and an edge if and only if (i) and (ii) there exist a relation with arguments and a tuple such that .
The illustrations in Figures 3, 3, 4, and 4 depict the Gaifman graphs of the four encodings. The static meta-theorems (Theorems 8 and 7) apply to relational structures via their Gaifman graphs: bounded treewidth of yields MSO MC on by Courcelle’s theorem, and nowhere denseness of yields FO MC on by the Grohe–Kreutzer–Siebertz theorem. Since each encoding is a relational structure, it suffices to show that has bounded treewidth, respectively is nowhere dense, as a function of the corresponding parameter.
4.1 Temporal Encodings preserve Treewidth
MSO model checking is fixed-parameter tractable on graph classes of bounded treewidth. We show that the Gaifman graph of each encoding has bounded treewidth whenever the corresponding parameter , , or is bounded. This has previously been established for the lifetime encoding [27] and the degree encoding [20]; we provide proofs for completeness and unified notation in the full version. For the VIM encoding and TIM encoding introduced in this work, we give novel proofs.
All results in this section are proven with a similar technique. Starting from a tree, VIM, or TIM decomposition of the temporal graph , the bags are enlarged with temporal elements specific to each encoding to obtain a tree decomposition of the Gaifman graph.
Lemma 14 ([27]).
Let be a temporal graph with treewidth and lifetime . Then and, consequently, .
Lemma 15 ([20]).
Let be a temporal graph with treewidth and maximum temporal total degree . Then and, consequently, .
Lemma 16.
Let be a temporal graph with VIM width . Then and, consequently, .
Proof.
Let be the VIM decomposition of , so and . Recall that the VIM decomposition forms a (not necessarily optimal) path decomposition of the footprint of . We build a path decomposition of as follows. To avoid confusion, we refer to the bags of the VIM decompositions of as VIM-bags and the bags of the path decomposition of as simply bags. For notational convenience, let . For each , define the bag
We show that this forms a path decomposition. Recall that the universe of is .
-
(i)
First, we show :
-
A vertex lies in every with .
-
A temporal edge lies in where for some static edge .
-
A VIM-bag lies in the bags and .
-
-
(ii)
Every edge of the Gaifman graph is covered by some bag:
-
: if is an endpoint of then and we must have .
-
: if , then .
-
: if , then .
-
: for any , we have and .
-
-
(iii)
For each element of , the indices of bags containing it form a connected subtree of :
-
occurs precisely in the bags where . Since is a contiguous interval, this must be a subpath of the decomposition.
-
occurs only in the bag . This must trivially induce a connected subpath of the decomposition.
-
occurs only in and , which are adjacent in the decomposition.
-
Lastly, we bound the width. For any , we have . Every temporal edge in has both endpoints in , so there are at most such edges. Thus , and hence .
For the TIM encoding, recall that .
Lemma 17.
Let be a temporal graph with TIM width . Then and, consequently, .
Proof.
Let be a TIM decomposition of . We build a tree decomposition of as follows. To avoid confusion, we refer to the bags of the TIM decomposition as TIM-bags and the bags of the tree decomposition as simply bags. For each , define the bag
where is the parent TIM-bag of in the TIM decomposition. We show that this forms a tree decomposition. Recall that the universe of is .
-
(i)
First, we show :
-
A vertex lies in every with . By definition of a TIM decomposition there exists at least one such TIM-bag for every vertex.
-
A temporal edge lies in where and . By definition of a TIM decomposition, there exists at least one such TIM-bag for every temporal edge.
-
A TIM-bag lies in .
-
-
(ii)
Every edge of the Gaifman graph is covered by some bag:
-
: if is an endpoint of , then there exists with and ; hence .
-
: for we have .
-
: if , then .
-
: for , we have that is the parent of in by definition of the TIM encoding. By construction of our bags, we have and . Hence and occur together in the bag .
-
-
(iii)
For each element of , the indices of bags containing it form a connected subtree of :
-
appears in the bag if and only if . By the definition of a TIM decomposition, the subtree of induced by TIM-bags containing must form a directed path. Since the TIM decomposition and this tree decomposition are indexed by the same tree, the bags containing form a subpath of .
-
appears in the bag if and only if both endpoints of are in and . This occurs in exactly one bag of the decomposition. Therefore, the subtree induced by the bags of containing is connected and non-empty.
-
appears in and all bags of its children, which induce a connected subtree of . Since the tree decomposition and the TIM decomposition are indexed by the same tree, the claim follows.
-
Lastly, we show the width bound. Since for , we have , hence .
4.2 Temporal Encodings preserve Nowhere Denseness
FO model checking is fixed-parameter tractable on nowhere dense graph classes, a broad family that includes, e. g., planar graphs, graphs of bounded expansion and of bounded treewidth. We show that the Gaifman graphs arising from our relational encodings form nowhere dense graph classes.
To the best our knowledge, FO meta-theorems have previously been considered for temporal graphs only by Mans and Mathieson [32] who studied a (flawed) variant of the lifetime encoding. They had essentially the same goal as in this paper: to design an encoding whose Gaifman graphs allow efficient FO model checking which, at the time, was only known for the class of graphs with bounded expansion. A flaw in their encoding and the associated argument was later identified by Fluschnik et al. [24]: Mans and Mathieson consider a generalisation of temporal graphs where the vertex set also varies over time. Their universe therefore contains an element for every vertex appearance (a temporal vertex), in contrast to our encoding which contains one element per static vertex. They claimed one could identify whether two temporal vertices belong to the same underlying vertex using a constant-length formula, but this would imply the existence of a constant-length formula for 3-colourability on constant-treewidth graphs [24], which would contradict .
In what follows, we show that all four encodings preserve nowhere denseness when their respective parameter is bounded. Among the four encodings, the lifetime encoding requires the most care and we first give additional definitions for depth- topological minors.
Depth- topological minors via models.
Recall that for static graphs and , we write , if some -subdivision of is isomorphic to a subgraph of . An -subdivision is obtained by replacing a set of edges in by paths of length at most such that the internal vertices (all but the endpoints) of all paths are disjoint. Equivalently, holds if contains a depth- model of , which is a pair where is an injective mapping, and for every edge , is a simple path in , called model-path, of length at most that connects and , such that for all distinct edges , the paths and are internally vertex-disjoint, and no internal vertex of any path lies in . The vertices in are called the branch-vertices of the model. Intuitively, the model represents how the graph can be “found” inside after stretching each edge of into a path of length at most . The process of contracting an edge yields the graph obtained by identifying and into a new vertex that is adjacent to every vertex that was adjacent to or in , and then deleting self-loops and parallel edges (so that the result remains simple).
Lemma 18.
Let be a nowhere dense class of static graphs with denseness-function , and consider the class of all temporal graphs with footprint in and maximum lifetime . Then the class of Gaifman graphs for each is nowhere dense. In particular, the function is a denseness-function for this class.
Proof.
Let be a nowhere dense static graph class with denseness-function , and let be the class of all temporal graphs with lifetime at most and whose footprint lies in . We analyze the class of Gaifman graphs .
Fix , let . We will refer to a vertex of as vertex node, temporal-edge node, or time node, respectively.
Step 1: is nowhere dense with .
Consider . This graph can be obtained from the footprint by subdividing every edge once (resulting in a temporal-edge node ) and multiplying this path for every temporal edge . Conversely, can be obtained from by contracting every temporal-edge node with one of its neighbours.
We show that if we can find an -subdivision of a clique in , then there is an -subdivision of in . From this we conclude that is a denseness function of .
Fix and , and assume that . Let be a depth- model of in . In , every temporal-edge node has degree 2 and is adjacent exactly to the nodes and . Consequently, no temporal-edge node in can be a branch-vertex of a depth- clique model when , and hence all branch-vertices must lie in . Additionally, each model-path of length in must alternate between and , and therefore becomes a path of length at most on in (after contracting all temporal-edge nodes with one of its neighbours). Internal vertex-disjointness of the model-paths is preserved under contraction. Thus, we obtain a depth- model of in , and therefore .
By definition of as a denseness-function for , we have for all . By our arguments above, this implies for all , and hence is a denseness-function for the class of all such graphs .
Step 2: is nowhere dense with .
Towards contradiction assume for , and let be a depth- model of in .
Step 1 shows that cannot contain a depth- topological minor isomorphic to . Thus, the only way the model can “beat” this bound is by exploiting clique of time nodes . Importantly, can help in two ways: (i) by hosting branch-vertices, and (ii) by serving as internal vertices on model-paths for clique edges. We show that both effects are limited by .
First, we consider the time nodes in that are branch-vertices. Let be the set of branch-vertices of and denote by the branch-vertices in and by the branch-vertices in . Since , we have and therefore .
Next, we consider the time nodes in that are used by model-paths. Let be the set of clique edges whose model path contains a time node of as an internal vertex. Since model-paths have to be internally disjoint, each time node in can be used by the model-path of at most one clique edge, and therefore . Let be the set of endpoints (in ) of the edges in . Then .
Define as the set of branch vertices outside whose model-paths do not use . It holds . We claim that restricting to the branch-vertices yields a depth- model of in . To that end, consider any two distinct . Then and (otherwise or ). Hence the model-path for does not go through and must lie entirely in . Thus, contains as a depth- topological minor, and in particular contains as a depth- topological minor. This contradicts being a denseness-function for .
Consequently, for all , and hence is a denseness-function for the class of all such graphs .
For the degree encoding, we show a stronger result, namely that the maximum static degree of the Gaifman graph is bounded by the temporal total degree of . Since graph classes of bounded maximum degree are nowhere dense, this immediately implies the desired result.
Lemma 19.
Let be a nowhere dense class of static graphs with denseness-function , and consider the class of all temporal graphs with footprint in and maximum temporal total degree . For , let be the Gaifman graph of the degree encoding of . Then and, consequently, the class of all such graphs is nowhere dense.
Proof.
Let be the Gaifman graph of the degree encoding . Recall from the degree encoding that the vertices of are , where is the set of temporal edges. The binary relations are: and , connecting every temporal edge to its endpoints; and , which holds if and only if the two temporal edges share an endpoint and . Thus, in the Gaifman graph : each temporal edge is adjacent to its two endpoints; and two temporal edges and are adjacent if and only if they share a vertex in and their times are comparable (which is always the case, since is a total order). We now bound the maximum degree of in terms of the maximum temporal total degree .
Let . By definition of , there are at most temporal edges incident with , so in the vertex has at most neighbours (all of them in ). There are no edges in between two vertices of . Hence . Let where has endpoints (for directed graphs, is the source and the target; the argument is identical). Then the neighbours of in are (1) its endpoints and (two vertices in ); and (2) all other temporal edges incident with or with (the -neighbours). By the definition of , there are at most temporal edges at different from , and at most such edges at . Therefore has at most neighbours in , plus its two endpoint vertices. In particular, .
Combining both cases, the maximum degree of is bounded by .
For the VIM encoding and the TIM encoding the nowhere dense preservation also follows from a stronger result: the parameters and bound the treewidth of the footprint of a temporal graph. Since graph classes with bounded treewidth are nowhere dense, the desired result follows directly from the treewidth bounds established in Lemmas 16 and 17.
Corollary 20.
Let be a class of temporal graph with VIM width at most . Then the class of all Gaifman graphs is nowhere dense. Equivalently, let be a class of temporal graph with TIM width at most . Then the class of all Gaifman graphs is nowhere dense.
5 Logic Cookbook (see full version)
A major motivation of our framework is reusability: in the full version, we provide a modular lexicon of FO/MSO formulas for temporal-graph properties across all four encodings (and, by design, extendable to future encodings). The cookbook covers over a dozen problems considered in the temporal graph literature including reachability notions (temporal path, reachability, restless path), reachability-based problems (separator/cut, connected component, temporal spanner), covering problems (matching, edge/vertex cover, dominating set), classic subgraph problems (temporal clique and independent set, colouring), and temporal parameters (feedback edge number, temporal path number). For each problem, we provide (i) a formal definition; (ii) a modular logic formula; (iii) metadata such as the supported encodings, the logical fragment (FO/MSO), and formula length.
As an illustration, we give the formula for Temporal Spanner (see [5, 29]) which is a sparse subgraph of a temporal graph that preserves temporal connectivity.
MSO Formula 5.3.13 temporal spanner
Purpose: there exists a set such that for every there is a temporal - path in if and only if there is a temporal - path only traversing temporal edges in
| Logic: | MSO | Length: | constant | Encodings: | , , , |
where checks if there is a temporal path from to and checks if there is a temporal path from to only traversing temporal edges in .
6 Future Work
Several directions for future research exist on the use of logic for temporal graphs.
With respect to temporal encodings, a natural direction is to identify other temporal parameters for which similar preservation and meta-theorems can be obtained. Possible candidates include the temporal feedback vertex number [27], the temporal cliquewidth [18], or a combination of underlying cliquewidth with lifetime or temporal total degree.
In the work introducing the TIM width, Enright et al. [19] present two meta-algorithms that characterise the classes of computational problems that are with respect to and . For , tractability is tied to a notion of temporal locality, while for this locality is further structurally restricted. This perspective reminds of first-order logic which is inherently limited to see only local properties of a graph. An interesting question is whether these classes of problems admit a precise logical characterisation, e. g., by a suitable fragment of FO or MSO logic, and how such a characterisation relates to the VIM and TIM encodings.
Finally, a broader direction is to investigate logical tools beyond FO and MSO meta-theorems, such as logical transductions, game-based techniques, and methods inspired by the Weisfeiler–Leman framework. Such tools may provide alternative ways to compare temporal graph classes and to reason about their structural and algorithmic properties. Recent work has begun to study isomorphisms for temporal graphs under reachability notions [4, 15]; an intriguing next step is to explore whether transductions or related techniques can be used to further compare temporal graph classes, in particular with respect to structural parameters and the computational complexity of temporal graph problems.
References
- [1] Stefan Arnborg, Jens Lagergren, and Detlef Seese. Easy problems for tree-decomposable graphs. Journal of Algorithms, 12(2):308–340, 1991. doi:10.1016/0196-6774(91)90006-K.
- [2] Binh-Minh Bui-Xuan, Florent Krasnopol, Bruno Monasson, and Nathalie Sznajder. Model checking with temporal graphs and their derivative, 2026. doi:10.48550/arXiv.2602.12446.
- [3] Benjamin Merlin Bumpus and Kitty Meeks. Edge Exploration of Temporal Graphs. Algorithmica, 85(3):688–716, 2023. doi:10.1007/s00453-022-01018-7.
- [4] Arnaud Casteigts, Timothée Corsini, and Writika Sarkar. Simple, Strict, Proper, Happy: A Study of Reachability in Temporal Graphs. Theoretical Computer Science, 991:114434, 2024. doi:10.1016/j.tcs.2024.114434.
- [5] Arnaud Casteigts, Anne-Sophie Himmel, Hendrik Molter, and Philipp Zschoche. Finding Temporal Paths Under Waiting Time Constraints. Algorithmica, 83(9):2754–2802, 2021. doi:10.1007/s00453-021-00831-w.
- [6] Arnaud Casteigts, Nils Morawietz, and Petra Wolf. Distance to Transitivity: New Parameters for Taming Reachability in Temporal Graphs. In Rastislav Královič and Antonín Kučera, editors, 49th International Symposium on Mathematical Foundations of Computer Science, volume 306, pages 36:1–36:17, Dagstuhl, Germany, 2024. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. ISSN: 1868-8969. doi:10.4230/LIPIcs.MFCS.2024.36.
- [7] Justine Cauvi and Laurent Viennot. Parameterized Restless Temporal Path, 2025. doi:10.48550/arXiv.2507.05760.
- [8] Dibyayan Chakraborty, Antoine Dailly, Florent Foucaud, and Ralf Klasing. Algorithms and Complexity for Path Covers of Temporal Dags, 2024. URL: https://hal.science/hal-04493029.
- [9] Bruno Courcelle. Graph Rewriting: An Algebraic and Logic Approach. In Handbook of Theoretical Computer Science, Volume B: Formal Models and Semantics, pages 193–242. Elsevier, 1990. doi:10.1016/B978-0-444-88074-1.50010-X.
- [10] Professor Bruno Courcelle and Dr Joost Engelfriet. Graph Structure and Monadic Second-Order Logic: A Language-Theoretic Approach. Cambridge University Press, USA, 1st edition, 2012.
- [11] Marek Cygan, Fedor V. Fomin, Łukasz Kowalik, Daniel Lokshtanov, Daniel Marx, Marcin Pilipczuk, and Michał Pilipczuk. Parameterized Algorithms, volume 5. Springer, a edition, 2015.
- [12] Tom Davot, Jessica Enright, and Laura Larios-Jones. Parameterised algorithms for temporally satisfying reconfiguration problems. In International Symposium on Algorithmics of Wireless Networks, pages 89–103. Springer, 2025. doi:10.1007/978-3-032-09120-8_7.
- [13] Argyrios Deligkas, Michelle Döring, Eduard Eiben, Tiger-Lily Goldsmith, George Skretas, and Georg Tennigkeit. Parameterized Complexity of Temporal Connected Components: Treewidth and Temporal Path Number, 2025. doi:10.48550/arXiv.2510.05806.
- [14] Argyrios Deligkas, Eduard Eiben, and George Skretas. Minimizing Reachability Times on Temporal Graphs via Shifting Labels. In Proceedings of the Thirty-Second International Joint Conference on Artificial Intelligence, IJCAI 2023, 19th-25th August 2023, Macao, SAR, China, volume 5, pages 5333–5340, 2023. doi:10.24963/ijcai.2023/592.
- [15] Michelle Döring. Simple, Strict, Proper, and Directed: Comparing Reachability in Directed and Undirected Temporal Graphs. In The 36th International Symposium on Algorithms and Computation, ISAAC 2025, volume 359, pages 27:1–27:21, Tainan, Taiwan, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik (2025). doi:10.4230/LIPIcs.ISAAC.2025.27.
- [16] H.-D. Ebbinghaus, J. Flum, and W. Thomas. Mathematical Logic. Springer, New York, NY, 1994. doi:10.1007/978-1-4757-2355-7.
- [17] Heinz-Dieter Ebbinghaus and Jörg Flum. Finite Model Theory. Springer Science & Business Media, 1999.
- [18] Jessica Enright, Samuel D. Hand, Laura Larios-Jones, and Kitty Meeks. Structural Parameters for Dense Temporal Graphs. LIPIcs, Volume 306, MFCS 2024, 306:52:1–52:15, 2024. doi:10.4230/LIPIcs.MFCS.2024.52.
- [19] Jessica Enright, Samuel D. Hand, Laura Larios-Jones, and Kitty Meeks. Families of Tractable Problems with Respect to Vertex-Interval-Membership Width and Its Generalisations, 2025. doi:10.48550/arXiv.2505.15699.
- [20] 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.
- [21] Jessica Enright, Kitty Meeks, and Hendrik Molter. Counting Temporal Paths. Algorithmica, 87(5):736–782, 2025. doi:10.1007/s00453-025-01301-3.
- [22] Thomas Erlebach, Nils Morawietz, and Petra Wolf. Parameterized Algorithms for Multi-Label Periodic Temporal Graph Realization. Theoretical Computer Science, page 115412, 2025. Publisher: Elsevier. doi:10.1016/j.tcs.2025.115412.
- [23] Thomas Erlebach and Jakob T. Spooner. Parameterised Temporal Exploration Problems. Journal of Computer and System Sciences, 135:73–88, 2023. doi:10.1016/j.jcss.2023.01.003.
- [24] Till Fluschnik, Hendrik Molter, Rolf Niedermeier, Malte Renken, and Philipp Zschoche. As Time Goes By: Reflections on Treewidth for Temporal Graphs. In Fedor V. Fomin, Stefan Kratsch, and Erik Jan Van Leeuwen, editors, Treewidth, Kernels, and Algorithms, volume 12160 of Lecture Notes in Computer Science, pages 49–77. Springer International Publishing, Cham, 2020. doi:10.1007/978-3-030-42071-0_6.
- [25] Martin Grohe. Logic, Graphs, and Algorithms. Logic and Automata, pages 2 : 357–422, 2008.
- [26] Martin Grohe, Stephan Kreutzer, and Sebastian Siebertz. Deciding First-Order Properties of Nowhere Dense Graphs. J. ACM, 64(3):17:1–17:32, 2017. doi:10.1145/3051095.
- [27] Roman Haag, Hendrik Molter, Rolf Niedermeier, and Malte Renken. Feedback Edge Sets in Temporal Graphs. Discrete Applied Mathematics, 307:65–78, 2022. Publisher: Elsevier. doi:10.1016/j.dam.2021.09.029.
- [28] Anton Herrmann, Christian Komusiewicz, Nils Morawietz, and Frank Sommer. Timeline Problems in Temporal Graphs: Vertex Cover vs. Dominating Set. In Akanksha Agrawal and Erik Jan van Leeuwen, editors, 20th International Symposium on Parameterized and Exact Computation (IPEC 2025), volume 358 of Leibniz International Proceedings in Informatics (LIPIcs), pages 12:1–12:18, Dagstuhl, Germany, 2025. Schloss Dagstuhl – Leibniz-Zentrum für Informatik. doi:10.4230/LIPIcs.IPEC.2025.12.
- [29] David Kempe, Jon Kleinberg, and Amit Kumar. Connectivity and Inference Problems for Temporal Networks. Journal of Computer and System Sciences, 64(4):820–842, 2002. doi:10.1006/jcss.2002.1829.
- [30] Stephan Kreutzer. Algorithmic meta-theorems. In Finite and Algorithmic Model Theory, London Mathematical Society Lecture Note Series, pages 177–270. Cambridge University Press, 2011. editors: J. Esparza, C. Michaux, and C. Steinhorn.
- [31] David C. Kutner and Laura Larios-Jones. Temporal Reachability Dominating Sets: Contagion in Temporal Graphs. Journal of Computer and System Sciences, 155:101–116, 2023. doi:10.1007/978-3-031-48882-5_8.
- [32] Bernard Mans and Luke Mathieson. On the Treewidth of Dynamic Graphs. Theoretical Computer Science, 554:217–228, 2014. doi:10.1016/j.tcs.2013.12.024.
- [33] George B. Mertzios, Hendrik Molter, Nils Morawietz, and Paul G. Spirakis. Temporal Graph Realization With Bounded Stretch. In 50th International Symposium on Mathematical Foundations of Computer Science, volume 345, pages 75:1–75:19, Dagstuhl, Germany, 2025. Leibniz International Proceedings in Informatics (LIPIcs). doi:10.4230/LIPIcs.MFCS.2025.75.
- [34] Jaroslav Nešetřil and Patrice Ossona De Mendez. Sparsity: Graphs, Structures, and Algorithms, volume 28 of Algorithms and Combinatorics. Springer Berlin Heidelberg, Berlin, Heidelberg, 2012. doi:10.1007/978-3-642-27875-4.
- [35] 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.
