# Spatial Performance Indicators for Traffic Flow Prediction
## 3 Materials and Methods
### Spatial KPIs
#### 3.1.3 Node Centrality Measure (Adapted PageRank Algorithm Modified)  
PageRank [29] is a method to compute a ranking of the importance of every web page based on the graph of the web. PageRank utilizes the graph network structure of web networks to measure the global ranking of each web page, which reflects the relative importance of each web page within the network. PageRank is a well-known algorithm for measuring node centrality and is one of the algorithms behind the Google search engines. The main idea of PageRank can be described by the \"random surfing model\". In this model, a user randomly navigates the web by following hyperlinks on the current webpage. The probability that the user clicks on a particular web page indicates its importance. Using this concept, web pages that are more linked to other web pages will be considered more important because they are more likely to be visited by users. The PageRank \(PR\) of node \(P\) in graph \(G=(V,E)\), with adjacency matrix \(A\) and element \(i,j\) of the adjacency matrix defined as \(a_{i,j}\), can be defined by the following equation:  
\[A^{*}=(a_{ij}^{*})_{i,j} \tag{11}\]  
\[a_{ij}^{*}= \begin{cases}\frac{a_{i,j}}{c_{j}}&\text{if $c_{j}\
eq 0$ and $i\
eq j$}\\ 0&\text{otherwise}\end{cases}  \tag{12}\]  
\[PR_{P}(k+1)=\alpha\ A^{*}\ PR_{P}(k)+\frac{(1-\alpha)}{n}I_{n} \tag{13}\]  
where \(PR_{P}(k)\) is the PageRank of node \(P\) in iteration \(k\); \(A^{*}\) is the adjacency matrix normalized by the number of outbond links from each node; \(n\) is the number of nodes; and \(\alpha\) is the damping factor, typically set to 0.85, which represents the probability that the user will click on a hyperlink. The algorithm is usually initialized with an equal PageRank value for every page, and the value is updated iteratively until convergence. By calculating the \(PR\) of each node, we can rank the importance of all webpages based on centrality measures. PageRank is typically applied to webpage networks. Unfortunately, traffic networks differ from webpage networks. Centrality measures based on PageRank focus only on the topology of the network and do not consider the data in the network. However, traffic networks are complex systems with a large amount of data measured by sensors, and these data, along with the network graph, are important pieces of information. Traffic networks are also significantly smaller than webpage graphs with fewer edges per node. The concept of \"random surfing model\" is also debatable in traffic networks as a vehicle needs to take connected routes and is not able to exhibit \"teleporting\" from one node to the others. Despite its limitation in traffic network, PageRank and its variants have been used to rank nodes in traffic network graphs, and the ranking can be utilized for urban traffic optimization [30] and as a signal to predict congestion [31]. The ability to know the importance of nodes on a graph is important, and, in traffic management systems, knowing the highly important nodes can help to minimize the risks of network-wide disruptions. We consider a variant of PageRank, the Adapted PageRank Algorithm Modified (APAM) [18], established for ranking nodes in an urban network by utilizing traffic data. The main idea behind APAM is the addition of a data matrix \(D\), which allows the algorithm to incorporate important traffic data. The Algorithm 1 is summarized as follows. In the APAM algorithm, the damping ratio \(\alpha\) is an important parameter representing the weighting between the importance of the network topology and data features. The APAM results are the rankings of each node in the traffic network based on the element of the eigenvector. The APAM helps to determine the importance of each node in the traffic flow prediction method based on two factors: the prediction error of a node and its node centrality. To simplify the metric, we performed a univariate analysis of the resulting APAM values and drew conclusions based on the moments of the distribution.