## 3 Problem Statement  
Given a tessellation of the area of interest (henceforth referred to as _city_) in regularly-shaped regions, a set of historical observations regarding trajectories of vehicles within the city and, possibly, other spatial and non-spatial data sources for a reference time horizon \(T_{H}\) of \(H\) time points, the _citywide vehicle flow prediction problem_[7] is defined as the problem of minimizing the prediction error for vehicle _Inflow_ and _Outflow_ at time \(t^{\prime}\) that is the first time point after \(T_{H}\).  
In the literature, there are several definitions of location/region with different granularity and different semantic meaning [35]. However, when it comes of traffic forecasts, the majority of works uses a rectangular tessellation, which maximizes the number of neighboring areas. Similarly, in this study, the geographical space of interest (city) is logically partitioned into a regular grid of size \(N\times M\) oriented by longitude and latitude [4]. Each element of the grid is termed _region_ and is addressable through a pair of coordinates \((n,m)\) corresponding to the \(n\)th row and the \(m\)th column of the grid.  
The term Inflow (Outflow, respectively) refers to the number of vehicles entering (leaving) a specific region in the considered time unit (Figure 1) [7]. More specifically, the Inflow (Outflow) indicates the number of pedestrians, cars, public transport and sharing vehicles entering (leaving) the region in a certain time period. As shown in Figure 1, by analyzing the movement data of the vehicles, it is possible to obtain the Inflow and Outflow matrix, which encompass the information about displacements between the areas of the city at each time \(t\). More in detail, let \(\tau_{i}=\{s_{i}^{1},s_{i}^{2},\ldots s_{i}^{t}\}\) be a trajectory where \(s_{i}^{t}\) represents the position of vehicle \(i\) at time \(t\), and let \(\mathcal{T}\) be a collection of trajectories. The Inflow (Outflow, respectively) of a region \((n,m)\) at time \(t\), namely \(t_{n,m}^{t}\) (\(\omega_{n,m}^{t}\)) can be formally defined as in Equations (1) and (2), respectively.  
\[t_{n,m}^{t}=\sum_{\tau_{i}\in\mathcal{T}}\phi_{i}(\tau_{i},t,n,m) \tag{1}\]  
\[\omega_{n,m}^{t}=\sum_{\tau_{i}\in\mathcal{T}}\phi_{\omega}(\tau_{i},t,n,m) \tag{2}\]  
where  
\[\phi_{i}(\tau_{i},t,n,m)=\begin{cases}1,&\text{if }s_{i}^{t-1}\
otin(n,m) \wedge s_{i}^{t}\in(n,m)\\ 0,&\text{otherwise.}\end{cases}\]  
and  
\[\phi_{\omega}(\tau_{i},t,n,m)=\begin{cases}1,&\text{if }s_{i}^{t-1}\in(n,m) \wedge s_{i}^{t}\
otin(n,m)\\ 0,&\text{otherwise.}\end{cases}\]Finally, the state of the vehicular flow at time \(t\) can be represented by a tensor (also referred to as _frame_ in what follows) \(F_{t}\in\mathbb{R}^{N\times M\times C}\), where \(C\) indicates the number of flow variables considered in the analysis, in this specific case \(C=2\) (Inflow/Outflow), whereas \(N\times M\) is the total number of regions in the city. Then, to take into account the temporal dependence, over the time horizon \(T\) (divided into \(H\) time points), the flow representation is extended to a tensor of four dimensions \(F\in\mathbb{R}^{H\times N\times M\times C}\), which represents the main input to our problem. The problem at issue then becomes predicting \(F_{t}\) given a _volume_, that is a sequence of past tensors \(\mathcal{V}\subset F\). It is worth noting that the resulting problem shows several similarities with the frame prediction problem [8] since the tensor \(F\) can be seen as a four dimensional volume composed of \(H\) consecutive images, each of which featuring \(C\) channels.