Presentation is loading. Please wait.

Presentation is loading. Please wait.

UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2003 Review Lecture Tuesday, 5/6/03.

Similar presentations


Presentation on theme: "UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2003 Review Lecture Tuesday, 5/6/03."— Presentation transcript:

1 UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2003 Review Lecture Tuesday, 5/6/03

2 Some Algorithm Application Areas Computer Graphics Geographic Information Systems Robotics Bioinformatics Astrophysics Medical Imaging Telecommunications Design Apply Analyze

3 Some Typical Problems Fourier Transform Input: A sequence of n real or complex values h_i, 0 <= i <= n-1, sampled at uniform intervals from a function h. Problem: Compute the discrete Fourier transform H of h Nearest Neighbor Input: A set S of n points in d dimensions; a query point q. Input: A set S of n points in d dimensions; a query point q. Problem: Which point in S is closest to q? Problem: Which point in S is closest to q? SOURCE: Steve Skiena’s Algorithm Design Manual (for problem descriptions, see graphics gallery at ) (for problem descriptions, see graphics gallery at http://www.cs.sunysb.edu/~algorith) Shortest Path Input: Edge-weighted graph G, with start vertex and end vertex t Problem: Find the shortest path from to t in G Bin Packing Input: A set of n items with sizes d_1,...,d_n. A set of m bins with capacity c_1,...,c_m. Problem: How do you store the set of items using the fewest number of bins?

4 Some Typical Problems Transitive Closure Input: A directed graph G=(V,E). Problem: Construct a graph G'=(V,E') with edge (i,j) \in E' iff there is a directed path from i to j in G. For transitive reduction, construct a small graph G'=(V,E') with a directed path from i to j in G' iff (i,j) \in E. Convex Hull Input: A set S of n points in d- dimensional space. Problem: Find the smallest convex polygon containing all the points of S. Problem: Find the smallest convex polygon containing all the points of S. Eulerian Cycle Input: A graph G=(V,E). Problem: Find the shortest tour of G visiting each edge at least once. Edge Coloring Input: A graph G=(V,E). Problem: What is the smallest set of colors needed to color the edges of E such that no two edges with the same color share a vertex in common?

5 Some Typical Problems Hamiltonian Cycle Input: A graph G=(V,E). Problem: Find an ordering of the vertices such that each vertex is visited exactly once. Clique Input: A graph G=(V,E). Problem: What is the largest S \subset V such that for all x,y \in S, (x,y) \in E?

6 Topics ä Advanced Algorithmic Paradigms ä Dynamic programming ä Greedy algorithms ä Simplex optimization ä Approximation algorithms & schemes ä Randomized algorithms ä Sweep-line algorithms ä Advanced Analysis Techniques ä Amortized ä Output-sensitive ä Graph Algorithms ä Shortest paths (single source & all pairs) ä Maximum flow ä Theory: NP-Completeness ä Complexity classes, reductions, hardness, completeness ä Advanced Algorithms for Special Applications ä Cryptography ä String/Pattern Matching ä Computational Geometry

7 Chapter Dependencies Math Review: Asymptotics, Recurrences, Summations, Sets, Graphs, Counting, Probability, Calculus, Proofs Techniques (e.g. Inductive) Logarithms Ch 6-9 Sorting Ch 10-13 Data Structures Math: Linear Algebra Ch 33 Computational Geometry Math: Geometry (High School Level) Ch 15-17 Advanced Design & Analysis Techniques Ch 22-26 Graph Algorithms Ch 34 NP-Completeness Ch 35 Approximation Algorithms Ch 31 Number-Theoretic Algorithms: RSA Math: Number Theory Ch 32 String Matching Automata Ch 29 Linear Programming

8 Important Dates ä Final Exam: ä Saturday, 17 May, Olsen Hall, Room 311, 11:30 am

9 Grading ä ä Homework35% ä ä Midterm 30% (open book, notes ) ä ä Final Exam35% (open book, notes )

10 Review Topics ä Linear Programming ä Formulating an LP model ä Multicommodity flow [handout] ä Factory scheduling ä SIMPLEX: infeasible initial basic solution [slides] ä Approximation Algorithms ä Euclidean TSP tour non-self-intersecting [handout] ä Clique approximation [handout] ä NP-completeness Reductions ä Dominating Set ä Rectangular Containment (kRR) ä Factory Scheduling

11 Multicommodity Flow source: 91.503 textbook Cormen et al. should be s i

12 Fundamental Theorem of Linear Programming source: 91.503 textbook Cormen et al.

13 Simplex Method

14 Simplex Algorithm: Pseudocode source: 91.503 textbook Cormen et al. to be defined later (detects infeasibility) Feasibility initial basic solution optimal solution

15 Simplex Algorithm: Basic Solution source: 91.503 textbook Cormen et al. Standard Form Slack Form Basic Solution: set each nonbasic variable to 0. Basic Solution:

16 Simplex Algorithm: Example Reformulating the LP Model source: 91.503 textbook Cormen et al. Main Idea: In each iteration, reformulate the LP model so basic solution has larger objective value Select a nonbasic variable whose objective coefficient is positive: x 1 Increase its value as much as possible. Identify tightest constraint on increase. For basic variable x 6 of that constraint, swap role with x 1. Rewrite other equations with x 6 on RHS. PIVOT leaving variable entering variable new objective value

17 Simplex Algorithm: Issues to be Addressed… source: 91.503 textbook Cormen et al.

18 Initial Basic Feasible Solution

19 Simplex Algorithm: Basic Solution source: 91.503 textbook Cormen et al. Standard Form Slack Form Basic Solution: set each nonbasic variable to 0. Basic Solution: How can this fail to be feasible?

20 Finding an Initial Solution source: 91.503 textbook Cormen et al. An LP model whose initial basic solution is not feasible

21 Finding an Initial Solution (continued) source: 91.503 textbook Cormen et al. Auxiliary LP model L aux :

22 Finding an Initial Solution (continued) source: 91.503 textbook Cormen et al. Original LP model L aux L aux in slack form

23 Finding an Initial Solution (continued) source: 91.503 textbook Cormen et al.

24 Finding an Initial Solution (continued) source: 91.503 textbook Cormen et al. PIVOT

25 Review Topics ä Linear Programming ä Formulating an LP model ä Multicommodity flow [slide & handout] ä Factory scheduling ä SIMPLEX: infeasible initial basic solution [slides] ä Approximation Algorithms ä Euclidean TSP tour non-self-intersecting [handout] ä Clique approximation [handout] ä NP-completeness Reductions ä Dominating Set ä Rectangular Containment (kRR) ä Factory Scheduling

26 Vertex Cover source: Garey & Johnson B E C F D A Vertex Cover of an undirected graph G=(V,E) is a subset vertex cover of size 2

27 Clique source: Garey & Johnson B E C F D A Clique of an undirected graph G=(V,E) is a complete subgraph of G. clique of size 3

28 Reducing Clique to VertexCover source: 91.503 textbook Cormen et al. Construct complement G =(V, E ) of graph G such that G has clique of size k iff graph G has a vertex cover of size |V|-k. z w u y v x 34.15

29 Review Topics ä Linear Programming ä Formulating an LP model ä Multicommodity flow [handout] ä Factory scheduling ä SIMPLEX: infeasible initial basic solution [slides] ä Approximation Algorithms ä Euclidean TSP tour non-self-intersecting [handout] ä Clique approximation [handout] ä NP-completeness Reductions ä Dominating Set ä Rectangular Containment (kRR) ä Factory Scheduling

30 Expanding List of Hard Problems via Reduction ä Relationships among some NP-complete problems source: 91.503 textbook Cormen et al. source: Garey & Johnson Circuit-SAT Dominating SetkRR

31 Dominating Set source: Garey & Johnson

32 Course Evaluations ä Need student volunteer to collect them.


Download ppt "UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Spring, 2003 Review Lecture Tuesday, 5/6/03."

Similar presentations


Ads by Google