01 - Study Unit 1 - Introduction To Algorithms
01 - Study Unit 1 - Introduction To Algorithms
and Optimisation
Study Unit 1 – Introduction to Algorithms
Days Date Event Date Event Date Event Date Event Date Event Date Event
Monday 1 RECESS 3 1
Class Program
EXAM OPP 2
Wednesday 3 1 5 EXAM OPP 1 3
PRACTICAL SEMESTER TEST
Thursday 1 4 2 WEEK 6 4
PROBLEMS
RECESS
Friday 2 1 5 3 7 5 RECESS
Saturday 3 2 6 4 8 6
• 12 February – Class Begins Sunday 4 3 7 5 9 7
Monday 5 4 SU3 - LECTURE 5 8 SU5 - LECTURE 8 6 SU5 - LECTURE 10 10 8
• 22 February – Tutorial 1 (SU1 & SU2) Tuesday 6 5 SU3 - LECTURE 5 9 SU5 - LECTURE 8 7 SU5 - LECTURE 10 11 9
2nd
Wednesday 7 RECESS 6 10 8 12 EXAM OPP 1 10
• 07 March – Tutorial 2 (SU3) Thursday 8 7 TUTORIAL 2 11 TUTORIAL 4 9 SEMESTER TEST 3 13 11
SEMESTER
• 21 Mar. – 01 Apr. – Recess Tuesday 13 SU1 - LECTURE 1 12 SU4 - LECTURE 6 16 SU5 - LECTURE 9 14 18
EXAM OPP 1
16
2nd
Wednesday 14 13 17 15 PRACTICAL DEMO 19 17 SEMESTER
• 22 Apr. – 03 May – MSA Week (L1-8) Monday 19 SU2 - LECTURE 2 18 SU4 - LECTURE 6 22 20 OPEN FOR HELP 24 22
Friday 23 22 26 24 28 26
• 13 – 17 May – Demo Practical Saturday 24 23 27 SU4 - LECTURE 6 25 29 27
Sunday 25 24 28 26 30 28
Exam Friday 29 31
Saturday 30 1
• 05 Jul. – Recess Sunday 31 2
Agenda
• What is an Algorithm?
• Optimisation of Algorithms and Heuristics
• Selecting the Right Jobs
• Reasoning about Correctness
• Induction and Recursion
• Modelling the Problem
STUDY UNIT 1 – Chapter 1 (Skiena, S. S.)
Study Outcomes
• Provide a Formal Definition of an Algorithm
• Describe What the Correctness of an Algorithm
Entails
• Evaluate the Correctness of a Provided Algorithm
• Construct and Implement an Algorithm to Address a
Real-World Problem
Fair Warning
This Study Unit May Feel a Bit Disjointed, But Is
Basically a Summary of All the Topics of the Module
Think of Describing the Sets as:
or or , etc..
More Types:
What is an Algorithm? •
•
Numeric
Alphabetic
• Date Time
2. Efficiency
Does the Algorithm Slow the Bigger Picture Process Down too Much?
A Measure of the Average Execution Time Necessary for an Algorithm to
Complete Work on a Set of Data
3. Easily Implementable
Is the Complexity of the Algorithm Justifiable for Its Purpose?
Correctness of an Algorithm
• Def: Always Returns the Desired Output for All Legal Instances of the Problem.
• It is Seldom Obvious Whether an Algorithm Correctly Solves a Given Problem.
• It Might Work for Some or Most Instances, But Malfunction for other Instances.
• Usually, Not General/Well-Specified Enough (Think of Geeks For Geeks Code).
• Carefully Specifying Algorithm Problems is Key for Measuring Correctness.
• Correct Algorithms Usually Come with a Proof of Correctness:
An Explanation of Why We Know that the Algorithm Must Take Every Instance of
the Problem to the Desired Result
Takeaway
1. An algorithm is a procedure to accomplish a
specific task. An algorithm is the idea behind
any reasonable computer program
This Is Not Only Slow, But Not Pragmatic. Many Circuit Board Designs
Require Many More Nodes (Some even ).
“All of the world’s computers working full time wouldn’t come close to finishing
the problem before the end of the universe, at which point it presumably becomes
moot” – S. S. Skiena
Optional Solutions*
• Earliest Job First
• Shortest Job First
• Exhaustive Scheduling
• Optimal Scheduling
Earliest Job First
Combinatorial/Recursive Objects:
• Permutations – Arrangement, Tour, Ordering, Sequence
• Subsets – Cluster, Collection, Committee, Group, Packaging, Collection
• Trees – Hierarchy, Dominance/Descendant Relationship, Taxonomy
• Graphs – Network, Circuit, Web, Relationship
• Points – Locations, Sites, Positions, Data Records
• Polygons – Shapes, Regions, Configurations, Boundaries PolygonsTrees
Graphs
Permutations/Subsets
Points
• Strings – Text, Characters, Patterns, Labels
Strings
Takeaway
1. Modelling is a Process Where Representative
Complexity is Added to a Simplified Version of
Something Until Desired Trade-Offs
are Met.