I am afraid that there might be a situation for which the “greedy choice property” might not hold.
For any problem, I can only check for small data-sets. What if, for large data-sets, the property fails?
Can we ever be sure?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A probably more theoretical way is the proof that your problem has a Matroid structure. If you can proof that your problem has such a structure, there is a greedy algorithm to solve it.
According to the classical book “Introduction to Algorithms” a matroid a is an ordered pair M = (S,l) with:
Often there is also a weight function w that assigns each element x in S, a weight.
If you can formulate your function as weighted matroid that the following Python-like pseudocode solves your problem: