week01-lec01-after class
week01-lec01-after class
Junhao Gan
(with thanks to Harald Søndergaard, Toby Murray and Olya
Ohrimenko)
Week 1 Lecture 1
Semester 1, 2023
1/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 1 / 27
Welcome to COMP90038
Data structures, including arrays, linked lists, stacks, queues, trees, priority
queues and graphs.
Complexity classes.
2/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 2 / 27
Textbook
3/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 3 / 27
Subject Coordinator
Research Interests:
Practical algorithms with non-trivial theoretical guarantees for solving problems on
massive data.
“practical” means: the algorithms must be light-weighted, relatively easy-to-
implement and run fast in practice.
“non-trivial theoretical guarantees” means the algorithms must either beat or
match the theoretical bounds of the state-of-the-art solutions.
“massive data” means the datasets we deal with can be massively large, some-
times they may not be stored in the main memory or even not in a single
machine.
Tutors:
Philip Cervenjak
Zifeng (Peaker) Guo
Zhuowei (Alvin) Zhao
Yuning Zhou
possibly one more tutor
Other support is provided by your classmates, for example via the Discussion Board
in Canvas (LMS).
The Canvas page is our notice board, repository, and discussion forum.
5/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 5 / 27
Lectures and Tutorials
We have two consecutive 1-hour lectures (i.e., a 2-hour lecture) in the Sunderland
Theatre on Wednesdays.
We use lecture capture which is useful for revisiting points from a lecture; and it
can, sort of, be a substitute for the lecture proper, even if it is a poor one.
6/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 6 / 27
Assessment
All these details, and more, can be found on Canvas, under “Subject Overview”.
7/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 7 / 27
Time Commitment
It expands your mind, improves complexion, and contains all the minerals and
vitamins essential for developing boundless wisdom.
8/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 8 / 27
Assumed Knowledge
not compulsory, but to help you work out how well you know the assumed
background knowledge
Mathematics: sets, relations, functions, recurrence relations
Programming: arrays, records, linked lists, dictionaries, functions,
procedures, formal and actual parameters, parameter passing, return-values,
pointers/references
See the Reading Resources page on Canvas which has some pointers to online
resources that may help with the above background knowledge
9/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 9 / 27
How to Succeed
Attempt the tutorial questions every week, before you attend the tutorial, if at all
possible.
10/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 10 / 27
How to Succeed
Support the learning of your fellow students and expect their support, in class and
through the LMS discussion board.
We are all on the same learning journey and have the same goal.
Participate in the discussions on the subject’s LMS site and check regularly for
announcements.
11/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 11 / 27
Over to You—Introductions
Tell them where you are from, what degree program you are enrolled in, which
languages or programming languages you speak, what music you listen to, whatever.
12/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 12 / 27
Over to You—A Maze Problem
It can be traversed along rows and columns: up, down, left, right.
(3,2) (6,6) (2,8) (5,9) (8,4) (2,4) (6,3) (9,3) (1,9) (3,7)
(4,2) (7,8) (2,2) (4,5) (5,6) (10,5) (6,2) (6,10) (7,5) (7,9)
(8,1) (5,7) (4,4) (8,7) (9,2) (10,9) (2,6)
13/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 13 / 27
14/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 14 / 27
What is a Problem?
In computer science we use the term like that too, but there is a more technical
concept of algorithmic problem.
15/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 15 / 27
Example Definitions of the Maze Problem
Consider a maze contained in size 10×10 rectangle; rows and columns are numbered
from 1 to 10. One can move along rows and columns: up, down, left, right.
Given a list of specified obstacle coordinates, a start point coordinate and a goal
point coordinate, decide if there exists a path from the start point to the goal point.
16/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 16 / 27
Algorithmic Problems
An algorithm for the problem has to work for all possible (input) instances.
Example: Equation solving problems—an instance is a set of, say, linear equations.
17/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 17 / 27
What is an Algorithm?
The dictionary: “process or rules for (esp. machine) calculation etc.”
The (single) description of a process that will transform arbitrary input to the
correct output—even when there are infinitely many possible inputs.
Sort of, but more like a method, a systematic approach that works for any instance.
For example, the Depth-First Search (DFS) algorithm can solve the Maze Problem
(with infinitely many input instances).
18/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 18 / 27
What is an Algorithm?
Mathematicians had found many clever algorithms for all sorts of numeric problems.
In BC 300, the ancient Greek mathematician Euclid proposed the first algorithm for
calculating the greatest common divisor (GCD) of two given positive integers
m and n.
Nowadays, numeric algorithms are just a small part of the syllabus in an algorithms
course.
19/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 19 / 27
Computability
20/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 20 / 27
Abstract Complexity
In this subject, we are only interested in problems that have algorithmic solutions.
However, amongst those, there are many that provably do not have efficient solu-
tions.
Towards the end of this subject, we will discuss complexity theory briefly—this
theory is concerned with the inherent “hardness” of problems.
21/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 21 / 27
Why Study Algorithms?
Today computers allow us to solve problems whose size and complexity is vastly
greater than what could be done a century ago.
The use of computers has changed the focus of algorithmic study completely,
because algorithms that work well for a human (small scale) usually do not work
well for a computer (big scale).
22/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 22 / 27
Why Study Algorithms and Their Complexity?
23/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 23 / 27
Problem Solving Steps
24/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 24 / 27
What We Will Study
Algorithm analysis
Important algorithms for various problems, primarily
Sorting
Searching
String processing
Graph algorithms
25/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 25 / 27
Study Tips
Before the lecture, as a minimum make sure you have read the introductory section
of the relevant chapter.
Always read (and work) with paper and pencil ready; run algorithms by hand.
Always have a go at the tutorial exercises; this subject is very much about learning-
by-doing.
Identify areas not understood and use the LMS Discussion Forum.
26/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 26 / 27
Things to Do in the First Two Weeks
Visit the COMP90038 LMS pages and check the weekly schedule and any new
announcements.
Use the LMS Discussion Board; for example, if you are interested in forming a
study group with like-minded people, the Discussion Board is a useful place to say
so.
27/27
Algorithms and Complexity (Sem 1, 2023) Introduction and Welcome © University of Melbourne 27 / 27