UMass Lowell Computer Science Analysis of Algorithms Prof

Slides:



Advertisements
Similar presentations
Comments We consider in this topic a large class of related problems that deal with proximity of points in the plane. We will: 1.Define some proximity.
Advertisements

UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2005 Lecture 1 (Part 2) “How to Make an Algorithm Sandwich” adapted.
Heuristics for the Hidden Clique Problem Robert Krauthgamer (IBM Almaden) Joint work with Uri Feige (Weizmann)
S. J. Shyu Chap. 1 Introduction 1 The Design and Analysis of Algorithms Chapter 1 Introduction S. J. Shyu.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Midterm Review Fri. Oct 26.
UMass Lowell Computer Science Graduate Analysis of Algorithms Prof. Karen Daniels Spring, 2010 Lecture 3 Tuesday, 2/9/10 Amortized Analysis.
Computational problems, algorithms, runtime, hardness
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/4/01.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2005 Lecture 1 (Part 1) Introduction/Overview Tuesday, 1/25/05.
Introduction to Analysis of Algorithms
CPSC 689: Discrete Algorithms for Mobile and Wireless Systems Spring 2009 Prof. Jennifer Welch.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2007 Lecture 3 Chapter 3: 2D Convex Hulls Friday,
UMass Lowell Computer Science Graduate Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 3 Tuesday, 2/10/09 Amortized Analysis.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/3/02.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2002 Review Lecture Tuesday, 12/10/02.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2001 Lectures 3/4 Chapters 1 & 2 Wed. 2/7/01 and Thursday 2/8/01.
Computational Complexity, Physical Mapping III + Perl CIS 667 March 4, 2004.
CS3381 Des & Anal of Alg ( SemA) City Univ of HK / Dept of CS / Helena Wong 2. Analysis of Algorithms - 1 Analysis.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2009 Lecture 1 (Part 2) “How to Make an Algorithm Sandwich” adapted.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Lectures 2, 3 Chapters 1, 2 Fri. 9/7/01 – Mon. 9/10/01.
Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log 2 n) Time MATHEMATICAL SCIENCES COLLOQUIUM Prof. Karen Daniels Wednesday, October.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2004 Lecture 1 (Part 1) Introduction/Overview Wednesday, 9/8/04.
UMass Lowell Computer Science Advanced Algorithms Computational Geometry Prof. Karen Daniels Spring, 2001 Lecture 6 Start of Part II Material Monday,
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Lecture 1 (Part 1) Introduction/Overview Tuesday, 1/29/02.
1 Slides by Asaf Shapira & Michael Lewin & Boaz Klartag & Oded Schwartz. Adapted from things beyond us.
Approximation Algorithms Ola Svensson. Course Information Goal: – Learn the techniques used by studying famous applications Graduate Course FDD
Summary of Algo Analysis / Slide 1 Algorithm complexity * Bounds are for the algorithms, rather than programs n programs are just implementations of an.
Text Chapters 1, 2. Sorting ä Sorting Problem: ä Input: A sequence of n numbers ä Output: A permutation (reordering) of the input sequence such that:
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Spring, 2002 Lecture 1 Introduction/Overview Text: Chapters 1, 2 Thurs.
CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a CSC 201 Analysis and Design of Algorithms Lecture 03: Introduction to a lgorithms.
1 Introduction to Approximation Algorithms. 2 NP-completeness Do your best then.
CSCI-256 Data Structures & Algorithm Analysis Lecture Note: Some slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved. 4.
Major objective of this course is: Design and analysis of modern algorithms Different variants Accuracy Efficiency Comparing efficiencies Motivation thinking.
CS216: Program and Data Representation University of Virginia Computer Science Spring 2006 David Evans Lecture 8: Crash Course in Computational Complexity.
UMass Lowell Computer Science Analysis of Algorithms Prof. Karen Daniels Fall, 2001 Review Lecture Tuesday, 12/11/01.
Common Intersection of Half-Planes in R 2 2 PROBLEM (Common Intersection of half- planes in R 2 ) Given n half-planes H 1, H 2,..., H n in R 2 compute.
BITS Pilani Pilani Campus Data Structure and Algorithms Design Dr. Maheswari Karthikeyan Lecture1.
TU/e Algorithms (2IL15) – Lecture 11 1 Approximation Algorithms.
Algorithm Analysis 1.
Introduction to Data Structures
Advanced Algorithms Analysis and Design
The NP class. NP-completeness
P & NP.
Growth of Functions & Algorithms
University of British Columbia
Lecture 1 (Part 1) Introduction/Overview Tuesday, 9/9/08
Analysis of Algorithms
Approximation Algorithms
Introduction to Algorithms
Core-Sets and Geometric Optimization problems.
CPSC 411 Design and Analysis of Algorithms
The Growth of Functions
Course Description Algorithms are: Recipes for solving problems.
CS 3343: Analysis of Algorithms
CSCE 411 Design and Analysis of Algorithms
Tuesday, 12/3/02 String Matching Algorithms Chapter 32
Objective of This Course
Introduction to Algorithms Analysis
Coverage Approximation Algorithms
Analysis of Algorithms
Asst. Dr.Surasak Mungsing
CS 188: Artificial Intelligence Fall 2008
Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007
CPSC 411 Design and Analysis of Algorithms
15th Scandinavian Workshop on Algorithm Theory
Course Description Algorithms are: Recipes for solving problems.
Solution methods for NP-hard Discrete Optimization Problems
Analysis of Algorithms
Complexity Theory: Foundations
Presentation transcript:

