The.Algorithm.Design.Manual.Springer-Verlag.1998
The.Algorithm.Design.Manual.Springer-Verlag.1998 The.Algorithm.Design.Manual.Springer-Verlag.1998
How to Design Algorithms 4. Once I know how to solve a certain special case, why can't this be generalized to a wider class of inputs? 5. Is my problem a special case of a more general problem in the catalog? 5. Which of the standard algorithm design paradigms are most relevant to my problem? 1. Is there a set of items that can be sorted by size or some key? Does this sorted order make it easier to find the answer? 2. Is there a way to split the problem in two smaller problems, perhaps by doing a binary search? How about partitioning the elements into big and small, or left and right? Does this suggest a divide-and-conquer algorithm? 3. Do the input objects or desired solution have a natural left-to-right order, such as characters in a string, elements of a permutation, or the leaves of a tree? If so, can I use dynamic programming to exploit this order? 4. Are there certain operations being repeatedly done on the same data, such as searching it for some element, or finding the largest/smallest remaining element? If so, can I use a data structure to speed up these queries? What about a dictionary/hash table or a heap/priority queue? 5. Can I use random sampling to select which object to pick next? What about constructing many random configurations and picking the best one? Can I use some kind of directed randomness like simulated annealing in order to zoom in on the best solution? 6. Can I formulate my problem as a linear program? How about an integer program? 7. Does my problem seem something like satisfiability, the traveling salesman problem, or some other NP-complete problem? If so, might the problem be NP-complete and thus not have an efficient algorithm? Is it in the problem list in the back of Garey and Johnson [GJ79]? 6. Am I still stumped? 1. Am I willing to spend money to hire an expert to tell me what to do? If so, check out the professional consulting services mentioned in Section . 2. Why don't I go back to the beginning and work through these questions again? Did any of my answers change during my latest trip through the list? Problem solving is not a science, but part art and part skill. It is one of the skills most worth developing. My favorite book on problem solving remains Pólya's How to Solve It [Pol57], which features a catalog of problem solving techniques that are fascinating to browse through, both before and after you have a problem. file:///E|/BOOK/BOOK3/NODE124.HTM (4 of 5) [19/1/2003 1:27:48]
How to Design Algorithms Next: Resources Up: Techniques Previous: Implementation Challenges Algorithms Mon Jun 2 23:33:50 EDT 1997 file:///E|/BOOK/BOOK3/NODE124.HTM (5 of 5) [19/1/2003 1:27:48]
- Page 1 and 2: The Algorithm Design Manual Next: P
- Page 3 and 4: Preface Next: Acknowledgments Up: T
- Page 5 and 6: Preface one stressing design over a
- Page 7 and 8: Acknowledgments Mon Jun 2 23:33:50
- Page 9 and 10: Contents Next: Techniques Up: The A
- Page 11 and 12: Contents ■ All-Pairs Shortest Pat
- Page 13 and 14: Contents ■ Graph Problems: Polyno
- Page 15 and 16: Contents ● About this document ..
- Page 17 and 18: The Algorithm Design Manual The Alg
- Page 19 and 20: Lecture Notes -- Analysis of Algori
- Page 21 and 22: Lecture Notes -- Analysis of Algori
- Page 23 and 24: The Stony Brook Algorithm Repositor
- Page 25 and 26: Techniques Next: Introduction to Al
- Page 27 and 28: Techniques Algorithms Mon Jun 2 23:
- Page 29 and 30: Introduction to Algorithms ● Reas
- Page 31 and 32: Data Structures and Sorting divide-
- Page 33 and 34: Breaking Problems Down ● Dynamic
- Page 35 and 36: Graph Algorithms The take-home less
- Page 37 and 38: Combinatorial Search and Heuristic
- Page 39 and 40: Intractable Problems and Approximat
- Page 41 and 42: How to Design Algorithms Next: Reso
- Page 43: How to Design Algorithms with a cou
- Page 47 and 48: A Catalog of Algorithmic Problems N
- Page 49 and 50: A Catalog of Algorithmic Problems
- Page 51 and 52: Algorithmic Resources Next: Softwar
- Page 53 and 54: References L. Adleman. Algorithmic
- Page 55 and 56: References AS89 Ata83 Ata84 problem
- Page 57 and 58: References BJL 91 A. Blum, T. Jiang
- Page 59 and 60: References BS81 BS86 BS93 BS96 BS97
- Page 61 and 62: References J. M. Chambers. Partial
- Page 63 and 64: References CT80 CT92 1971. G. Carpa
- Page 65 and 66: References K. Daniels and V. Milenk
- Page 67 and 68: References (FOCS), pages 60-69, 199
- Page 69 and 70: References FM71 M. Fischer and A. M
- Page 71 and 72: References History of Computing, 7:
- Page 73 and 74: References N. Gibbs, W. Poole, and
- Page 75 and 76: References Hof82 Hof89 Hol75 C. M.
- Page 77 and 78: References IK75 Ita78 O. Ibarra and
- Page 79 and 80: References Kir83 D. Kirkpatrick. Ef
- Page 81 and 82: References object in 2-dimensional
- Page 83 and 84: References LT79 LT80 8:99-118, 1995
- Page 85 and 86: References Mil97 V. Milenkovic. Dou
- Page 87 and 88: References Theoretical Computer Sci
- Page 89 and 90: References Pav82 T. Pavlidis. Algor
- Page 91 and 92: References Rei72 Rei91 Rei94 E. Rei
- Page 93 and 94: References Prentice Hall, Englewood
How to <strong>Design</strong> <strong>Algorithm</strong>s<br />
4. Once I know how to solve a certain special case, why can't this be generalized to a wider<br />
class of inputs?<br />
5. Is my problem a special case of a more general problem in the catalog?<br />
5. Which of the standard algorithm design paradigms are most relevant to my problem?<br />
1. Is there a set of items that can be sorted by size or some key? Does this sorted order make<br />
it easier to find the answer?<br />
2. Is there a way to split the problem in two smaller problems, perhaps by doing a binary<br />
search? How about partitioning the elements into big and small, or left and right? Does this<br />
suggest a divide-and-conquer algorithm?<br />
3. Do the input objects or desired solution have a natural left-to-right order, such as<br />
characters in a string, elements of a permutation, or the leaves of a tree? If so, can I use<br />
dynamic programming to exploit this order?<br />
4. Are there certain operations being repeatedly done on the same data, such as searching it<br />
for some element, or finding the largest/smallest remaining element? If so, can I use a data<br />
structure to speed up these queries? What about a dictionary/hash table or a heap/priority<br />
queue?<br />
5. Can I use random sampling to select which object to pick next? What about constructing<br />
many random configurations and picking the best one? Can I use some kind of directed<br />
randomness like simulated annealing in order to zoom in on the best solution?<br />
6. Can I formulate my problem as a linear program? How about an integer program?<br />
7. Does my problem seem something like satisfiability, the traveling salesman problem, or<br />
some other NP-complete problem? If so, might the problem be NP-complete and thus not<br />
have an efficient algorithm? Is it in the problem list in the back of Garey and Johnson<br />
[GJ79]?<br />
6. Am I still stumped?<br />
1. Am I willing to spend money to hire an expert to tell me what to do? If so, check out the<br />
professional consulting services mentioned in Section .<br />
2. Why don't I go back to the beginning and work through these questions again? Did any of<br />
my answers change during my latest trip through the list?<br />
Problem solving is not a science, but part art and part skill. It is one of the skills most worth developing.<br />
My favorite book on problem solving remains Pólya's How to Solve It [Pol57], which features a catalog<br />
of problem solving techniques that are fascinating to browse through, both before and after you have a<br />
problem.<br />
file:///E|/BOOK/BOOK3/NODE124.HTM (4 of 5) [19/1/2003 1:27:48]