MST based clustering algorithm