A method for obtaining lower bounds

Slides:



Advertisements
Similar presentations
110/6/2014CSE Suprakash Datta datta[at]cse.yorku.ca CSE 3101: Introduction to the Design and Analysis of Algorithms.
Advertisements

Chapter 11 Limitations of Algorithm Power Copyright © 2007 Pearson Addison-Wesley. All rights reserved.
MS 101: Algorithms Instructor Neelima Gupta
Lecture 19. Reduction: More Undecidable problems
 Review: The Greedy Method
Lower Bounds for Sorting, Searching and Selection
MS 101: Algorithms Instructor Neelima Gupta
Max Cut Problem Daniel Natapov.
Greedy Algorithms Greed is good. (Some of the time)
Tournament Trees CSE, POSTECH.
Lower bound: Decision tree and adversary argument
Lecture 12: Lower bounds By "lower bounds" here we mean a lower bound on the complexity of a problem, not an algorithm. Basically we need to prove that.
Medians and Order Statistics
Introduction to Algorithms
Deterministic Selection and Sorting Prepared by John Reif, Ph.D. Analysis of Algorithms.
Lecture 13: Adversary Arguments continues … This lecture, we continue with the adversary argument by giving more examples.
Finding the Median Algorithm : Design & Analysis [11]
Branch and Bound Searching Strategies
3 -1 Chapter 3 The Greedy Method 3 -2 The greedy method Suppose that a problem can be solved by a sequence of decisions. The greedy method has that each.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu.
1 CSE 417: Algorithms and Computational Complexity Winter 2001 Lecture 21 Instructor: Paul Beame.
Data Flow Analysis Compiler Design Nov. 8, 2005.
CSC 2300 Data Structures & Algorithms March 20, 2007 Chapter 7. Sorting.
Data Structures and Algorithms1 Basics -- 2 From: Data Structures and Their Algorithms, by Harry R. Lewis and Larry Denenberg (Harvard University: Harper.
5-1 Chapter 5 Tree Searching Strategies. 5-2 Breadth-first search (BFS) 8-puzzle problem The breadth-first search uses a queue to hold all expanded nodes.
Do Now Factor completely and solve. x2 - 15x + 50 = 0
Problem: Selection Design and Analysis: Adversary Arguments The selection problem >  Finding max and min Adversary Arguments( 反论 )  Suppose you are playing.
EXAMPLE 3 Solve an equation by factoring Solve 2x 2 + 8x = 0. 2x 2 + 8x = 0 2x(x + 4) = 0 2x = 0 x = 0 or x + 4 = 0 or x = – 4 ANSWER The solutions of.
Integer programming Branch & bound algorithm ( B&B )
1 Calculating Polynomials We will use a generic polynomial form of: where the coefficient values are known constants The value of x will be the input and.
© The McGraw-Hill Companies, Inc., Chapter 3 The Greedy Method.
1 Chapter 1 Analysis Basics. 2 Chapter Outline What is analysis? What to count and consider Mathematical background Rates of growth Tournament method.
Substitute 0 for y. Write original equation. To find the x- intercept, substitute 0 for y and solve for x. SOLUTION Find the x- intercept and the y- intercept.
Substitute 0 for y. Write original equation. To find the x- intercept, substitute 0 for y and solve for x. SOLUTION Find the x- intercept and the y- intercept.
A Polynomial Time Approximation Scheme For Timing Constrained Minimum Cost Layer Assignment Shiyan Hu*, Zhuo Li**, Charles J. Alpert** *Dept of Electrical.
C++ Programming: Program Design Including Data Structures, Fourth Edition Chapter 19: Searching and Sorting Algorithms.
Chapter 19: Searching and Sorting Algorithms
Chapter 3 Sec 3.3 With Question/Answer Animations 1.
The Selection Problem. 2 Median and Order Statistics In this section, we will study algorithms for finding the i th smallest element in a set of n elements.
1 CS 552/652 Speech Recognition with Hidden Markov Models Winter 2011 Oregon Health & Science University Center for Spoken Language Understanding John-Paul.
TECH Computer Science Problem: Selection Design and Analysis: Adversary Arguments The selection problem >  Finding max and min Designing against an adversary.
Instructor Neelima Gupta Table of Contents Review of Lower Bounding Techniques Decision Trees Linear Sorting Selection Problems.
Analysis of Algorithms CS 477/677 Instructor: Monica Nicolescu Lecture 7.
Implicit Hitting Set Problems Richard M. Karp Erick Moreno Centeno DIMACS 20 th Anniversary.
OR Chapter 8. General LP Problems Converting other forms to general LP problem : min c’x  - max (-c)’x   = by adding a nonnegative slack variable.
1 CSC 421: Algorithm Design & Analysis Spring 2014 Complexity & lower bounds  brute force  decision trees  adversary arguments  problem reduction.
Ch22.Branch and Bound.
ARTIFICIAL INTELLIGENCE (CS 461D) Princess Nora University Faculty of Computer & Information Systems.
CSCE 668 DISTRIBUTED ALGORITHMS AND SYSTEMS Spring 2014 Prof. Jennifer Welch CSCE 668 Set 3: Leader Election in Rings 1.
Review 1 Merge Sort Merge Sort Algorithm Time Complexity Best case Average case Worst case Examples.
The Selection Algorithm : Design & Analysis [10].
Sorting Lower Bounds n Beating Them. Recap Divide and Conquer –Know how to break a problem into smaller problems, such that –Given a solution to the smaller.
CSC263 Tutorial 1 Big-O, Ω, ϴ Trevor Brown
Unit 2 Review. What does the graph tell you???? What is the Domain What is the range What is the y intercept What are the relative max and mins, absolute.
Solving Quadratic Functions by Graphing. To solve by graphing… Take your function and write it in standard form. Instead of making it y = blah, blah,
Game Theory Just last week:
Finding a Path With Largest Smallest Edge
CSC 421: Algorithm Design & Analysis
(2,4) Trees 11/15/2018 9:25 AM Sorting Lower Bound Sorting Lower Bound.
Analysis and design of algorithm
Comparison Sorting Elements are rearranged by comparing values of keys
The Curve Merger (Dvir & Widgerson, 2008)
(2,4) Trees 12/4/2018 1:20 PM Sorting Lower Bound Sorting Lower Bound.
Searching: linear & binary
Chapter 11 Limitations of Algorithm Power
Chapter 9: Medians and Order Statistics
The Selection Problem.
CSC 421: Algorithm Design & Analysis
11.2 Compare & Order Integers
Medians and Order Statistics
Presentation transcript:

A method for obtaining lower bounds Adversary Arguments A method for obtaining lower bounds

What is an Adversary? A Second Algorithm Which Intercepts Access to Data Structures Constructs the input data only as needed Attempts to make original algorithm work as hard as possible Analyze Adversary to obtain lower bound

Important Restriction Although data is created dynamically, it must return consistent results. If it replies that x[1]<x[2], it can never say later that x[2]<x[1].

Max and Min Keep values and status codes for all keys Codes: N-never used W-won once but never lost L-lost once but never won WL-won and lost at least once Key values will be arranged to make answers to come out right

When comparing x and y Status Response NewStat Info N,N x>y W,L 2 W,N x>y W,L 1 WL,N x>y WL,L 1 L,N x<y L,W 1 W,W x>y W,WL 1 L,L x>y WL,L 1 W,L; WL,L; W,WL x>y N/C 0 L,W; L,WL; WL,W x<y N/C 0 WL,WL Consistent N/C 0

Accumulating Information 2n-2 bits of information are required to solve the problem All keys except one must lose, all keys except one must win Comparing N,N pairs gives n/2 comparisons and n bits of info n-2 additional bits are required one comparison each is needed

Results 3n/2-2 comparisons are needed (This is a lower bound.) Upper bound is given by the following Compare elements pairwise, put losers in one pile, winners in another pile Find max of winners, min of losers This gives 3n/2-2 comparisons The algorithm is optimal

Largest and Second Largest Second Largest must have lost to largest Second Largest is Max of those compared to largest Tournament method gives n-1+lg n comparisons for finding largest and second largest

Second Largest: Adversary All keys are assigned weights w[i] Weights are all initialized to 1 Adversary replies are based on weights

When x is compared to y Weights Reply Changes w[x]>w[y] x>y w[x]:=w[x]+w[y]; w[y]:=0; w[x]=w[y]>0 x>y w[x]:=w[x]+w[y]; w[y]:=0; w[y]>w[x] y>x w[y]:=w[y]+w[x]; w[x]:=0; w[x]=w[y]=0 Consistent None

Accumulation of Weight Solution of the problem requires all weight to be accumulated with one key All other keys must have weight zero Since weight accumulates to highest weight, weight can at most double with each comparison lg n comparisons are required to accumulate all weight

Results The largest key must be compared with lg n other keys Finding the second largest requires at least lg n comparisons after finding the largest This is a lower bound The tournament algorithm is optimal