clustering for other 2 algorithms