Advanced Algorithms
Advanced Algorithms
Rod cutting
Note that if the price pn for a rod of length n is large enough, an optimal solution may
require no cutting at all.
bottom-up version
Matrix-chain multiplication
Longest common subsequence
Multistage graph
Longest increasing subsequence
Egg Dropping Puzzle
Edit Distance
UNIT 2:
Maximum Flow:
Flow networks
A flow network G = (V,E) is a directed graph in which each edge (u,v) ϵ E has a
nonnegative capacity c(u,v) ≥ 0. We further require that if E contains an edge (u,v), then
there is no edge (v,u) in the reverse direction.
Let G = (V,E) be a flow network with a capacity function c. Let s be the source of the
network, and let t be the sink. A flow in G is a real-valued function f : V × V → R that
satisfies the following two properties:
A minimum cut of a network is a cut whose capacity is minimum over all cuts of the
network.
Maximum bipartite matching
Multithreaded Algorithms:
String Matching
The naive string matching technique compares each character of the pattern with the text
until a match is found or all possible alignments have been exhausted. In this case, the
pattern “00001” has a length of 5 and the text has a length of 1000. So there are 1000 - 5
+ 1 = 996 possible alignments. For each alignment, up to 5 comparisons may be made
before a mismatch is found. Therefore, in the worst case scenario, up to 996 * 5
= 4980 comparisons may be made
The Rabin-Karp algorithm
String matching with finite automata
Horspool algorithm
Boyer-Moore Algorithm
bad-symbol shift d1
the good-suffix shift.
D2
UNIT 4
SIMPLEX-ALGORITHM:
Formulating problems as linear programs
Maximum flow
Minimum-cost flow
Multicommodity flow
UNIT 5
SWEEP
In sweeping, an imaginary vertical sweep line passes through the given set of
geometric objects, usually from left to right. We treat the spatial dimension that
the sweep line moves across, in this case the x-dimension, as a dimension of
time.
Graham Scan
Jarvis’s march