To improve the localization performance of the WKNN location fingerprinting algorithm when the indoor environment is complex
an improved WKNN location fingerprinting algorithm—Discrete Degree Weighted K-Nearest Neighbor (DD-WKNN) is proposed
which takes the dispersion of location fingerprints as the weight reference. The K-means clustering algorithm is used to cluster the location fingerprints when the offline location fingerprint database is established
which reduces the computational complexity of searching the location fingerprint database. K location fingerprints which are most similar to online measured RSSIs are selected from the offline location fingerprint database
and the discrepancy degrees are compared. A higher weighting coefficient is assigned to the position fingerprint with a small degree of dispersion
which reduces the error of position estimation caused by the original WKNN algorithm when the signal strength of the indoor environment changes greatly with distance. The analysis of the time complexity of DD-WKNN algorithm shows that its computational complexity is less than that of the original WKNN algorithm. The experimental results show that the DD-WKNN algorithm has a higher positioning accuracy and the positioning error fluctuates less.