Rule #1 of Good Algorithm Design: If you already have a good subroutine to solve the problem, use it!
Rule #2 of Good Algorithm Design: Divide-and-Conquer!
Rule #3 of Good Algorithm Design: Keep complex information organized in a good data structure.
Rule #4 of Good Algorithm Design: Be greedy.