# Efficient Multi-Source Anonymity for Aggregated Internet of Vehicles Datasets
## 4 Algorithms  
In addition, we provide a multi-source linkability attack Algorithm 1. This can verify the privacy disclosure. It inputs the anonymized aggregated dataset \(AT^{\prime}\) and the attribute set \(QI_{s}\). \(QI_{s}\) are the attacker's data attributes. Attackers can identify individuals from \(QI_{s}\) and can thereby obtain accurate information by linking other QIs. The output is set as \(InferenceSet\). It contains the accuracy value that the attackers obtain from other \(QI\) attributes. Lines 1-5 define parameters and variables and return anonymized equivalence class \(ECs\). The loop of \(ECs\) checks each value of the other \(QI\) attributes. If it is the original value, it is added to \(InferenceSet\). Finally, this algorithm returns all original values from the other \(QI\) attributes. The overhead of this algorithm is \(O(|ECs|*m)\), where \(|ECs|\) is the number of equivalence classes and \(m\) is the number of \(QI_{d}\); the method is efficient. ```
1:\(AT^{\prime}\),\(QI_{s}\)
2:\(InferenceSet\)
3:\(InferenceSet=new\ HashMap()\)
4:\(define\ EI,QI,SA\) attributes
5:\(defineQl_{s},QI_{d}\)
6:\(ECs=EquivalenceClass(AT^{\prime})\)
7:\(m=the\ attribute\ number\ of\ QI_{d}\)
8:for\(i=0\)to\(|ECs|\)do
9:\(r=AT^{\prime}[i]\)
10:\(Qlkey=r.QI_{s}\)
11:for\(j=0\)to\(m\)do
12:if\(QI_{d}[j]\) is original value then
13:if\(!InferenceSet.contain(QIkey)\)then
14:\(valueList=[]\)
15:\(valueList.set(j,QI_{d}[j])\)
16:\(InferenceSet.put(QIkey,valueList)\)
17:else
18:\(valueList=InferenceSet.get(QIkey)\)
19:\(valueList.set(j,QI_{d}[j])\)
20:endif
21:endif
22:endif
23:endfor
24:return\(InferenceSet\)
```  
**Algorithm 1** The multi-source linkability attack algorithm. We provide an implementation algorithm for the multi-source (\(k\),\(d\))-anonymity model. This algorithm can deliver good data utility and efficiency using the Hilbert curve. The Hilbert curve [40] is a well-known spatial mapping technique. It can map a point-of-space region to an integer. If two points are close in multidimensional space, they are likely to have similar Hilbert transform values. For example, Figure 6 illustrates the transformation of the data from 2-D to 1-D for attributes such as postcode and age. The dataset exhibits complete ordering with respect to the 1-D Hilbert values. For instance, the value [55,100195] is transformed to the 1-D value 1, whereas the value [62,100196] is transformed to a 1-D value of 63. In the data mapping process, each attribute value must be assigned an integer value to facilitate sorting. For numerical attributes, attribute values can be used directly owing to their inherent orderliness. As illustrated in the figure, both age and postcode can be arranged in ascending order, and each attribute value is assigned as a distinct integer. For categorical attributes, the assignment of integers is based on a taxonomy tree. For instance, considering a taxonomy tree with nodes \"India\" and \"Japan\" sharing the parent \"Europe\", \(NCP(India,Japan)=1/2\). On the other hand, when comparing nodes \"Cambodia\" and \"England\" with the common parent \"Country\", \(NCP(Cambodia,England)=1\). Therefore, distances for nodes sharing the same parent node should be smaller. Figure 7 showcases this. We propose an efficient and heuristic multi-source (\(k\),\(d\))-anonymity algorithm. Algorithm 2 describes the primary implementation process. The algorithm inputs the original aggregated dataset \(AT\) and anonymity requirements \(k\), \(t\). First, it defines the EIs, QIs, and SAs. Subsequently, the EIs are deleted to satisfy the anonymization requirements. The term \(d_{QI}\) denotes the number of QIs. \(Domains\) are a set containing domain values of the QIs. Lines 4-7 obtain the domain values. The \(DOMAIN\) function obtains all domain values of \(QI_{l}\). Based on the domain value \(Domain\) and dimension \(d_{QI}\), a Hilbert curve is plotted on \(AT\). It implements the mapping from \(d_{QI}\)-D to 1-D by Hilbert transform. It sort the records with \(d_{QI}\)-D attributes in the dataset \(AT\).