SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
DESIGN AND ANALYSIS OF
ALGORITHMS
Dr. G.Geetha Mohan
Professor
Department of Computer Science and Engineering,
Jerusalem College of Engineering,
Chennai-600100
1/23/2019 1
Outline
 Notion of an Algorithm
 Fundamentals of Algorithmic Problem
Solving
 Important ProblemTypes
1/23/2019 2
What is a Computer Algorithm?
A sequence of unambiguous instructions
for solving a problem
For obtaining a required output for any
legitimate input in a finite amount of time
1/23/2019 3
Computer Algorithm Vs Program
 Computer algorithm
A detailed step-by-step method for
solving a problem using a computer
 Program
An implementation of one or more
algorithms.
1/23/2019 4
Find Greatest Common Divisor of
Two Nonnegative
1. Euclid’s algorithm
gcd(m n) = gcd(n, m mod n)
gcd(60, 24) = gcd(24, 12) = gcd(12, 0) = 12.
2. Consecutive integer checking
algorithm
 For numbers 60 and 24, the algorithm will
try first 24, then 23, and so on, until it
reaches 12, where it stops.
1/23/2019 5
Find Greatest Common Divisor of
Two Nonnegative
 Middle-school procedure
for the numbers 60 and 24, we get
60 = 2 . 2 . 3 . 5
24 = 2 . 2 . 2 . 3
gcd(60, 24) = 2 . 2 . 3 = 12.
1/23/2019 6
Notion of algorithm
1/23/2019 7
Problem
Algorithm
ComputerInput Output
Notion of algorithm
 Non-ambiguity requirement for each step of an
algorithm
 Range of inputs for which an algorithm works has
to be specified
 Same algorithm can be represented in several
different ways.
 Exist several algorithms for solving the same
problem.
 Algorithms for the same problem can be based on
very different ideas and can solve the problem
with dramatically different speeds.
1/23/2019 8
Understand the problem
Decide on: Computational means
Exact vs Approximate solution
Algorithm design technique
Design an algorithm
Data structures
Prove correctness
Analyze the algorithm
Code the algorithm
Algorithm Design And Analysis Process
1/23/2019 9
1.Understand the problem
 Understand completely the problem
given
 Input
 Output
 An input to an algorithm specifies an
instance of the problem the algorithm
solves.
1/23/2019 10
2.1 Ascertaining the Capabilities of
the Computational Device
 Sequential Algorithms
Instructions are executed one after another,
one operation at a time.
Random-access Machine (RAM)
 Parallel Algorithms
Execute operations concurrently( parallel)
1/23/2019 11
2.2 Choosing between Exact and
Approximate Problem Solving
 Exact algorithm
 Approximation algorithm
 Extracting square roots,
 Solving nonlinear equations,
 Evaluating definite integrals
1/23/2019 12
2.3 Algorithm Design Technique
 An algorithm design technique
(“strategy” or “paradigm”)
General approach to solving problems
algorithmically that is applicable to a variety
of problems from different areas of
computing.
 Algorithm design techniques make it
possible to classify algorithms according to
an underlying design idea
1/23/2019 13
3.Designing an Algorithm and Data
Structures
 Several techniques need to be combined,
 Hard to pinpoint as applications of the
known design techniques
 Algorithms+ data structures = programs
 Object-oriented programming
Data structures remain crucially
important for both design and analysis of
algorithms.
1/23/2019 14
Methods of Specifying an Algorithm
 Pseudo code
A mixture of a natural language and
programming language
 Flowchart
A method of expressing an algorithm by a
collection of connected geometric shapes
containing descriptions of the algorithm’s
steps.
 Programs
Another way of specifying the algorithm
1/23/2019 15
4.Prove Correctness
To prove that the algorithm yields a
required result for every legitimate input in
a finite amount of time
 A common technique for proving correctness is to use
mathematical induction
 Tracing the algorithm’s performance for a few specific
inputs to show that an algorithm is incorrect
The notion of correctness for
 Exact algorithms -straight forward
 Approximation algorithms- less straight forward
to be able to show that the error produced by the
algorithm does not exceed a predefined limit.
1/23/2019 16
5.Analyze the Algorithm
 Efficiency
 Time efficiency,
How fast the algorithm runs,
 Space efficiency,
