Given a weighted matroid with positive weights, we can find a independent set with a maximum weight with a greedy algorithm:
- Start with an empty set (by definition of matroid, it is independent).
- Add an element with maximum weight among all elements whose addition keeps the current set independent (if there are no such elements, terminate).
My goal is to found out whether this approach can also work in reverse. My first attempt was:
- Start with a set containing all elements.
- As long as the set is NOT independent, remove the element with minimum weight.
This attempt proved to be false. Here is an example:
There are 8 elements, divided to two groups: A and B. The matroid contains all subsets that have at most two elements of each group. The weights are:
- Group A: 303,302,301,300.
- Group B: 203,202,201,200.
The forward-greedy approach picks 303, 302, 203, 202 - which is optimal. But the reverse-greedy approach removes 200,201,202,203,300,301, and leaves only 302,303.
But, I think the following alternative algorithm should work:
- Start with a set containing all elements.
- As long as the set is not independent, remove the element with minimum weight among all elements whose removal leaves a base in the current set.
So, in the above example, this algorithm removes 200 and 201, but does not remove 202 and 203 (since then no base will remain), then removes 300 and 301, and stops with the maximum-weight independent set.
I am not sure about the complexity of this algorithm. Particularly, how much time does it take to calculate whether the current set (after removing an element) contains a base?