COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
o
Sort points in 2-strip by their y coordinate.
o
Only check distances of those within 11 positions in sorted list!
o
o
Def. Let si be the
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Invariant. Every flow value f(e) and every residual capacities cf(e) remains an integer throughout
the algorithm
Theorem. The algorithm te
COMP3609 Algorithms and Complexity (Advanced)
o
Edmund Tse 2008
But getting stuck might be a local optimum, not global optimum
Residual graph: Gf = (V, Ef)
Original edge: e = (u, v) E.
Residual edge
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Chapter 6 Dynamic Programming
Algorithmic Paradigms
Greedy. Build up a solution incrementally, myopically optimising some local criterion.
COMP3609 Algorithms and Complexity (Advanced)
o
o
o
Edmund Tse 2008
Algorithm: each router performs n separate computations, one for each potential destination node.
Routing by rumour
Caveat. Edge cos
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
o
o
Theorem. Let T(m, n) = max running time on strings of length at most m and n. T(m, n) = O(mn log n).
Remark. Analysis is not tight bec
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Algorithm
o
Analysis. (mn) time and space
English words or sentences: m, n 10
Computational biology: m = n = 100,000. Memory requirement
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Bipartite matching
o Input. Undirected, bipartite graph G = (L R, E)
o M E is a matching if each node appears in at most one edge in M
o M
COMP3609 Algorithms and Complexity (Advanced)
o
Edmund Tse 2008
Do some post-processing. # of recursive calls n O(n)
Bottom-up dynamic programming. Unwind recursion
Knapsack Problem
Knapsack problem
o
COMP3609 Algorithms and Complexity (Advanced)
Edmund Tse 2008
Flows
o Def. An s-t flow is a function that satisfies:
For each e E:
0 ( ) ( )
f (e) = f (e)
For each v V = cfw_s, t
e into v
o
Def. The