How much extra memory it uses.
Simplicity
Easier to understand and easier to program
Generality
Issues - Algorithm solves
Set of inputs it accepts
1/23/2019 17
6. Code the Algorithm
 Programming an algorithm
both a peril and an opportunity.
 Test and debug program thoroughly
whenever implement an algorithm.
 Implementing an algorithm correctly is
necessary but not sufficient
 An analysis is based on timing the
program on several inputs and then
analyzing the results obtained.
1/23/2019 18
6. Code the Algorithm (cond…)
 Algorithm’s Optimality.
 Not about the efficiency of an algorithm
 About the complexity of the problem it solves
 What is the minimum amount of effort any
algorithm will need to exert to solve the
problem?
 Another important issue of algorithmic problem
solving
 Whether or not every problem can be solved
by an algorithm.
 Not talking about problems that do not have a
solution 1/23/2019 19
Algorithms
 Inventing (or discovering?) Algorithms is
a very creative and rewarding process.
 A good algorithm is a result of repeated
effort and rework
1/23/2019 20
Important Problem Types
 Sorting
 Searching
 String processing
 Graph problems
 Combinatorial problems
 Geometric problems
 Numerical problems
1/23/2019 21
1. Sorting
 Rearrange the items of a given list in non
decreasing order
 Specially chosen piece of information- key
 Used as an auxiliary step in several important
algorithms in other areas
 Geometric Algorithms and Data Compression
 Greedy approach an important algorithm design
technique requires a sorted input.
1/23/2019 22
1. Sorting
Two properties
 Stable
 Preserves the relative order of any two
equal elements in its input.
 In-place
 The amount of extra memory the
algorithm requires
 An algorithm is said to be in-place if it
does not require extra memory
1/23/2019 23
2. Searching
 Deals with finding a given value, called a
search key, in a given set
(or a multiset, which permits several
elements to have the same value)
 Sequential Search or linear Search
 Binary search
1/23/2019 24
2. Searching
 Considered in conjunction with two
other operations:
 Addition to
 Deletion from the data set of an item.
 Data structures and Algorithms should be
chosen to strike a balance among the
requirements of each operation.
1/23/2019 25
3. String processing
 Sequence of characters from an alphabet
 Strings of particular interest are
 Text strings, which comprise letters,
numbers, and special characters;
 Bit strings, which comprise zeros and ones;
 Gene sequences, which can be modeled by
strings of characters from the four-
character alphabet {A,C, G,T}.
1/23/2019
26
String Matching
 Searching for a given word in a text
1/23/2019 27
4. Graph Problems
 Collection of points called vertices,
 Some of which are connected by line
segments called edges.
 Used for modeling a wide variety of
applications
 Transportation,
 Communication,
 Social and Economic networks
 Project scheduling
 Games.
1/23/2019 28
Graph Problems
 Basic graph algorithms
 Graph traversal algorithms
How can one reach all the points in a
network?
 Shortest-path algorithms
What is the best route between two cities?
 Topological sorting for graphs with
directed edges
set of courses with their prerequisites
consistent or self-contradictory?.
1/23/2019 29
Graph Problems
 Traveling Salesman Problem (TSP)
Problem of finding the shortest tour
through n cities that visits every city
exactly once.
 Route Planning
 Circuit board
 VLSI chip fabrication
 X-ray crystallography
 Genetic Engineering
1/23/2019 30
Graph Problems
 Graph-coloring problem
 seeks to assign the smallest number of
colors to the vertices of a graph so that
no two adjacent vertices are the same
color
Event Scheduling:
Events are represented by vertices that are connected
by an edge if and only if the corresponding events
cannot be scheduled at the same time, a solution to the
graph-coloring problem yields an optimal schedule.
1/23/2019 31
5. Combinatorial Problems
 Traveling Salesman Problem and the
Graph Coloring Problem are examples of
combinatorial problems.
 These are problems that ask, explicitly or
implicitly, to find a combinatorial object
such as a permutation, a combination, or a
subset that satisfies certain constraints.
1/23/2019 32
5. Combinatorial Problems
 Issues
 Number of combinatorial objects typically grows
extremely fast with a problem’s size, reaching
unimaginable magnitudes even for moderate-
sized instances.
 There are no known algorithms for solving most
