K-Means Clustering Algorithm – C & Python Implementation

Implemented the K-Means clustering algorithm in C for performance optimization, with Python scripts for testing, visualization, and data handling.

Technologies Used

CPythonMake

Overview This project provides a high-performance implementation of the K-Means clustering algorithm in C, complemented by Python scripts for testing and visualization. Designed as an educational and algorithm-focused project, it explores both computational efficiency and ease of use by bridging low-level execution with high-level data science tooling.

Key Features

  • C-based core implementation of K-Means clustering for fast execution

  • Python support for dataset preparation, evaluation, and result visualization

  • Makefile included for efficient compilation and reproducibility

  • Supports clustering of 2D/ND data points using Euclidean distance

  • Modular structure enabling experimentation with different initializations and iterations

Educational Purpose This project is designed to deepen understanding of unsupervised learning algorithms by manually implementing them at a low level. It provides clarity into how K-Means works internally, including centroid initialization, distance calculations, and convergence checks. Additionally, it serves as a resource for comparing algorithm performance between C and Python.