UMass Lowell Computer Science 91. 503 Analysis of Algorithms Prof UMass Lowell Computer Science 91.503 Analysis of Algorithms Prof. Karen Daniels Fall, 2006 Lecture 1 (Part 2) “How to Make an Algorithm Sandwich” adapted from the fall, 2000 talk Finding the Largest Area Axis-Parallel Rectangle in a Polygon in O(n log2 n) Time given at UMass Lowell MATHEMATICAL SCIENCES COLLOQUIUM I joined the UMass Lowell Computer Science faculty this summer. This collection of slides is intended to familiarize the reader/viewer with my field of research (Computational Geometry), summarize my previous research results in this field and outline my plan for Computational Geometry research at UMass Lowell.

Context: Taxonomy of Problems Supporting Apparel Manufacturing Maximum Rectangle Geometric Restriction Distance-Based Subdivision Containment Limited Gaps Ordered Containment Maximal Cover Minimal Enclosure Core Algorithms Application-Based Algorithms Column-Based Layout Two-Phase Layout Lattice Packing

A Common (sub)Problem Find a Good Approximation Outer Inner

What’s the Problem? Given a 2D polygon that: does not intersect itself may have holes has n vertices Find the Largest-Area Axis-Parallel Rectangle How “hard” is it? How “fast” can we find it?

Approach Explore the problem to gain intuition: Describe it: What are the assumptions? (model of computation, etc...) Has it already been solved? Have similar problems been solved? (more on this later) What does best-case input look like? What does worst-case input look like? Establish worst-case upper bound on the problem using an algorithm Design a (simple) algorithm and find an upper bound on its worst-case asymptotic running time; this tells us problem can be solved in a certain amount of time. Algorithms taking more than this amount of time may exist, but won’t help us. Establish worst-case lower bound on the problem Tighten each bound to form a worst-case “sandwich” n 1 2n n2 n3 n4 n5 increasing worst-case asymptotic running time as a function of n

Upper Bound First Attempt

Designing an Algorithm to Provide Upper Bound First attempt uses a straightforward approach: “brute-force” “naïve” Will most likely produce a “loose” upper bound Characterize rectangle based on how it can “grow” Contacts reduce degrees of freedom

O(n5) LR Algorithm Find_LR(Polygon P) area0 Find_LR_0_RC(P) return maximum(area0, area1, area2, area3, area4) Find_LR_0_RC(P) for i 1 to n (for each edge of P) for j 1 to n for k 1 to n for l 1 to n area area of LR for 0-RC determining set for (i,j,k,l) if LR is empty, then update maximum area return maximum area O(n) O(n5)

First Upper Bound: What can we really conclude? Algorithm’s worst-case running time is in O(n5). Problem can be solved in O(n5) time, even for worst-case inputs. Note: there might exist algorithms for this problem that take more than n5 time, but they aren’t useful to us! If a worst-case input exists that causes algorithm to actually use time proportional to n5, then algorithm’s worst-case running time is also in W(n5). In this case, we can say algorithm’s worst-case running time is in Q(n5). An inefficient algorithm for the problem might exist that takes this much time, but would not help us. 1 n n2 n5 2n increasing worst-case asymptotic running time as a function of n

Lower Bound First Attempt 1 n n2 n5 2n An inefficient algorithm for the problem might exist that takes this much time, but would not help us. 1 n n2 n5 2n increasing worst-case asymptotic running time as a function of n