such problems exactly in an acceptable amount
of time.
1/23/2019 33
6.Geometric Algorithms
 Geometric algorithms deal with geometric
objects such as points, lines, and polygons.
 Ancient Greeks -developing procedures
For solving a variety of geometric problems,
 Constructing simple geometric shapes
-triangles, circles
 Computer graphics
 Robotics
 Tomography
1/23/2019 34
6.Geometric Algorithms
 Closest-pair problem
Given n points in the plane, find the closest
pair among them.
 Convex-hull problem
To find the smallest convex polygon that
would include all the points of a given set.
1/23/2019 35
7. Numerical problems
 Problems that involve mathematical
objects of continuous nature
 Solving equations
 Systems of equations,
 Computing definite integrals,
 Evaluating functions
1/23/2019 36
7. Numerical problems
 Mathematical problems can be solved
only approximately
 Problems typically require manipulating
real numbers, which can be represented
in a computer only approximately.
 Large number of arithmetic operations
performed on approximately represented
numbers can lead to an accumulation of
the round-off
1/23/2019 37
Modeling the Real World
 Cast your application in terms of well-studied abstract
data structures
1/23/2019
38
Concrete Abstract
arrangement, tour, ordering, sequence permutation
cluster, collection, committee, group, packaging, selection subsets
hierarchy, ancestor/descendants, taxonomy trees
network, circuit, web, relationship graph
sites, positions, locations points
shapes, regions, boundaries polygons
text, characters, patterns strings
Real-World Applications
 Hardware design: VLSI
chips
 Compilers
 Computer graphics: movies,
video games
 Routing messages in the
Internet
 Searching the Web
 Distributed file sharing
1/23/2019
39
• Computer aided design and
manufacturing
• Security: e-commerce,
voting machines
• Multimedia: CD player, DVD,
MP3, JPG, HDTV
• DNA sequencing, protein
folding
• and many more!
Some Important Problem Types
 Sorting
◦ a set of items
 Searching
◦ among a set of items
 String processing
◦ text, bit strings, gene
sequences
 Graphs
◦ model objects and their
relationships
1/23/2019
40
• Combinatorial
– find desired permutation,
combination or subset
• Geometric
– graphics, imaging,
robotics
• Numerical
– continuous math: solving
equations, evaluating
functions
Algorithm Design Techniques
• Brute Force & Exhaustive
Search
– follow definition / try all
possibilities
• Divide & Conquer
– break problem into
distinct subproblems
• Transformation
– convert problem to
another one
• Dynamic Programming
– break problem into overlapping
sub problems
• Greedy
– repeatedly do what is best now
• Iterative Improvement
– repeatedly improve current
solution
• Randomization
– use random numbers
1/23/2019
41

Contenu connexe

Tendances

DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSGayathri Gaayu
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventionssaranyatdr
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsMohamed Loey
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solvingPrabhakaran V M
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithmsGanesh Solanke
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptxSyed Zaid Irshad
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computingjayavignesh86
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1Amrinder Arora
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithmMohd Arif
 
Lecture optimal binary search tree
Lecture optimal binary search tree Lecture optimal binary search tree
Lecture optimal binary search tree Divya Ks
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notationsNikhil Sharma
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithmRezwan Siam
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back trackingTech_MX
 

Tendances (20)

DESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMSDESIGN AND ANALYSIS OF ALGORITHMS
DESIGN AND ANALYSIS OF ALGORITHMS
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
Algorithm and pseudocode conventions
Algorithm and pseudocode conventionsAlgorithm and pseudocode conventions
Algorithm and pseudocode conventions
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Algorithmic problem solving
Algorithmic problem solvingAlgorithmic problem solving
Algorithmic problem solving
 
Analysis of algorithms
Analysis of algorithmsAnalysis of algorithms
Analysis of algorithms
 
Data Structure and Algorithms.pptx
Data Structure and Algorithms.pptxData Structure and Algorithms.pptx
Data Structure and Algorithms.pptx
 
Lecture 2 role of algorithms in computing
Lecture 2   role of algorithms in computingLecture 2   role of algorithms in computing
Lecture 2 role of algorithms in computing
 
