CPP code for K means clustering for wireless sensor networks which are to be applied to optimal path to sink algorithm. The repository contains the optimised approach to WSN sink algorithms .It uses k means which uses an unsupervised machine learning model which provides heuristic advantage over grid based system.The value of k changes the rate of efficiency of the model. Validity of Euler path in the circuit for optimal seek time and movement of head/collector. Scope for further optimisation algorithms.