An Efficient Clustering Algorithm Using Stochastic Association Model and Its Implementation Using Nanostructures