NP-Complete Theory
http:/www.seas.gwu.edu/~ayoussef/cs212/npcomplete.html
P-Complete Theory I. Introduction II. Definition of P III. Focus on Yes- o Problems IV. Reductions and Transforms V. P-Complet
The Greedy Method
http:/www.seas.gwu.edu/~ayoussef/cs212/greedy.html
1. 2. 3. 4. 5. 6.
Greedy Template First Application: Selection Sort Second Application: Optimal Merge Patterns Third Application: T
Divide and Conquer
I. Template for Divide and Conguer
II. First Application: Mergesort
III. Second Application: Quicksort
IV. First Application: Order Statistics
I. Template for Divide and Conquer
div
NP-Complete Theory
I. Introduction
II. Definition of NP
III. Focus on Yes-No Problems
IV. Reductions and Transforms
V. NP-Completeness
I. Introduction
0 A problem is said to be polynomial if there e
The Greedy Method
1. Greedy Template
2. First Application: Selection Sort
& Second Application: Optimal Merge Patterns
4. Third Application: The Knapsack Problem
5. Fourth Application: Minimum Spannin
Branch and Bound
I. Introduction
II. Illustration on the |ob Assignment
Problem
III. The General Branch and Bound
Algorithm
IV. Criteria for the Choice of
Approximate Cost Functions
V. Implementation
Backtracking
I. Introduction
II. Formulation of the Problem of
Generating Combinatorial Objects
III. The General Backtracking
Algorithm
IV. Implementations for the Eight
Applications
I. Introduction
0
Dynamic Programming
L l. Perspective
2 ll. Principle of Optimality
& Ill. Steps of Dynamic Programming
4. First Application: The Matrix Chain Problem
5 Second Application: The All-Pairs Shortest Path
Graph Search Techniques
I. Introduction
II. Tree Traversal Techniques
III. Depth-First Search
IV. Breadth-First Search
V. Biconnectivity: A Major
Application of DFS
I. Introduction
0 A graph search (o
8.
Data Structures
What is a data structure?
0 An organization of a data set
0 Several operations to be performed on the data set
The general problem of data structure design
0 Input: a data set and s
Graph Search Techniques
http:/www.seas.gwu.edu/~ayoussef/cs212/graphsearch.html
Graph Search Techniques I. Introduction II. Tree Traversal Techniques III. Depth-First Search IV. Breadth-First Search V
Divide and Conquer
http:/www.seas.gwu.edu/~ayoussef/cs212/divide-and-conquer.html
I. Template for Divide and Conquer II. First Application: Mergesort III. Second Application: Quicksort IV. First Appli
Backtracking
Examples:
Maze problem
Finish
Start
The bicycle lock problem:
Consider a lock with N switches, each of which can be either 0 or 1. We know that the combination that opens the lock
N s
Branch and Bound
Definitions:
Similar to backtracking technique BFS-like search for solutions Uses a search tree E-node Live-node Solution-node Dead-node
Requirements
Branching: A set of solution
Priority Queue: Heap Structures
F Definition: max-heap (min-heap) is a complete BT with the property A that the value (priority) of each node is at least as large (small) as the values at its children
Divide & Conquer
Introduction: It is primarily a recursive method. The divide-and-conquer strategy consists: in breaking a problem into simpler subproblems of the same type, next to solve these subpro
Dynamic Programming
Objective:
Dynamic programming is applied to optimization
problems.
Comparison
Divide-and-conquer algorithms partition the problem
into independent sub problems.
Greedy method
Graph Search Techniques
1- Tree search: Inorder (L N R) Preorder (N L R) Postorder (L N R).
2- Graph search: Given a graph G. Depth-first-search DFS (v) Begin Visited (v) =1; For every node w adjacent
Greedy Method
Objective: General approach:
Given a set of n inputs. Find a subset, called feasible solution, of the n
inputs subject to some constraints, and satisfying a given objective function. If
Np-complete
Introduction:
There are two types of problems:
Problems whose time complexity is polynomial: O(logn), O(n), O(nlogn), O(n 2), O(n 3) Examples: searching, sorting, merging, MST, etc. Pro
Backtracking
http:/www.seas.gwu.edu/~ayoussef/cs212/backtracking.html
Backtracking I. Introduction II. Formulation of the Problem of Generating Combinatorial Objects III. The General Backtracking Algo
Branch and Bound
http:/www.seas.gwu.edu/~ayoussef/cs212/branchandbound.html
Branch and Bound I. Introduction II. Illustration on the Job Assignment Problem III. The General Branch and Bound Algorithm
CS 212 Design and Analysis of Algorithms
http:/www.seas.gwu.edu/~ayoussef/cs212/
CS 212 Design and Analysis of Algorithms
Summary
Design and analysis of algorithms using six algorithmic design techniq
$FILE
http:/www.seas.gwu.edu/~ayoussef/cs212/datastructures.html
Data Structures
1. What is a data structure? An organization of a data set Several operations to be performed on the data set 2. The ge
INTRODUCTION
Objective: Algorithms Techniques Analysis.
Algorithms: Definition: An algorithm is a sequence of computational steps that take some value, or set of values, as input and produce some valu