Professional Documents
Culture Documents
Department of M.Tech-Cse
Department of M.Tech-Cse
DEPARTMENT OF M.TECH-CSE
04/07/2023 1
EMPIRICAL ANALYSIS OF ALGORITHM
04/07/2023 2
CONT…
04/07/2023 3
GENERAL PLAN FOR THE EMPIRICAL
ANALYSIS OF ALGORITHM TIME EFFICIENCY
• Understand the experiment’s purpose.
• Decide on the efficiency metric M to be
measured and the measurement unit (an
operation count vs. a time unit).
• Decide on characteristics of the input sample
(its range, size, and so on).
• Prepare a program implementing the algorithm
(or algorithms) for the experimentation.
• Generate a sample of inputs.
04/07/2023 4
CONT…
04/07/2023 5
ALGORITHM
04/07/2023 6
CONT…
04/07/2023 7
TYPICAL SCATTER PLOTS
04/07/2023 8
CONT…
04/07/2023 9
IS EMPIRICAL ANALYSIS EASY OR
HARD?
Five aspects to consider in the process of
analysing an algorithm
• correctness,
• work done,
• space used,
• simplicity or clarity,
• optimality.
04/07/2023 10
DOING EMPIRICAL ANALYSIS
04/07/2023 11
• implement the algorithms
• implement some form of timing device
• create the input data sets necessary to produce
the measurements we need
• measure the performance of the algorithm on
the different input data sets created to meet our
aim
• interpret the results
• relate the results to the theoretical analysis
04/07/2023 12
ISSUES TO CONSIDER
04/07/2023 13
MEASURES OF PERFORMANCE
04/07/2023 14
MEASURING TIME
• User time
• System time
• Wallclock time
04/07/2023 15
REPRESENTATIVE OPERATION COUNTS
04/07/2023 16
TEST SETS
• Example: Sorting
04/07/2023 17
COMPARING ALGORITHMS
04/07/2023 18
ACCOUNTING FOR STOCHASTICITY
• Empirical Analysis
• Wallclock Time
• Parallel Processing
• Multiple Identical Runs
• Statistical Analysis
04/07/2023 19
PERFORMANCE PROFILES
• Comparison of Algorithms
• Visual Summary
04/07/2023 20
EXAMPLE PERFORMANCE PROFILE
04/07/2023 21
EMPIRICAL VERSUS THEORETICAL
ANALYSIS
• Sequential Algorithms
• Tuning of Implementational Details
• Parallel Algorithms
• Model of Computation
• Scalability
04/07/2023 22
04/07/2023 23
04/07/2023 24
04/07/2023 25