Skip to main content
. 2023 Jan 31;23(3):1554. doi: 10.3390/s23031554
Algorithm 1. K-Anonymity Privacy Protection Algorithm for Multi-Dimensional Data Against Skewness and Similarity Attacks (KAPP)
Input: original multi-dimensional data
Output: anonymous multi-dimensional data
1: n = 6000; k = 7; m = 30; Maxit = 200; sas = 6; t = 0.1;
2: Deleting all identifier data, and converting categorical data to numerical value;
3: while (current solution zim) do
4:  while (current cluster center jk) do
5:   csasi=rsasi×(upsadnsa)+dnsa;
6:   end
7: end
8: while (current iteration itMaxit) do
9:   while (current solution zim) do
10:    ujq=1Dist(rj,cq)2/l=1k1Dist(rj,cl)2, fzi=q=1kj=1n(ujq)e×Dist(rj,cq);
11:   end
12:   while (current solution zim) do
13:     HR=rand22×(sinop(π2×itMaxit)+cos(π2×itMaxit)1)+rand33×(1itMaxit);
14:     if (HR ≥ 1) then
15:      if (P1rand01) then
16:       x(it+1)=BV(it)|rand02×(BV(it)+H(it))×12x(it)|×HR;
17:      else
18:       x(it+1)=rand01×((upsadnsa)×rand01+dnsa)+BV(it)HR;
19:      end if
20:     else if (1 ≥ HR ≥ 0.5) then
21:      if (P2rand01) then
22:      x(it+1)=(HR+rand01)BV(it)+x(it)×|rand02×BV(it)x(it)|;
23:     else
24:       x(it+1)=BV(it)×(1(rand01×x(it)2×π)×cos(x(it))(rand01×x(it)2×π)×sin(x(it)));
25:     end if
26:    else
27:     if (P3rand01) then
28:        x(it+1)=ω1×BV1(it)×(1x(it)×HRBV1(it)x(it)2)+ω2×BV2(it)×(1x(it)×HRBV2(it)x(it)2);
29:     else
30:      x(it+1)=BV(it)|BV(it)x(it)|×HR×Levy;
31:     end if
32:    end if
33:  end
34: end
35: Selecting the most similar data to form n/k equivalence classes;
36: while (current equivalence class vn/k) do
37:      SADVz=h=1aSADNzh+f=1bSADCzf;
38:     while (SADVz>t) then
39:     Combining the most similar equivalence classes to the quasi-identifier data;
40:   end
41: end
42: Generalizing data and outputting anonymous multi-dimensional data;