COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Chapter 5 Divide and Conquer
Divide and conquer
o Break up problem into several parts
o Solve each part recursively
o Combine solutions to
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
o
Cycle property. Let C be any cycle, and let f be the max cost edge belonging to C. Then the MST does
not contain f.
o
Cycle. Set of edge
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Chapter 2 Basics of Algorithm Analysis
Computational Tractability
Polynomial time
o Natural brute-force search algorithm, checking every p
Due: 27th of May 2016 at 11pm
Submit your assignment via Blackboard (turnitin). Submission must be in pdf
format, and cannot be handwritten.
COMP 9007 Assignment 4
As a first step go to the last page
Due: 24th of April 2016 at 11pm
Submit your assignment via Blackboard (turnitin). Submission must be in pdf
format, and cannot be handwritten.
COMP 9007 Assignment 2
As a first step go to the last pag
Due: 31th of March 2016 at 11pm
COMP 9007 Assignment 1
As a first step go to the last page and read the section: Advice on how to do
the home work.
1. Sort the following functions by order of growth f
Due: 12th of May 2016 at 11pm
Submit your assignment via Blackboard (turnitin). Submission must be in pdf
format, and cannot be handwritten.
COMP 9007 Assignment 3
As a first step go to the last page
Basic data structures
1
Why data structures?
Programs manipulate data
Data should be organized so manipulations will be efficient
- Search (e.g. Finding a word/file/web page)
Better programs are po
Basic data structures
1
Why data structures?
Programs manipulate data
Data should be organized so manipulations will be efficient
- Search (e.g. Finding a word/file/web page)
Better programs are po
Five Representative Problems: Interval Scheduling
Input. Set of jobs with start times and finish times.
Goal. Find maximum cardinality subset of mutually compatible jobs.
jobs don't overlap
a
b
c
d
Basic data structures
1
Why data structures?
Programs manipulate data
Data should be organized so manipulations will be efficient
- Search (e.g. Finding a word/file/web page)
Better programs are po
Minimum Spanning Tree
The University of Sydney
Page 1
Minimum Spanning Tree
Minimum spanning tree (MST). Given a connected graph G = (V,
E) with real-valued edge weights ce, an MST is a subset of the
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Correctness follows immediately from previous lemma.
Directed acyclic graphs
Def. A DAG is a directed graph that contains no directed cycl
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
o
Case 2: otherwise, insert e = (u, v) into T according to cut property where S = set of nodes in us
connected component.
Implementation.
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
General
Lecturer
o Taso Viglas
o SIT 413
o [email protected]
Assessment
o 20%
Assignments
o 20%
Midterm quiz
o 60%
Final exam
Reference
COMP3609 Algorithms and Complexity (Advanced)
Divide and conquer
o
o
o
Edmund Tse 2008
Divide: separate list into two pieces
Conquer: recursively count inversions in each half
Combine: count inversion
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Chapter 4 Greedy Algorithms
Interval scheduling
Interval scheduling
o Job starts at sj and finishes at fj.
o Two jobs are compatible if th
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
o
Consider lectures in increasing order of start time, assigning lecture to any compatible classroom
o
Implementation. O(n log n)
For eac