First Attempt First attempt will most likely produce a “loose” lower bound that can be improved later. W(1) and W(n) are not hard to achieve: Rationale for W(n) is that we must examine every vertex at least once in order to solve the problem. This holds for every algorithm that solves the problem, so it gives us a lower bound on the problem in an even stronger sense than our upper bound. Remember that our upper bound does not guarantee that no algorithm exists for this problem that takes more than O(n5) time, but if one exists it will not help us! n 1 2n n5 worst-case bounds on problem An inefficient algorithm for the problem might exist that takes this much time, but would not help us. No algorithm for the problem exists that can solve it for worst-case inputs in less than linear time .

Know the Difference! Strong Bound: This worst-case lower bound on the problem holds for every algorithm that solves the problem and abides by our problem’s assumptions. Weak Bound: This worst-case upper bound on the problem comes from just considering one algorithm. Other, less efficient algorithms that solve this problem might exist, but we don’t care about them! n 1 2n n5 worst-case bounds on problem An inefficient algorithm for the problem might exist that takes this much time, but would not help us. No algorithm for the problem exists that can solve it for worst-case inputs in less than linear time . Both the upper and lower bounds are probably loose (i.e. probably can be tightened later on).

Upper Bound Tightening It

Approach Think harder… Design an algorithm that takes only O(n2) time for worst-case inputs tighter upper bound 1 n worst-case bounds on problem n2 n5 2n Now we no longer care about this one!

Approach (continued) Think even harder… Run into brick wall! Characterize the brick wall: this type of case Go around brick wall by looking at similar problems. This requires ability to compare functions! n 1 2n n5 worst-case bounds on problem n2

Some Related Problems n 1 n log(n) n log2(n) 2n n5 n a(n) log(n)

Some Related Problems (continued) 1 n log(n) n log2(n) 2n n5 n a(n) log(n) n a(n)

Approach (continued) Reduce the O(n2) bound to O(n log2 n): Adapt a technique that worked for a similar problem in order to develop a general framework for the problematic case n 1 2n n5 worst-case bounds on problem n2 n log2 n

Lower Bound Tightening It

Approach Go around lower bound brick wall by: examining strong lower bounds for some similar problems transforming a similar problem to our problem [this process is similar to what we do when we prove problems NP-complete] worst-case bounds on problem 1 n log2 n n2 n5 2n n

Lower Bounds for Related Problems SmallestOuterRectangle: Q (n) SmallestOuterCircle: Q (n) point set, polygon LargestInnerRectangle: W (n) polygon LargestInnerCircle: Q (n log n) point set Largest circle containing no points of the set & whose center is in convex hull of the points LargestInnerRectangle: O (n log2(n)) polygon n 1 n log(n) n log2(n) 2n n5 worst-case bounds on our problem

Lower Bound of W(n log n) by Transforming a (seemingly unrelated) Problem MAX-GAP instance: given n real numbers { x1, x2, ... xn } find the maximum difference between 2 consecutive numbers in the sorted list. O(n) time transformation Rectangle area is a solution to the MAX-GAP instance specialized polygon x2 x4 x3 x1 Rectangle algorithm must take as least as much time as MAX-GAP. MAX-GAP is known to be in W(n log n). Rectangle algorithm must take W(n log n) time for specialized polygons. [Transforming yet another different problem yields bound for unspecialized polygons.]

Summary First attempt: Tighten bounds to make an “algorithm sandwich” Establish weak (and loose) worst-case upper bound on the problem using an algorithm Establish strong (and loose) worst-case lower bound on the problem Tighten bounds to make an “algorithm sandwich” Establish weak (but tighter) worst-case O(n log2 n) upper bound on the problem using an algorithm Establish strong (and tighter) worst-case lower bound on the problem by transforming a problem with known lower bound n 1 n log(n) n log2(n) 2n n5 bounds on problem

Recent Improvement! “Finding the Largest Axis-Aligned Rectangle in a Polygon in O(n log n) Time” Ralph Boland, Jorge Urrutia Canadian Conference on Computational Geometry, August 13-15, 2001 n 1 n log(n) n log2(n) 2n n5 bounds on problem n 1 n log(n) n log2(n) 2n n5 Tight bound on problem

For More Information Computational Geometry: My research: Graduate CS course in Computational Geometry offered at UMass Lowell in Spring ’01, Spring ’04, Spring ‘05 Introductory texts: Computational Geometry in C (O’Rourke) Computational Geometry: An Introduction (Preparata & Shamos) Bibliography: ftp://ftp.cs.usask.ca/pub/geometry/ Software:http://www.geom.umn.edu/software/cglist/ My research: http://www.cs.uml.edu/~kdaniels Journal paper: “Finding the largest area axis-parallel rectangle in a polygon” (Computational Geometry: Theory and Applications) Prof. Victor Milenkovic: Frequent co-author and former PhD advisor http://www.cs.miami.edu/~vjm