The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Approximation Algorithms
Q. Suppose I need to solve an NPhard problem. What should I do?
A. Theory says you're unlikely to find a polytime algorithm.
Must sacrifice one of three desired features.
So
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Randomization
in practice, access to a pseudorandom number generator
Randomization. Allow fair coin flip in unit time.
Why randomize? Can lead to simplest, fastest, or only known algorithm
for a part
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Randomization
in practice, access to a pseudorandom number generator
Randomization. Allow fair coin flip in unit time.
Why randomize? Can lead to simplest, fastest, or only known
algorithm for a part
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Our solution will be similar to the algorithm for VERTEX COVER from the rst section
of this chapter. Consider the notation dened in the problem. For an element a E A, we
reduce the instance by a by de
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
We root the tree at some node 7 and associate a subtree T0 with each node U E T, and
let n, denote the number of nodes in the subtree To. A solutions for the graph partitioning
problem may split the s
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Problem 17.2
(a) There are O(log n) arrays and we need to query each of them. So the total query time
is O(log2 n). Although the query time decreases as the array size gets smaller, but that
doesnt ch
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
Written Assignment # 1
Amortized Analysis (CLRS Ch 17)
Problem 172 (30 pts) The logarithmic method is a general technique to make a static
data structure dynamic. Here w
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711
Advanced Algorithms
Ke Yi
Dept CSE, HKUST
Two Clarifications
Scope of the course
Algorithms, broadly defined
Algorithms, narrowly defined focus of this course
Fundamental algorithms and dat
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Coping With NPCompleteness
Q. Suppose I need to solve an NPcomplete problem. What should I
do?
A. Theory says you're unlikely to find polytime algorithm.
Must sacrifice at least one of three desire
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
12.4 Maximum Cut
Local Search
Local search. Algorithm that explores the space of possible
solutions in sequential fashion, moving from a current solution to
a "nearby" one.
Neighbor relation. Let S S'
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Approximation Algorithms
Q. Suppose I need to solve an NPhard problem. What should I do?
A. Theory says you're unlikely to find a polytime algorithm.
Must sacrifice one of three desired features.
So
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Amortized Analysis
Used
to analyze the average running time of an operation on a
data structure.
Def. The Amortized cost of an operation on a data structure is
where the max is taken over all sequence
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Coping With NPHardness
Q. Suppose I need to solve an NPhard problem. What should I do?
A. Theory says you're unlikely to find polytime algorithm.
Must sacrifice one of three desired features.
Solve
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Coping With NPCompleteness
Q. Suppose I need to solve an NPcomplete problem. What should I
do?
A. Theory says you're unlikely to find polytime algorithm.
Must sacrifice at least one of three desire
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Big data algorithms
Google trend
Is there anything
fundamentally new?
Massive Data vs Big Data
The 3 Vs
Volume
Velocity
Variety
Big data Applications
Big Data Algorithms
Parallel/Distributed
Extern
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
2014 Fall Semester
Written Assignment # 1
Chapter 10
Problem 1 (20pts) We claimed that the Hitting Set Problem was NPcomplete. To recap the denitions, consider a set A =
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
2014 Fall Semester
Written Assignment # 2
Chapter 11
Problem 11 (20 pts) Consider the following variant of the knapsack problem. There
are n items, each with a weight wi
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
2014 Fall Semester
Assignment 3
Amortized Analysis (CLRS Ch 17)
Problem 172 (25 pts) The logarithmic method is a general technique to make a static data structure dynami
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
2014 Fall Semester
Assignment 4
Chapter 13
Problem 11 (20 pts) Suppose you assign k jobs to k machines, each job to any of the k machines uniformly
and independently at r
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithms
Fall 2014 Midterm Exam
Instructions
1. Print your name, student ID at the top of every page (in case the staple falls out!).
2. This is a openbook, opennotes, openbra
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
COMP 5711: Advanced Algorithm
2014 Fall Semester
Midterm Exam Solutions
Problem 1 (15pts)
(a) k = O(log n/ log log n).
Proof: kk = nO(1) k log k = O(log n). When k = O(log n/ log log n), this certainl
The Hong Kong University of Science and Technology
Advanced Algorithms
COMP 5711

Fall 2014
Randomization
in practice, access to a pseudorandom number generator
Randomization. Allow fair coin flip in unit time.
Why randomize? Can lead to simplest, fastest, or only known
algorithm for a part