added euclidean distance function
calculate best radius by internal groups