COURSE OBJECTIVE
Upon completion of this course, students will be able to do the
following:
1.Analyze the asymptotic performance of algorithms.
2.Demonstrate a familiarity with major algorithms and data
structures.
3.Apply important algorithmic design paradigms and methods of
analysis.
4.Synthesize efficient algorithms in common engineering design
situations.
What is Algorithm?
Algorithm
1.is any well-defined computational procedure that takes some
value, or set of values, as input and produces some value, or set of
values, as output.
2.is thus a sequence of computational steps that transform the
input into the output.
3.is a tool for solving a well - specified computational problem.
4.Any special method of solving a certain kind of problem (Webster
Dictionary)
What is a program?
A program is the expression of an algorithm in a
programming language
a set of instructions which the computer will follow to
solve a problem
Methods in Analysis Design Algo.
Learn general approaches to algorithm design
1.
Divide and conquer
2.
Greedy method
3.
Dynamic Programming
4.
Backtracking
5.
Branch & Bound
6.
Parallel Algorithm
7.
Basic Search and Traversal Technique
Some Application
Study problems these techniques can be applied to
Sorting
Data retrieval
Network routing
Games
Etc
Why do we analyze about them?
understand their behavior, and (Job -- Selection,
performance, modify)
improve them. (Research)
What do we analyze about them?
Correctness
Amount of work done
Amount of space used
Simplicity, clarity
Optimality
Complexity
The complexity of an algorithm is simply the amount of
work the algorithm performs to complete its task.
1. Divide and Conquer
1. Divide to sub-problems
2.
Solve the sub-problems
3.
Conquer the solutions
Topics Covered in Divide and Conquer
Technique
Binary Search
Merge Sort
Quick Sort
Binary Search
Merge Sort
Quick Sort
2. Greedy Method for Optimization
Problems
Every two-year-old knows the greedy algorithm.
In order to get what you want, just start grabbing what looks best.
Surprisingly, many important and practical optimization problems
can be solved this way.
Topics Covered in Greedy Strategy
Optimal Merge Pattern
Minimum Spanning Tree
Knapsack Problem
Job Sequencing with Deadlines
Shortest Path Algorithm
Optimal Merge Pattern
Minimum Spanning Tree
Knapsack Problem
Job Sequencing with Deadlines
Shortest Path Algorithm
3. Dynamic Programming
Dynamic programming solves optimization problems by
combining solutions to sub problems
The key is to store the solutions of sub problems to be
reused in the future
Fig:- Finding the shortest path in a graph using optimal substructure; a straight line
indicates a single edge; a wavy line indicates a shortest path between the two
vertices it connects (other nodes on these paths are not shown); the bold line is the
overall shortest path from start to goal.
Topics Covered in Dynamic Programming
0/1 Knapsack Problem
Multi Stage Graph
Reliability Design
Floyd Warshall Algorithm
0/1 Knapsack Problem
Multi Stage Graph
Reliability Design
Cost of a System <=105 3
D1
D2
D3
Cost
30
15
20
Reliabilit
y
0.9
0.8
0.5
Devices
Floyd Warshall Algorithm
4. Backtracking
Backtracking is the procedure whereby, after determining that a
node can lead to nothing but dead nodes, we go back (backtrack)
to the nodes parent and proceed with the search on the next child.
?
start
dead end
dead end
dead end
dead end
dead end
?
success!
Topics Covered in Backtracking
8 Queens Problem
Hamiltonian Cycle
Graph Coloring Problem
8 Queens Problem
Hamiltonian Cycle
Graph Coloring Problem
5. Branch & Bound
The branch-and-bound design strategy is very similar to
backtracking in that a state space tree is used to solve a
problem.
An enhancement of backtracking
Applicable to optimization problems
Topics Covered in Branch & Bound
Traveling Salesmen Problem
6. Parallel Algorithm
Parallel computing is a technique in which given problem is
subdivided into many sub problems, so that each processor
can work on a sub problems; and solutions from all the
processors are collected together to form a final solution.
The algorithm required by multiple processors to solve the
sub problems simultaneously is called parallel algorithm
7. Basic Search and Traversal Technique
Binary Search Tree
Height balanced Trees
2-3 Trees
B Trees
Tree Traversal Techniques
Graph Traversal Techniques
Binary Search Tree
Height balanced Trees
2-3 Trees
B Trees
Tree Traversal Techniques
Graph Traversal Techniques
Breadth First Search-11,12,18,13,14,15,16,17
Depth First Search- 11,12,14,18,15,16,13,17