0% found this document useful (0 votes)
45 views

Advanced Algorithms

The document outlines various topics in dynamic programming and computational geometry including rod cutting, matrix chain multiplication, longest common subsequence, flow networks, string matching algorithms, linear programming, shortest paths, and geometric algorithms like determining if line segments intersect, sweep line algorithms, and finding closest pairs of points. It discusses techniques like top-down and bottom-up approaches, the Ford-Fulkerson method, Rabin-Karp algorithm, Boyer-Moore algorithm, and the simplex algorithm.

Uploaded by

Varun Urs M S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Advanced Algorithms

The document outlines various topics in dynamic programming and computational geometry including rod cutting, matrix chain multiplication, longest common subsequence, flow networks, string matching algorithms, linear programming, shortest paths, and geometric algorithms like determining if line segments intersect, sweep line algorithms, and finding closest pairs of points. It discusses techniques like top-down and bottom-up approaches, the Ford-Fulkerson method, Rabin-Karp algorithm, Boyer-Moore algorithm, and the simplex algorithm.

Uploaded by

Varun Urs M S
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 34

UNIT 1: Dynamic Programming

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.

top-down CUT-ROD procedure

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.

We distinguish two vertices in a flow network: a source s and a sink t.

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:

The Ford-Fulkerson method

A minimum cut of a network is a cut whose capacity is minimum over all cuts of the
network.
Maximum bipartite matching
Multithreaded Algorithms:

The basics of dynamic multithreading

Multithreaded matrix multiplication

Multithreaded merge sort


UNIT 3

String Matching

Design a pseudo code/program for Naive string matching.

Derive time complexity of Naive string matching.


How many comparisons are made by the naive string matching technique in searching
for pattern “00001” in the binary text of 1000 zeros?

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

Shortest paths single-source shortest-paths

Maximum flow

Minimum-cost flow
Multicommodity flow
UNIT 5

Determining whether two line segments intersect

Determining whether any pair of segments intersects

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

The advantage of constructing separate chains is that we need not explicitly


compute angles.

Finding the closest pair of points

You might also like