clustering and greedy algorithms