0% found this document useful (0 votes)
20 views

Lesson 3: Algorithm Design Techniques

This document outlines different algorithm design techniques including divide-and-conquer algorithms which break problems into smaller subproblems, dynamic programming which systematically records answers to subproblems, greedy algorithms which select locally optimal solutions at each step, backtracking which uses exhaustive search and pruning, and local search/randomized algorithms which use random decisions to find optimal solutions. Examples of each technique and common algorithms that apply them are provided.

Uploaded by

Kai Gualdaquever
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Lesson 3: Algorithm Design Techniques

This document outlines different algorithm design techniques including divide-and-conquer algorithms which break problems into smaller subproblems, dynamic programming which systematically records answers to subproblems, greedy algorithms which select locally optimal solutions at each step, backtracking which uses exhaustive search and pruning, and local search/randomized algorithms which use random decisions to find optimal solutions. Examples of each technique and common algorithms that apply them are provided.

Uploaded by

Kai Gualdaquever
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Lesson 3

Algorithm Design Techniques

Outline

Why and How?


Divide-and-Conquer Algorithms
Dynamic Programming
Greedy Algorithms
Backtracking
Local Search Algorithms / Random
Algorithms

Why and How?


TECHNIQUES: Help you devise
algorithms
Approaches to SOLVING problems.
NOTE: Not all techniques provide
OPTIMUM Solutions for different
types of problems.
Eg. A greedy algorithm does not
always solve an APSP Problem.

Divide-and-Conquer Algorithms
Most widely applicable
Break down the n-sized problem into
smaller problems in such a way that
the solutions of the smaller problems
can form the solution to the bigger
problem.
Eg.
Multiplying Long Integers
Modularization

Divide-and-Conquer Algorithms
Applications
Closest-points problems
Selection problems
Multiplying long integers
Matrix multiplication
Constructing tennis tournaments / hierarchy scheduling
Towers of Hanoi

Algorithms
Mergesort
Quicksort
Binary Search Trees

Dynamic Programming
An approach of rewriting the
recursive algorithm as a nonrecursive algorithms that
systematically records the answers
to the subproblems in a table.
Comes from CONTROL Theory

Dynamic Programming
Applications
Ordering Matrix Multiplications
Optimal BST
APSP
Triangulation Problems
Knapsack Problems

Algorithms
Floyds Algorithm

Greedy Algorithms
Select the Locally Optimal solution
at that time, without regard for
future consequence.
take what you can get now
At the end of the algorithm, we hope
that the LOCAL Optimum is
equivalent to the GLOBAL Optimum
Unfortunately, this isnt always true for
all problems

Greedy Algorithms
Applications
Scheduling problems
Huffman codes
Greedy Algorithm as Heuristics to Travelling
Salesman (Shortest Paths)
Coin-changing program

Algorithms
Dijkstras (SPSP)
Prims (Minimum cost spanning tree)
Kruskals (Minimum cost spanning tree)

Backtracking
A systematic, exhaustive search
technique that attempts to consider
all possible solutions.
Optimized by alpha-beta pruning
which reduces the search
substantially

Backtracking
Applications
Game AI: Checkers, Chess, Tic-tac-toe

Algorithms
DFS
Game AI Algorithms, Decision
Algorithms

Local Search Algorithms /


Randomized Algorithms
At least once in the algorithm, a
RANDOM number is used to make a
decision.
Based on the random solution, an
optimal solution is taken.

Randomized Algorithms
Dice rolls
Quicksort
Pogo sort

You might also like