adding clustering greedy algorithm