Divide and Conquer - Part 1
Divide and Conquer - Part 1Divide and Conquer - Part 1
Divide and Conquer - Part 1
 
Complexity of Algorithm
Complexity of AlgorithmComplexity of Algorithm
Complexity of Algorithm
 
Dinive conquer algorithm
Dinive conquer algorithmDinive conquer algorithm
Dinive conquer algorithm
 
Unit 2 in daa
Unit 2 in daaUnit 2 in daa
Unit 2 in daa
 
Divide and conquer
Divide and conquerDivide and conquer
Divide and conquer
 
Backtracking
BacktrackingBacktracking
Backtracking
 
Lecture optimal binary search tree
Lecture optimal binary search tree Lecture optimal binary search tree
Lecture optimal binary search tree
 
Asymptotic Notation
Asymptotic NotationAsymptotic Notation
Asymptotic Notation
 
Asymptotic notations
Asymptotic notationsAsymptotic notations
Asymptotic notations
 
Bruteforce algorithm
Bruteforce algorithmBruteforce algorithm
Bruteforce algorithm
 
Divide and Conquer
Divide and ConquerDivide and Conquer
Divide and Conquer
 
8 queens problem using back tracking
8 queens problem using back tracking8 queens problem using back tracking
8 queens problem using back tracking
 

Similaire à Design and analysis of algorithms

Notion of an algorithm
Notion of an algorithmNotion of an algorithm
Notion of an algorithmNisha Soms
 
L01 intro-daa - ppt1
L01 intro-daa - ppt1L01 intro-daa - ppt1
L01 intro-daa - ppt1sankaran L
 
Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01Prashanth Shivakumar
 
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphPrim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphUniversitas Pembangunan Panca Budi
 
Mathematical models and algorithms challenges
Mathematical models and algorithms challengesMathematical models and algorithms challenges
Mathematical models and algorithms challengesijctcm
 
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...IAESIJAI
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdfGOWTHAMR721887
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhanijyoti_lakhani
 
Minimization of Assignment Problems
Minimization of Assignment ProblemsMinimization of Assignment Problems
Minimization of Assignment Problemsijtsrd
 
An approach to solve the N-Queens Problem using Artificial Intelligence algor...
An approach to solve the N-Queens Problem using Artificial Intelligence algor...An approach to solve the N-Queens Problem using Artificial Intelligence algor...
An approach to solve the N-Queens Problem using Artificial Intelligence algor...IRJET Journal
 
A review of automatic differentiationand its efficient implementation
A review of automatic differentiationand its efficient implementationA review of automatic differentiationand its efficient implementation
A review of automatic differentiationand its efficient implementationssuserfa7e73
 
Machine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxMachine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxVenkateswaraBabuRavi
 

Similaire à Design and analysis of algorithms (20)

Notion of an algorithm
Notion of an algorithmNotion of an algorithm
Notion of an algorithm
 
L01 intro-daa - ppt1
L01 intro-daa - ppt1L01 intro-daa - ppt1
L01 intro-daa - ppt1
 
Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01Data Structures and Algorithms Unit 01
Data Structures and Algorithms Unit 01
 
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on GraphPrim and Genetic Algorithms Performance in Determining Optimum Route on Graph
Prim and Genetic Algorithms Performance in Determining Optimum Route on Graph
 
Unit i
Unit iUnit i
Unit i
 
Mathematical models and algorithms challenges
Mathematical models and algorithms challengesMathematical models and algorithms challenges
Mathematical models and algorithms challenges
 
Lec1
Lec1Lec1
Lec1
 
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...
Innovations in t-way test creation based on a hybrid hill climbing-greedy alg...
 
19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf19IS402_LP1_LM_22-23.pdf
19IS402_LP1_LM_22-23.pdf
 
chapter 1
chapter 1chapter 1
chapter 1
 
251 - Alogarithms Lects.pdf
251 - Alogarithms Lects.pdf251 - Alogarithms Lects.pdf
251 - Alogarithms Lects.pdf
 
Slide1
Slide1Slide1
Slide1
 
Ds03 part i algorithms by jyoti lakhani
Ds03 part i algorithms   by jyoti lakhaniDs03 part i algorithms   by jyoti lakhani
Ds03 part i algorithms by jyoti lakhani
 
