ITERATED GREEDY ALGORITHM. Help!!

Ok guys, i'm really stuck here.I have to write a greedy algorithm to solve the set covering problem.(i.e given a matrix nxn i have to find the best solution, which is a set of columns that covers all the rows). Anyway, istart from the empty solution and then i pick randomly a column. I have two vectors :

__map<int,vector<int> > covers;__ which gives me the rows that are covered by a column.For example covers[0].size() -> number of rows covered by column 0.

__map<int,vector<int> > covered_by;__ which gives me the columns that cover a row in the same way as above.

and __the add_column(int i) __ function

Now, every column has a cost c. The best column to add to the set is te one that has max __#rows(that covers)/cost c__.

What i have to do is in a loop running all the columns add the best ones by the above criterion and make the set but in every step i must subtract from the numerator the #rows that are already covered.

Well, it doesn't seem very difficult but i'm really really stuck>i have tried everything.If anyone has an idea(the loop would be perfect)..please..It's very important.

Thanx