View
217
Download
2
Embed Size (px)
Citation preview
1
Algorithm Design Techniques
• Greedy algorithms
• Divide and conquer
• Dynamic programming
• Randomized algorithms
• Backtracking
2
Algorithm Design Techniques
Greedy algorithms• Work in phases
• A decision is made that appears to be good, without regard for future consequences
• Local optimum, but may not be the true optimum
• Heuristic search techniques, memory allocation techniques (best fit, first fit etc.), Dijkstra’s algorithm
3
Algorithm Design Techniques
Divide and conquer• Divide to solve smaller problems recursively
• The solution to the original problem is formed from the solution to the subproblems.
• At least 2 recursive calls in the routine
• In general, if iterative solutions are available, recursive calls may be relatively inefficient
• Tower of Hanoi, mergesort, binary tree sort
4
Algorithm Design Techniques
Dynamic programming
• Non-recursive approach to recursive algorithms
• Solutions at later stage depend on those of the earlier stages, but can be solved iteratively
• Fibonacci series, operations research problems
5
Algorithm Design Techniques
Randomized algorithms
• For modeling problems
• Making use of random numbers to generate representative parameters of the system
• Queuing models, performance prediction
6
Algorithm Design Techniques
Backtracking
• Clever implementation of exhaustive search
• Undo certain steps (backtrack) and try other alternatives
• Game strategy, planning and scheduling problems