The greedy method to generate subset D of D is as follows: we iteratively add a problem p from D \ D to D which minimizes the value of f tmpl (p, D ).
the algorithm iteratively chooses problem p from D \ D and adds it to D such that (if possible) p adds a new template to D .