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

Design & Analysis of Algorithms - Topic 1 - Introduction to Course

The document outlines the course 'Design & Analysis of Algorithms' (CS-3520) taught by Sulaman Ahmad Naz, detailing course particulars, rules, objectives, expected results, teaching methodology, and grading scheme. It emphasizes the importance of algorithm design and analysis, including characteristics, correctness testing, and various design techniques. Recommended materials and resources are provided, along with a focus on real-world applications and advanced topics in algorithm study.

Uploaded by

babuurao989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Design & Analysis of Algorithms - Topic 1 - Introduction to Course

The document outlines the course 'Design & Analysis of Algorithms' (CS-3520) taught by Sulaman Ahmad Naz, detailing course particulars, rules, objectives, expected results, teaching methodology, and grading scheme. It emphasizes the importance of algorithm design and analysis, including characteristics, correctness testing, and various design techniques. Recommended materials and resources are provided, along with a focus on real-world applications and advanced topics in algorithm study.

Uploaded by

babuurao989
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 29

DESIGN & ANALYSIS OF

ALGORITHMS

Topic 1
INTRODUCTION to course
INSTRUCTOR: Sulaman
Ahmad Naz
Course particulars
■ Course Title: Design & Analysis of Algorithms

■ Course Code: CS–3520

■ Credit Hours: 3 (3 Th.)


– during summers, we have six hours of teaching per week.

■ Prerequisite:
– Discrete Structures
– Data Structures & Algorithms 2
Class rules and regulations

1. No late arrival. Attendance will close after 5 minutes.


Name will not be repeated once called.
2. No use of cell phones.
3. No cheating in quizzes, tasks, exams etc. (be honest)
4. No extension in deadlines.

3
GENERAL DISCUSSION

1. Education:
1. Knowledge
2. Attitude & Virtues
3. Trust
2. Honesty.
3. Comfort zone is devil
4. Responsibility
5. Helping in Assessments is Enmity
6. Good is the enemy of the best
4
Objectives
■ Design and analysis of modern algorithms
■ Different variants
■ Accuracy
■ Efficiency
■ Comparing efficiencies
■ Motivation for thinking new algorithms
■ Advanced designing techniques
■ Real world problems will be taken as examples
■ To create feelings about usefulness of this course

5
Expected Results

■ On successful completion, students will be able to


– Argue and prove correctness of algorithms
– Derive and solve mathematical models of problems
– Reasoning when an algorithm calls certain approach
– Analyze average and worst-case running times
– Integrating approaches in dynamic and greedy algos.
– Use of graph theory in problems solving
– Advanced topics such as
■ Computational geometry, number theory etc.
– Several other algorithms such as
■ String matching, NP completeness, approximate algorithms etc.
Teaching methodology
Teaching during semester will be based on the
following components:

1. Multimedia lectures
2. White board lectures
3. Group discussions
4. At the spot individual presentations
5. Demonstrations

7
Recommended Material
■ Lecture Slides

■ Introduction to Algorithms by Cormen

■ Introduction to The Design & Analysis of


Algorithms by Anany Levitin

■ Computers and Intractability, Guide to the


Theory of NP-Completeness by Garey and
Johnson 8
All books, Course Outline, Lecture
slides of 1st Week and some important
Google Classroom announcements have already been
uploaded/posted on “google
class-room”.
Please join and visit it regularly.
■Link & Code:
– https://classroom.google.com/u/1/c/
NjE0ODk3ODY2MzMy

–rc3jugz
■All announcements / resources will be
uploaded on Google Classroom only.

9
Tentative Grading Scheme
■ 5 Class Quizzes
(10%)

■ 5 Assignments (20%)

■ 3 Hourly Quizzes (30%)

■ 1 Final Term (40%)

10
Course Contents (As per HEC Curriculum)

Before Mid Term

After Mid Term


UNDERSTANDING THE TITLE
“Design & Analysis of Algorithms”

“ALGORITHMS

What is Algorithm?

■ A computer algorithm is a detailed step-by-step


method for solving a problem by using a computer.
■ An algorithm is a sequence of unambiguous
instructions for solving a problem in a finite
amount of time.
■ An Algorithm is well defined computational
procedure that takes some value, or set of values, as
input and produces some value, or set of values as
output.
Algorithm
■ An algorithm is a sequence of instructions that one must
perform in order to solve a well-formulated problem.

