A lazy greedy solver to satisfy a set of constraints