Minimization of Assignment Problems
Minimization of Assignment ProblemsMinimization of Assignment Problems
Minimization of Assignment Problems
 
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACHIMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
 
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACHIMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
IMPROVEMENT OF SUPPLY CHAIN MANAGEMENT BY MATHEMATICAL PROGRAMMING APPROACH
 
An approach to solve the N-Queens Problem using Artificial Intelligence algor...
An approach to solve the N-Queens Problem using Artificial Intelligence algor...An approach to solve the N-Queens Problem using Artificial Intelligence algor...
An approach to solve the N-Queens Problem using Artificial Intelligence algor...
 
A review of automatic differentiationand its efficient implementation
A review of automatic differentiationand its efficient implementationA review of automatic differentiationand its efficient implementation
A review of automatic differentiationand its efficient implementation
 
Numerical Methods
Numerical MethodsNumerical Methods
Numerical Methods
 
Machine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptxMachine learning ppt unit one syllabuspptx
Machine learning ppt unit one syllabuspptx
 

Plus de Dr Geetha Mohan

INTRODUCTION TO BIG DATA AND HADOOP
INTRODUCTION TO BIG DATA AND HADOOPINTRODUCTION TO BIG DATA AND HADOOP
INTRODUCTION TO BIG DATA AND HADOOPDr Geetha Mohan
 
CLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptxCLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptxDr Geetha Mohan
 
CLOUD ENABLING TECHNOLOGIES.pptx
 CLOUD ENABLING TECHNOLOGIES.pptx CLOUD ENABLING TECHNOLOGIES.pptx
CLOUD ENABLING TECHNOLOGIES.pptxDr Geetha Mohan
 
IPR in Academic Research:Dr G Geetha
IPR in Academic Research:Dr G GeethaIPR in Academic Research:Dr G Geetha
IPR in Academic Research:Dr G GeethaDr Geetha Mohan
 
Resource management techniques
Resource management techniquesResource management techniques
Resource management techniquesDr Geetha Mohan
 
Ge6075 professional ethics in engineering unit 1
Ge6075 professional ethics in engineering  unit 1Ge6075 professional ethics in engineering  unit 1
Ge6075 professional ethics in engineering unit 1Dr Geetha Mohan
 
Cp7101 design and management of computer networks-flow analysis
Cp7101 design and management of computer networks-flow analysisCp7101 design and management of computer networks-flow analysis
Cp7101 design and management of computer networks-flow analysisDr Geetha Mohan
 
Cp7101 design and management of computer networks-requirements analysis 2
Cp7101 design and management of computer networks-requirements analysis 2 Cp7101 design and management of computer networks-requirements analysis 2
Cp7101 design and management of computer networks-requirements analysis 2 Dr Geetha Mohan
 
Cp7101 design and management of computer networks-requirements analysis
Cp7101 design and management of computer networks-requirements analysisCp7101 design and management of computer networks-requirements analysis
Cp7101 design and management of computer networks-requirements analysisDr Geetha Mohan
 
Cp7101 design and management of computer networks-design concepts
Cp7101 design and management of computer networks-design conceptsCp7101 design and management of computer networks-design concepts
Cp7101 design and management of computer networks-design conceptsDr Geetha Mohan
 
Cp7101 design and management of computer networks -network
Cp7101 design and management of computer networks -networkCp7101 design and management of computer networks -network
Cp7101 design and management of computer networks -networkDr Geetha Mohan
 

Plus de Dr Geetha Mohan (13)

INTRODUCTION TO BIG DATA AND HADOOP
INTRODUCTION TO BIG DATA AND HADOOPINTRODUCTION TO BIG DATA AND HADOOP
INTRODUCTION TO BIG DATA AND HADOOP
 
CLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptxCLOUD ARCHITECTURE AND SERVICES.pptx
CLOUD ARCHITECTURE AND SERVICES.pptx
 
CLOUD ENABLING TECHNOLOGIES.pptx
 CLOUD ENABLING TECHNOLOGIES.pptx CLOUD ENABLING TECHNOLOGIES.pptx
CLOUD ENABLING TECHNOLOGIES.pptx
 
IPR in Academic Research:Dr G Geetha
IPR in Academic Research:Dr G GeethaIPR in Academic Research:Dr G Geetha
IPR in Academic Research:Dr G Geetha
 
