Research Article

[Retracted] A Dynamic Density Peak Clustering Algorithm Based on K-Nearest Neighbor

Algorithm 2

DDPC Algorithm.
Input: Dataset  = ,
Output: Clusters = {, }
//Calculate the local density of each data.
for each data point in do
for each data point in do
  Calculate the distance between and
end for
 Sort the first data according to the distance from small to large:  = 
 Calculate the average distance from each neighbor
end for
The average distance matrix of neighbors of each node (scanning distance) is obtained:  = 
//The adaptive adjustment range is determined according to parameters K//and R.
for each in do
 Calculate the number of neighbors whose average distance is smaller than the node:
ifthen
   is a high-density point:
end if
end for
Int  = 1
//Adaptive clustering
for each in do
If has no cluster label then
  
end if
for each in do
  for each in do
   if the distance between and is less than or then
    If has cluster label then
     Change all ’s cluster labels to
    else
     
    end if
    break
   end if
  end for
end for
++
end for
For the points without cluster label, KNN algorithm is used for clustering