## 3 Problem Statement and Input Data Representation Methods
### Common Forms of Input Representations
#### 3.2.2 Matrix/Grid-Based Sequence  
We previously discussed the spatial dependencies of traffic data, which revealed the mutual influence of traffic conditions between different locations. To effectively capture this spatial relationship, the method of dividing a map into grids in Euclidean space can be used. Specifically, the map is divided into many uniform small areas, with each grid representing a specific area on the map. This way, the map's location information is transformed into a two-dimensional matrix or grid structure. In this structure, each cell of the matrix or grid contains traffic information for a particular area and simulates the spatial proximity of the real world between cells. Additionally, the traffic matrix (TM) refers to a specific application scenario, namely, the representation of traffic flow between different nodes (such as intersections, city areas, etc.) in a network. Data processed in this manner are referred to as a grid-based sequence, as shown in Figure 4a. The grid-based sequence, \(\mathbf{X}^{m}\in\mathbb{R}^{i\times j\times t}\), consisting of \(i\) rows and \(j\) columns is spread over \(t\) time steps, and it can be represented as \(\mathbf{X}^{m}=\left\{X_{1}^{m},X_{2}^{m},\ldots,X_{t}^{m}\right\}\), where \(X_{i}^{m}\in\mathbb{R}^{i\times j}\) represents a two-dimensional matrix indicating the traffic state of all grids at time \(t\). [PERSON] et al. (2019) divided the city into equally sized grid areas, with each grid cell capturing the inflow and outflow traffic volume of pedestrian flows. Inflow is defined as the total traffic volume entering an area within a given time interval. In contrast, outflow is defined as the total traffic volume leaving the area within the same time interval. Matrices at each time step are stacked to form a three-dimensional tensor, representing the temporal sequence of pedestrian flow volumes. [PERSON] et al. (2019) represented city roads in a grid format, where each grid cell captures taxi demand. The constructed matrix is in a single tensor form. They built a matrix sequence where each matrix represents the city's taxi demand at different time steps. [PERSON] et al. (2019) constructed a grid-based matrix sequence for short-term bike sharing demand. Specifically, they partitioned the surveyed areas of Shanghai into a grid of \(5\times 5\) cells, aggregating the trip data of bicycles in Shanghai (including start timestamps, start geolocations, end timestamps, end geolocations, etc.), as well as collecting weather and air quality data, based on grid cells. The data for each time step are integrated into a matrix, with each matrix element containing comprehensive data for the corresponding grid cell; over time, these matrices are arranged in chronological order to form a matrix sequence. [PERSON] et al. (2019) divided the city into several grids and proposed a parameter to control the grid width. This study suggests that the pickup demands from certain locations at the previous time step will affect the dropoff demands at the next time step. Subsequently, all data are mapped to the grids, and each grid's pickup and dropoff demands are aggregated for each time interval. Demand matrices are generated for each time interval, quantifying the number of pickup and dropoff demands occurring within each grid.  
Figure 4: Two representations of spatiotemporal traffic data: (**a**) a simple schematic diagram of a grid-based sequence data representation, representing a sequence of traffic data changing over time; (**b**) a simple schematic diagram of a graph-based sequence data representation, representing a sequence of traffic data changing over time.