Problem
I am trying to get some standard ways in which I can validate if the problem can be solved with greedy approach. Are there any proof of induction I can do to decide if greedy approach will always produce the best solution?
To prove that an optimization problem can be solved using a greedy algorithm, we need to prove that the problem has the following:
- Optimal substructure property: an optimal global solution contains the optimal solutions of all its subproblems. For this, you have to be able to spot that the problem can be decomposed into sub-problems and that their optimal solution is part of the optimal solution of the whole problem.
- Greedy choice property: a global optimal solution can be obtained by greedily selecting a locally optimal choice.
Furthermore, there’s a powerful mathematical theory that can be in some case used to mechanically prove that a particular problem can be solved with a greedy approach.
Briefly:
- One can define a particular combinatoric structure named matroid.
- Some smart man proved in the past that these matroids have the Optimal substructure property and the Greedy choice property.
- This means that you can run a greedy algorithm on your optimisation problem, and it will find the optimal solution. You only need to verify that your problem is defined on a matroid-like structure.