How to file a patent
How to file a patentHow to file a patent
How to file a patent
 
Machine learning
Machine learningMachine learning
Machine learning
 
Resource management techniques
Resource management techniquesResource management techniques
Resource management techniques
 
Ge6075 professional ethics in engineering unit 1
Ge6075 professional ethics in engineering  unit 1Ge6075 professional ethics in engineering  unit 1
Ge6075 professional ethics in engineering unit 1
 
Cp7101 design and management of computer networks-flow analysis
Cp7101 design and management of computer networks-flow analysisCp7101 design and management of computer networks-flow analysis
Cp7101 design and management of computer networks-flow analysis
 
Cp7101 design and management of computer networks-requirements analysis 2
Cp7101 design and management of computer networks-requirements analysis 2 Cp7101 design and management of computer networks-requirements analysis 2
Cp7101 design and management of computer networks-requirements analysis 2
 
Cp7101 design and management of computer networks-requirements analysis
Cp7101 design and management of computer networks-requirements analysisCp7101 design and management of computer networks-requirements analysis
Cp7101 design and management of computer networks-requirements analysis
 
Cp7101 design and management of computer networks-design concepts
Cp7101 design and management of computer networks-design conceptsCp7101 design and management of computer networks-design concepts
Cp7101 design and management of computer networks-design concepts
 
Cp7101 design and management of computer networks -network
Cp7101 design and management of computer networks -networkCp7101 design and management of computer networks -network
Cp7101 design and management of computer networks -network
 

Dernier

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...Amil baba
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsKarakKing
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 

Dernier (20)

NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
NO1 Top Black Magic Specialist In Lahore Black magic In Pakistan Kala Ilam Ex...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 

