I have been refreshing on greedy algorithms as an algorithm design technique. I have read many sources for an explanation of what a greedy algorithm is, because I would like to put together a general greedy algorithm.
When reading these sources, I have gathered all of the important concepts to try to come up with this general algorithm for the greedy selection technique. By "general" I mean that it summarizes the behavior of the technique for all possible problem for who this technique would yield a correct solution.
I would like some input on it. Here is take 1:
Let $f$ be a function from $S$ to any set. The following algorithm tries to perform greedy choices per each search iteration of element of $S$, in order to try come up with the best possible point for $f$ over $S$ given a set of constraints $C$:
Select p0 from S;
i := 1;
Let P be a set of already chosen points from S to be initialized to {}
Let F be the set of values of f for each element of P to be initialize to {};
while S != {}:
Make a greedy choice for p_i based on p_{i - 1};
if f(p_i) is feasible based on constraints from C and has improved:
p_{i - 1} := p_i;
Add f_i := f(p_i) to F;
Remove p_{i - 1} from S and save it in P;
return P, F;
My specific question is: How far is this first take from being a correct generalization of the greedy selection technique for algorithmic design?
This should be fun :)