Recognition is a procedure, not an instinct
People who are good at this look like they are pattern-matching against problems they have seen. Mostly they are running a short procedure, quickly.
The procedure has three steps and one honest exit:
- Write the brute-force recurrence. Check whether optimal solutions decompose into optimal sub-solutions.
- Count the distinct states the recurrence reaches. Polynomial means dynamic programming applies.
- Try to prove a greedy choice. Success is a large speedup; failure costs you a few minutes and usually hands you a counterexample.
- If step 1 or step 2 fails, stop pretending. The problem may be intractable, and the useful question becomes which compromise to make.
What follows works through each step on real problems, then finishes with the cases where the textbook algorithm is not merely the best known but provably close to the best possible.

