## 4 Deep Learning-Based Minimum Timeline Cover
### Temporal Encoding with Transformers  
For each node \(v\), we construct a sequence of temporal embeddings:  
\[H_{v}=[h_{v}^{(1,K)},h_{v}^{(2,K)},\dots,h_{v}^{(T,K)}] \tag{5}\]  
where \(H_{v}\in\mathbb{R}^{T\times d}\) and \(d\) is the dimension of the embedding. This sequence, however, is composed of representations of nodes built considering only static information. No temporal processing has been performed until now. To allow the PN to effectively make informed decisions, this sequence must be reprocessed to effectively embed the temporal evolution of the network in each node representation at each timestamp. Thus, we apply a Transformer with positional encoding to the sequence \(H_{v}\) to obtain the final embedding of node \(v\), as described in Appendix A.3.  
Since the embeddings \(H_{v}\) do not inherently capture the temporal structure of the sequence, we first add temporal positional encodings to each timestamp to encode the order information. The positional encoding for a given timestamp \(t\) is defined as in Equation (A11). We then add the positional encoding to each input embedding to obtain the temporally encoded sequence:  
\[\hat{h}_{v}^{(t,K)}=h_{v}^{(t,K)}+PE(t),\quad\forall t\in[1,\dots,T]. \tag{6}\]  
The resulting sequence is denoted as  
\[\hat{H}_{v}=[\hat{h}_{v}^{(1,K)},\hat{h}_{v}^{(2,K)},\dots,\hat{h}_{v}^{(T,K)} ]\in\mathbb{R}^{T\times d}. \tag{7}\]  
We then apply a Transformer layer to the temporally encoded sequence \(\hat{H}_{v}\) to capture temporal dependencies between different timestamps. Each Transformer layer consists of a Multi-Head Self-Attention mechanism followed by a feedforward neural network (FFNN), for which details are provided in Appendix A.1. The self-attention mechanism computes three matrices-- Query, Key, and Value--using learned linear transformations:  
\[Q=\hat{H}_{v}W_{Q},\quad K=\hat{H}_{v}W_{K},\quad V=\hat{H}_{v}W_{V}, \tag{8}\]  
where \(W_{Q},W_{K},W_{V}\in\mathbb{R}^{d\times d}\) are the learned weight matrices, and \(Q,K,V\in\mathbb{R}^{T\times d}\).  
These are used to compute the scaled dot-product attention as in Equation (A9). Finally, instead of a single set of \(Q,K,V\) matrices, the Transformer utilizes multiple attention heads to capture diverse temporal patterns as in Equation (A10).  
The output of the multi-head attention layer is passed through an FFNN applied independently to each timestamp and each sub-layer (self-attention and FFNN) is followed by a residual connection and a layer normalization step. The output of the multi-head attention layer is  
\[\hat{H}_{v}^{\prime}=\text{LayerNorm}(\hat{H}_{v}+\text{MultiHead}(Q,K,V)), \tag{9}\]  
and the final output of the Transformer layer is  
\[P_{v}=\text{LayerNorm}(\hat{H}_{v}^{\prime}+FFNN(\hat{H}_{v}^{\prime})). \tag{10}\]  
The resulting sequence \(P_{v}=[P_{v}^{(1)},P_{v}^{(2)},\dots,P_{v}^{(T)}]\) captures the temporal relationships between the timestamps while preserving the dimensionality of the input embeddings. Thus, each element \(P_{v}^{(t)}\in\mathbb{R}^{d}\) is now conditioned on the entire sequence, enabling temporal dependencies to be modeled explicitly.