結果 : write an abstract algorithm for greedy design method