6
1 Algorithm Design Techniques • Greedy algorithms • Divide and conquer • Dynamic programming • Randomized algorithms • Backtracking

1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

  • View
    217

  • Download
    2

Embed Size (px)

Citation preview

Page 1: 1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

1

Algorithm Design Techniques

• Greedy algorithms

• Divide and conquer

• Dynamic programming

• Randomized algorithms

• Backtracking

Page 2: 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

Page 3: 1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

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

Page 4: 1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

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

Page 5: 1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

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

Page 6: 1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking

6

Algorithm Design Techniques

Backtracking

• Clever implementation of exhaustive search

• Undo certain steps (backtrack) and try other alternatives

• Game strategy, planning and scheduling problems