■ A well-formulated problem is unambiguous and precise,


leaving no room for misinterpretation. The number of
steps are always finite.

■ In other words, algorithm is the method of translating


the inputs into the outputs.
6 Characteristics of an Algorithm
Finiteness
■ Algorithms are finite in two aspects:
– Length of Algorithm
– Number of Computational Steps

■ If algorithm is not of finite length, then we do not have


infinite space/memory to save and implement it.
■ If the number of computational steps are not finite,
then it means the problem is not solved at all, as
infinity is undefined.
Popular Algorithms
■Most basic and popular algorithms are
– Sorting algorithms
– Searching algorithms
■Which algorithm is best?
– Mainly, it depends upon various factors, for example
in case of sorting:
■ The number of items to be sorted.
■ The extent to which the items are already sorted.
■ Possible restrictions on the item values.
■ The kind of storage device to be used etc.
Problems vs Algorithms vs
Programs
■ For each problem or class of problems, there may be
many different algorithms.
■ For each algorithm, there may be many different
implementations (programs).
Testing Correctness
■ How do we know whether an algorithm is
actually correct?
■ First, the logical analysis of the
problem we performed in order to
design the algorithm should give us
confidence that we have identified a valid
procedure for finding a solution.
■ Second, we can test the algorithm by
choosing different sets of input
values, carrying out the algorithm, and
checking to see if the resulting solution
does, in fact, work.
Testing Correctness

■ BUT… no matter how much testing


we do, unless there are only a finite
number of possible input values for
the algorithm to consider, testing can
never prove that the algorithm
produces correct results in all cases.
It can just give us a level of
confidence.
Testing Correctness
■ We can attempt to construct a formal,
mathematical proof that, if the algorithm
is given valid input values then the results
obtained from the algorithm must be a
solution to the problem.
■ We should expect that such a proof be
provided for every algorithm.
■ In the absence of such a proof, we should
view the purported algorithm as nothing
more than a heuristic procedure, which
may or may not yield the expected results.
UNDERSTANDING THE TITLE
“Design & Analysis of Algorithms”

“DESIGN”
Algorithm Design Techniques
■ There are many types of algorithm designing techniques,
but the most commonly studied are: Bellman Ford Algorithm
Merge Sort Dijkstra’s Algorithm
1. Recursive Quick Sort
Algorithms 7. Dynamic Programming
Dijkstra’s Algorithm
Bubble Sort
8. Greedy Prims Algorithm
Algorithms
2. Iterative Algorithms
Insertion Sort
Kruskal’s Algorithm
Merge Sort
Quick Sort 9. 2D-Maxima
Brute Force Algorithms
3. Divide & Conquer Algorithms Linear Search
Selection Sort
Bubble Sort 10.Backtracking Algorithms
4. Decrease & Conquer Depth First Search
Counting Sort
Heap Sort 11.Randomized Algorithms
5. Transform & Conquer Genetic Algorithms
Bubble Sort
Insertion Sort 12.Time & Space Trade-off
6. Iterative Improvement Memoization, Tabulation
UNDERSTANDING THE TITLE
“Design & Analysis of Algorithms”

“ANALYSIS”
Problem Solving Phases

■ Analysis
– How does system work?
– Breaking a system down to known components
– How components (processes) relate to each other
– Breaking a process down to known functions
■ Synthesis
– Building tools
– Building functions with supporting tools
– Composing functions to form a process
– How components should be put together?
– Final solution
Problem Solving Process

Verification

Implementat
ion
Analysis
• Correctness
Algorithm • Time & Space
• Input • Optimality
Strategy • Output
• Design • Steps
Problem
Three Types of Analysis
 Correctness
 We already talked about it in today’s lecture.
 Time Complexity
 How many computations are performed by the
algorithm?
 Space Complexity
 How much extra memory is required to perform the
computations of the algorithm?
UNDERSTANDING THE TITLE
“Design & Analysis of Algorithms”

Hope you
understand the
Title now…!!!
End of Lecture

THANK YOU

You might also like