HCS clustering algorithm