Skip to main content
Log in

Quantum k-means algorithm based on Manhattan distance

  • Published:
Quantum Information Processing Aims and scope Submit manuscript

Abstract

Traditional k-means algorithm measures the Euclidean distance between any two data points, but it is not applicable in many scenarios, such as the path information between two cities, or when there are some obstacles between two data points. To solve the problems, we propose a quantum k-means algorithm based on Manhattan distance (QKMM). The main two steps of the QKMM algorithm are calculating the distance between each training vector and k cluster centroids, and choosing the closest cluster centroid. The quantum circuit is designed, and the time complexity is \(O(\log (Nd) + 2n +\sqrt{k})\), where N is number of training vectors, d is number of features for each training vector, n is number of bits for each feature, and k is the number of clustering classes. Different from other quantum k-means algorithms, our algorithm has wide applications and reduces the complexity. Compared with classical k-means algorithm, our algorithm reaches quadratic speedup.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Fig. 1
Fig. 2
Fig. 3
Fig. 4

Similar content being viewed by others

References

  1. Sheng, Y.B., Zhou, L.: Distributed secure quantum machine learning. Sci. Bull. 62(14), 1025–1029 (2017)

    Article  Google Scholar 

  2. Shaikh, T.A., Ali, R.: Quantum computing in big data analytics: a survey. In 2016 IEEE international conference on computer and information technology (CIT), pages 112-115. IEEE (2016)

  3. Wang, S.H., Long, G.L.: Big data and quantum computation. Chin. Sci. Bull. 60, 499–508 (2015)

    Article  Google Scholar 

  4. Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum algorithms for supervised and unsupervised machine learning. arXiv preprint arXiv:1307.0411 (2013)

  5. Kerenidis, I., Landman, J., Luongo, A., Prakash, A: q-means: a quantum algorithm for unsupervised machine learning. arXiv preprint arXiv:1812.03584 (2018)

  6. Lloyd, S., Mohseni, M., Rebentrost, P.: Quantum principal component analysis. Nat. Phys. 10(9), 631–633 (2014)

    Article  Google Scholar 

  7. Chao-Hua, Y., Gao, F., Wang, Q.L., Wen, Q.Y.: Quantum algorithm for association rules mining. Phys. Rev. A 94(4), 042311 (2016)

    Article  ADS  Google Scholar 

  8. Aïmeur, E., Brassard, G., Gambs, S.: Quantum speed-up for unsupervised learning. Mach. Learn. 90(2), 261–287 (2013)

    Article  MathSciNet  Google Scholar 

  9. Aïmeur, E., Brassard, G., Gambs, S.: Quantum clustering algorithms. In: Proceedings of the 24th international conference on machine learning, pages 1-8 (2007)

  10. Arora, P., Varshney, S., et al.: Analysis of k-means and k-medoids algorithm for big data. Proc. Comput. Sci. 78, 507–512 (2016)

    Article  Google Scholar 

  11. Comaniciu, D., Meer, P.: Mean shift analysis and applications. In: Proceedings of the Seventh IEEE International Conference on Computer Vision, volume 2, pages 1197-1203. IEEE (1999)

  12. Ester, M., Kriegel, H.P., Sander, J., Xiaowei, X., et al.: A density-based algorithm for discovering clusters in large spatial databases with noise. In Kdd 96, 226–231 (1996)

  13. He, X., Cai, D., Shao, Y., Bao, H., Han, J.: Laplacian regularized gaussian mixture model for data clustering. IEEE Trans. Knowl. Data Eng. 23(9), 1406–1418 (2010)

    Article  Google Scholar 

  14. Whelan, C., Harrell, G., Wang, J.: Understanding the k-medians problem. In: Proceedings of the International Conference on Scientific Computing (CSC), page 219 (2015) )

  15. Kopczyk, D.: Quantum machine learning for data scientists. arXiv preprint arXiv:1804.10068 (2018)

  16. Likas, A., Vlassis, N., Verbeek, J.J.: The global k-means clustering algorithm. Pattern Recognit 36(2), 451–461 (2003)

    Article  ADS  Google Scholar 

  17. Montanaro, A.: Quantum algorithms: an overview. npj Quant. Inf. 2(1), 1–8 (2016)

    Google Scholar 

  18. Singh, A., Yadav, A., Rana, A.: K-means with three different distance metrics. Int. J. Comput. Appl. 67(10) (2013)

  19. Kapil, S., Chawla, M.: Performance evaluation of k-means clustering algorithm with various distance metrics. In: 2016 IEEE 1st International Conference on Power Electronics, Intelligent Control and Energy Systems (ICPEICES), pages 1-4 (2016)

  20. Gultom, S., Sriadhi, S., Martiano, M., Simarmata, J.: Comparison analysis of k-means and k-medoid with ecluidience distance algorithm, chanberra distance, and chebyshev distance for big data clustering. In IOP Conf. Ser., Mater. Sci. Eng., volume 420 (2018)

  21. Sahu, L., Mohan, B.R.: An improved k-means algorithm using modified cosine distance measure for document clustering using mahout with hadoop. In 2014 9th International Conference on Industrial and Information Systems (ICIIS), pages 1–5. IEEE (2014)

  22. Rodgers, J.L., Nicewander, W.A.: Thirteen ways to look at the correlation coefficient. Am. Stat. 42(1), 59–66 (1988)

    Article  Google Scholar 

  23. Nakahara, M., Ohmi, T.: Quantum Computing : From Linear Algebra to Physical Realizations. CRC Press, Boca Raton (2008)

    Book  Google Scholar 

  24. Greche, L., Jazouli, M., Es-Sbai, N., Majda, A., Zarghili, A.: Comparison between euclidean and manhattan distance measure for facial expressions classification. In: 2017 international conference on wireless technologies, embedded and intelligent systems (WITS), pages 1-4. IEEE (2017)

  25. Pandit, S., Gupta, S., et al.: A comparative study on distance measuring approaches for clustering. Int. J. Res. Comput. Sci. 2(1), 29–31 (2011)

    Article  Google Scholar 

  26. Grover, L.K.: A fast quantum mechanical algorithm for database search. In: Proceedings, 28th Annual ACM Symposium on the Theory of Computing (STOC), pages 212-219 (1996)

  27. Blatt, R., Roos, C.F.: Quantum simulations with trapped ions. Nat. Phys. 8(4), 277–284 (2012)

    Article  Google Scholar 

  28. Bruzewicz, C.D., et al.: Trapped-ion quantum computing: progress and challenges. Appl. Phys. Rev. 6(2), 021314 (2019)

    Article  ADS  Google Scholar 

  29. Huang, H.L., et al.: Superconducting quantum computing: a review. Sci. China Inf. Sci. 63(8), 1–32 (2020)

    Article  ADS  MathSciNet  Google Scholar 

  30. Harrow, A.W., Hassidim, A., Lloyd, S.: Quantum algorithm for linear systems of equations. Phys. Rev. Lett. 103(15), 150502–150502 (2009)

    Article  ADS  MathSciNet  Google Scholar 

  31. Buhrman, H., Cleve, R., Watrous, J., De Wolf, R.: Quantum fingerprinting. Phys. Rev. Lett. 87(16), 167902 (2001)

    Article  ADS  Google Scholar 

  32. Rebentrost, P., Mohseni, M., Lloyd, S.: Quantum support vector machine for big data classification. Phys. Rev. Lett. 113(13), 130503 (2014)

    Article  ADS  Google Scholar 

  33. Kerenidis, I., Landman, J.: Quantum spectral clustering. arXiv preprint arXiv:2007.00280 (2020)

  34. Wiebe, N., Kapoor, A., Svore, K.M.: Quantum nearest-neighbor algorithms for machine learning. Quantum Inf. Comput. 15, 318–358 (2018)

    Google Scholar 

  35. Ruan, Y., Xue, X., Liu, H., Tan, J., Li, X.: Quantum algorithm for k-nearest neighbors classification based on the metric of hamming distance. Int. J. Theor. Phys. 56(11), 3496–3507 (2017)

    Article  MathSciNet  Google Scholar 

  36. Nielsen, M.A., Chuang, I.: Quantum computation and quantum information. Cambridge University Press, Cambridge (2002)

    MATH  Google Scholar 

  37. Yang, N.: Knn algorithm simulation based on quantum information. In: Proc. Research Day Conf. (2019)

  38. Aïmeur, E., Brassard, G., Gambs, S.: Machine learning in a quantum world. In: Conference of the Canadian Society for Computational Studies of Intelligence, pages 431–442. Springer (2006)

  39. Zhang, G., Zhang, C., Zhang, H.: Improved k-means algorithm based on density canopy. Knowl Based Syst 145, 289–297 (2018)

    Article  Google Scholar 

  40. Long, G.L.: Grover algorithm with zero theoretical failure rate. Phys. Rev. A 64(2), 022307 (2001)

    Article  ADS  Google Scholar 

  41. Christoph D., Peter H.: A quantum algorithm for finding the minimum. arXiv preprintarXiv:9607014 [quant-ph] (1996)

  42. Kerenidis, I., Prakash, A.: Quantum recommendation systems. arXiv preprint arXiv:1603.08675 (2016)

  43. Giovannetti, V., Lloyd, S., Maccone, L.: Architectures for a quantum random access memory. Phys. Rev. A 78(5), 52310 (2008)

    Article  ADS  Google Scholar 

  44. Kaye, P.: Reversible addition circuit using one ancillary bit with application to quantum computing. arXiv preprint arXiv:quant-ph/0408173 (2004)

  45. Boyer, M., Brassard, G., Høyer, P., Tapp, A.: Tight bounds on quantum searching. Fortschritte der Physik: Progress of Physics 46(4–5), 493–505 (1998)

    Article  Google Scholar 

  46. Shyr-Shen, Y., Chu, S.W., Wang, C.M., Chan, Y.K., Chang, T.C.: Two improved k-means algorithms. Appl. Soft Comput. 68, 747–755 (2018)

    Article  Google Scholar 

  47. Xuejuan, L., Jiabin, Y., Juan, X., Bojia, D.: Quantum k-means algorithm(in chinese). J. Jilin Univ. (Engineering Edition) (2018)

  48. Brassard, G., Hoyer, P., Mosca, M., Tapp, A.: Quantum amplitude amplification and estimation. Contemp. Math. 305, 53–74 (2002)

    Article  MathSciNet  Google Scholar 

Download references

Acknowledgements

This work is supported by the Fundamental Research Funds for the Central Universities (No. 21620433) and Guangxi Key Laboratory of Cryptography and Information Security (No. GCIS201922).

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Tingting Song.

Additional information

Publisher's Note

Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Rights and permissions

Reprints and permissions

About this article

Check for updates. Verify currency and authenticity via CrossMark

Cite this article

Wu, Z., Song, T. & Zhang, Y. Quantum k-means algorithm based on Manhattan distance. Quantum Inf Process 21, 19 (2022). https://doi.org/10.1007/s11128-021-03384-7

Download citation

  • Received:

  • Accepted:

  • Published:

  • DOI: https://doi.org/10.1007/s11128-021-03384-7

Keywords

Navigation