Design and analysis of algorithms

  • 1. DESIGN AND ANALYSIS OF ALGORITHMS Dr. G.Geetha Mohan Professor Department of Computer Science and Engineering, Jerusalem College of Engineering, Chennai-600100 1/23/2019 1
  • 2. Outline  Notion of an Algorithm  Fundamentals of Algorithmic Problem Solving  Important ProblemTypes 1/23/2019 2
  • 3. What is a Computer Algorithm? A sequence of unambiguous instructions for solving a problem For obtaining a required output for any legitimate input in a finite amount of time 1/23/2019 3
  • 4. Computer Algorithm Vs Program  Computer algorithm A detailed step-by-step method for solving a problem using a computer  Program An implementation of one or more algorithms. 1/23/2019 4
  • 5. Find Greatest Common Divisor of Two Nonnegative 1. Euclid’s algorithm gcd(m n) = gcd(n, m mod n) gcd(60, 24) = gcd(24, 12) = gcd(12, 0) = 12. 2. Consecutive integer checking algorithm  For numbers 60 and 24, the algorithm will try first 24, then 23, and so on, until it reaches 12, where it stops. 1/23/2019 5
  • 6. Find Greatest Common Divisor of Two Nonnegative  Middle-school procedure for the numbers 60 and 24, we get 60 = 2 . 2 . 3 . 5 24 = 2 . 2 . 2 . 3 gcd(60, 24) = 2 . 2 . 3 = 12. 1/23/2019 6
  • 7. Notion of algorithm 1/23/2019 7 Problem Algorithm ComputerInput Output
  • 8. Notion of algorithm  Non-ambiguity requirement for each step of an algorithm  Range of inputs for which an algorithm works has to be specified  Same algorithm can be represented in several different ways.  Exist several algorithms for solving the same problem.  Algorithms for the same problem can be based on very different ideas and can solve the problem with dramatically different speeds. 1/23/2019 8
  • 9. Understand the problem Decide on: Computational means Exact vs Approximate solution Algorithm design technique Design an algorithm Data structures Prove correctness Analyze the algorithm Code the algorithm Algorithm Design And Analysis Process 1/23/2019 9
  • 10. 1.Understand the problem  Understand completely the problem given  Input  Output  An input to an algorithm specifies an instance of the problem the algorithm solves. 1/23/2019 10
  • 11. 2.1 Ascertaining the Capabilities of the Computational Device  Sequential Algorithms Instructions are executed one after another, one operation at a time. Random-access Machine (RAM)  Parallel Algorithms Execute operations concurrently( parallel) 1/23/2019 11
  • 12. 2.2 Choosing between Exact and Approximate Problem Solving  Exact algorithm  Approximation algorithm  Extracting square roots,  Solving nonlinear equations,  Evaluating definite integrals 1/23/2019 12
  • 13. 2.3 Algorithm Design Technique  An algorithm design technique (“strategy” or “paradigm”) General approach to solving problems algorithmically that is applicable to a variety of problems from different areas of computing.  Algorithm design techniques make it possible to classify algorithms according to an underlying design idea 1/23/2019 13
  • 14. 3.Designing an Algorithm and Data Structures  Several techniques need to be combined,  Hard to pinpoint as applications of the known design techniques  Algorithms+ data structures = programs  Object-oriented programming Data structures remain crucially important for both design and analysis of algorithms. 1/23/2019 14
  • 15. Methods of Specifying an Algorithm  Pseudo code A mixture of a natural language and programming language  Flowchart A method of expressing an algorithm by a collection of connected geometric shapes containing descriptions of the algorithm’s steps.  Programs Another way of specifying the algorithm 1/23/2019 15
  • 16. 4.Prove Correctness To prove that the algorithm yields a required result for every legitimate input in a finite amount of time  A common technique for proving correctness is to use mathematical induction  Tracing the algorithm’s performance for a few specific inputs to show that an algorithm is incorrect The notion of correctness for  Exact algorithms -straight forward  Approximation algorithms- less straight forward to be able to show that the error produced by the algorithm does not exceed a predefined limit. 1/23/2019 16
  • 17. 5.Analyze the Algorithm  Efficiency  Time efficiency, How fast the algorithm runs,  Space efficiency, How much extra memory it uses. Simplicity Easier to understand and easier to program Generality Issues - Algorithm solves Set of inputs it accepts 1/23/2019 17
  • 18. 6. Code the Algorithm  Programming an algorithm both a peril and an opportunity.  Test and debug program thoroughly whenever implement an algorithm.  Implementing an algorithm correctly is necessary but not sufficient  An analysis is based on timing the program on several inputs and then analyzing the results obtained. 1/23/2019 18
  • 19. 6. Code the Algorithm (cond…)  Algorithm’s Optimality.  Not about the efficiency of an algorithm  About the complexity of the problem it solves  What is the minimum amount of effort any algorithm will need to exert to solve the problem?  Another important issue of algorithmic problem solving  Whether or not every problem can be solved by an algorithm.  Not talking about problems that do not have a solution 1/23/2019 19
  • 20. Algorithms  Inventing (or discovering?) Algorithms is a very creative and rewarding process.  A good algorithm is a result of repeated effort and rework 1/23/2019 20
  • 21. Important Problem Types  Sorting  Searching  String processing  Graph problems  Combinatorial problems  Geometric problems  Numerical problems 1/23/2019 21
  • 22. 1. Sorting  Rearrange the items of a given list in non decreasing order  Specially chosen piece of information- key  Used as an auxiliary step in several important algorithms in other areas  Geometric Algorithms and Data Compression  Greedy approach an important algorithm design technique requires a sorted input. 1/23/2019 22
  • 23. 1. Sorting Two properties  Stable  Preserves the relative order of any two equal elements in its input.  In-place  The amount of extra memory the algorithm requires  An algorithm is said to be in-place if it does not require extra memory 1/23/2019 23
  • 24. 2. Searching  Deals with finding a given value, called a search key, in a given set (or a multiset, which permits several elements to have the same value)  Sequential Search or linear Search  Binary search 1/23/2019 24
  • 25. 2. Searching  Considered in conjunction with two other operations:  Addition to  Deletion from the data set of an item.  Data structures and Algorithms should be chosen to strike a balance among the requirements of each operation. 1/23/2019 25
  • 26. 3. String processing  Sequence of characters from an alphabet  Strings of particular interest are  Text strings, which comprise letters, numbers, and special characters;  Bit strings, which comprise zeros and ones;  Gene sequences, which can be modeled by strings of characters from the four- character alphabet {A,C, G,T}. 1/23/2019 26
  • 27. String Matching  Searching for a given word in a text 1/23/2019 27
  • 28. 4. Graph Problems  Collection of points called vertices,  Some of which are connected by line segments called edges.  Used for modeling a wide variety of applications  Transportation,  Communication,  Social and Economic networks  Project scheduling  Games. 1/23/2019 28
  • 29. Graph Problems  Basic graph algorithms  Graph traversal algorithms How can one reach all the points in a network?  Shortest-path algorithms What is the best route between two cities?  Topological sorting for graphs with directed edges set of courses with their prerequisites consistent or self-contradictory?. 1/23/2019 29
  • 30. Graph Problems  Traveling Salesman Problem (TSP) Problem of finding the shortest tour through n cities that visits every city exactly once.  Route Planning  Circuit board  VLSI chip fabrication  X-ray crystallography  Genetic Engineering 1/23/2019 30
  • 31. Graph Problems  Graph-coloring problem  seeks to assign the smallest number of colors to the vertices of a graph so that no two adjacent vertices are the same color Event Scheduling: Events are represented by vertices that are connected by an edge if and only if the corresponding events cannot be scheduled at the same time, a solution to the graph-coloring problem yields an optimal schedule. 1/23/2019 31
  • 32. 5. Combinatorial Problems  Traveling Salesman Problem and the Graph Coloring Problem are examples of combinatorial problems.  These are problems that ask, explicitly or implicitly, to find a combinatorial object such as a permutation, a combination, or a subset that satisfies certain constraints. 1/23/2019 32
  • 33. 5. Combinatorial Problems  Issues  Number of combinatorial objects typically grows extremely fast with a problem’s size, reaching unimaginable magnitudes even for moderate- sized instances.  There are no known algorithms for solving most such problems exactly in an acceptable amount of time. 1/23/2019 33
  • 34. 6.Geometric Algorithms  Geometric algorithms deal with geometric objects such as points, lines, and polygons.  Ancient Greeks -developing procedures For solving a variety of geometric problems,  Constructing simple geometric shapes -triangles, circles  Computer graphics  Robotics  Tomography 1/23/2019 34
  • 35. 6.Geometric Algorithms  Closest-pair problem Given n points in the plane, find the closest pair among them.  Convex-hull problem To find the smallest convex polygon that would include all the points of a given set. 1/23/2019 35
  • 36. 7. Numerical problems  Problems that involve mathematical objects of continuous nature  Solving equations  Systems of equations,  Computing definite integrals,  Evaluating functions 1/23/2019 36
  • 37. 7. Numerical problems  Mathematical problems can be solved only approximately  Problems typically require manipulating real numbers, which can be represented in a computer only approximately.  Large number of arithmetic operations performed on approximately represented numbers can lead to an accumulation of the round-off 1/23/2019 37
  • 38. Modeling the Real World  Cast your application in terms of well-studied abstract data structures 1/23/2019 38 Concrete Abstract arrangement, tour, ordering, sequence permutation cluster, collection, committee, group, packaging, selection subsets hierarchy, ancestor/descendants, taxonomy trees network, circuit, web, relationship graph sites, positions, locations points shapes, regions, boundaries polygons text, characters, patterns strings
  • 39. Real-World Applications  Hardware design: VLSI chips  Compilers  Computer graphics: movies, video games  Routing messages in the Internet  Searching the Web  Distributed file sharing 1/23/2019 39 • Computer aided design and manufacturing • Security: e-commerce, voting machines • Multimedia: CD player, DVD, MP3, JPG, HDTV • DNA sequencing, protein folding • and many more!
  • 40. Some Important Problem Types  Sorting ◦ a set of items  Searching ◦ among a set of items  String processing ◦ text, bit strings, gene sequences  Graphs ◦ model objects and their relationships 1/23/2019 40 • Combinatorial – find desired permutation, combination or subset • Geometric – graphics, imaging, robotics • Numerical – continuous math: solving equations, evaluating functions
  • 41. Algorithm Design Techniques • Brute Force & Exhaustive Search – follow definition / try all possibilities • Divide & Conquer – break problem into distinct subproblems • Transformation – convert problem to another one • Dynamic Programming – break problem into overlapping sub problems • Greedy – repeatedly do what is best now • Iterative Improvement – repeatedly improve current solution • Randomization – use random numbers 1/23/2019 41