## 3 Intelligent Contact Tracing Based on Transmission Characteristics
### Space-Based Indoor Wi-Fi Contact Tracing
#### 3.2.1 Step 1: Calculate Similarity  
To enhance the precision of indoor contact tracing, we initially applied a path-loss model to Wi-Fi data to calculate a distance vector. This allows us to compute Euclidean, Cosine, and Jaccard similarities, which serve as robust metrics to assess the proximity between a confirmed patient and other individuals.  
Consider \(A\), a set of basic service set identifiers (BSSIDs) of Wi-Fi APs collected through the IntelliTrace system. \(A\) is represented as follows:  
\[A = \bigcup_{i=1}^{N_{pe}}A_{i}\] \[= \{a_{1},a_{2},...,a_{j},...,a_{N_{pe}}\}\]  
where \(N_{pe}\) is the number of individuals whose data are in the system, and \(A_{i}\) is the set of BSSIDs of Wi-Fi APs received by the individual (\(i\)). \(N_{ap}\) denotes the total number of APs in the IntelliTrace system.  
The received signal strength indicator (\(RSSI\)), which is computed in decibels (dB), indicates the strength of the received radio signals. A greater \(RSSI\) value represents a stronger signal. \(r_{ij}\) means the \(RSSI\) for AP BSSID \(a_{j}\) detected by the individual (\(i\)). When determining the contact between the confirmed patient and potential contact, an estimated distance using \(RSSI\) is utilized to calculate the similarity. Owing to the characteristics of Wi-Fi signals, the distance between an individual and an AP increases exponentially as \(RSSI\) decreases. We obtain \(\bar{d}_{i}\), a distance vector for set A of the individual (\(i\)), by applying  
Figure 1: The overall process of space-based indoor Wi-Fi contact tracing.  
the path-loss model to \(r_{ij}\) to convert the \(RSSI\) signal into the distance, \(d_{ij}\), between the individual (\(i\)) and AP (\(a_{j}\)).  
\[\vec{d}_{i} = \begin{bmatrix}d_{i1}&d_{22}&\cdots&d_{ij}&\cdots&d_{N_{pe}N_{ap}} \end{bmatrix}\] \[d_{ij} = \begin{cases}10^{\frac{(r_{0}-r_{ij})}{100}},&\text{if }r_{ij}>RSSI_{min}.\\ d_{max},&\text{otherwise, or is NaN}.\end{cases} \tag{1}\]  
\(r_{0}\) indicates the \(RSSI\) at a unit distance (\(d_{0}\)). \(RSSI_{min}\) denotes a minimum \(RSSI\) value to ensure distance accuracy and \(\delta\) is a path-loss coefficient according to the Wi-Fi signal environment. In general, the value of \(\delta\) in an indoor environment is set to 3-5 [22]. Additionally, the Wi-Fi signal reception environment is indoors with many obstacles; therefore, the path-loss coefficient (\(\delta\)) is set to 4. If \(r_{ij}\) is less than \(RSSI_{min}\) or is NaN, it is set as a constant \(d_{max}\), which means the maximum radius between an individual and a Wi-Fi AP. The IntelliTrace uses the BSSI set (\(A_{i}\)) and the distance vector (\(\vec{d}_{i}\)) for Wi-Fi signals detected by the individual (\(i\)) to calculate similarity.  
In this study, three similarity measures were chosen--Euclidean similarity, Cosine similarity, and Jaccard similarity--to compute the similarities, as described below in Table 1. Euclidean distance was employed for simple distance calculations, Cosine similarity was utilized to assess the similarity of AP signal vectors, and Jaccard similarity was used to evaluate the similarity of overlapping AP patterns.