1 Chapter 8 Approximation Algorithms (Part II). 2 Outline Scheduling Independent tasks Bin packing.

Slides:



Advertisements
Similar presentations
Introduction to Algorithms
Advertisements

Algorithm Design Techniques
Multiprocessor Scheduling
Optimizing Cost and Performance for Multihoming Nick Feamster CS 6250 Fall 2011.
Fakultät für informatik informatik 12 technische universität dortmund Classical scheduling algorithms for periodic systems Peter Marwedel TU Dortmund,
Parallel List Ranking Advanced Algorithms & Data Structures Lecture Theme 17 Prof. Dr. Th. Ottmann Summer Semester 2006.
Tight Bounds for Online Class- constrained Packing Hadas Shachnai Bell Labs and The Technion IIT Tami Tamir The Technion IIT.
Math for Liberal Studies. There is a list of numbers called weights These numbers represent objects that need to be packed into bins with a particular.
Algorithm Design Methods (I) Fall 2003 CSE, POSTECH.
Algorithm Design Methods Spring 2007 CSE, POSTECH.
Priority Queues Two kinds of priority queues: Min priority queue. Max priority queue.
Problems and Their Classes
1/22 Worst and Best-Case Coverage in Sensor Networks Seapahn Meguerdichian, Farinaz Koushanfar, Miodrag Potkonjak, and Mani Srivastava IEEE TRANSACTIONS.
Minimum Clique Partition Problem with Constrained Weight for Interval Graphs Jianping Li Department of Mathematics Yunnan University Jointed by M.X. Chen.
 Review: The Greedy Method
Algorithm Design Techniques: Greedy Algorithms. Introduction Algorithm Design Techniques –Design of algorithms –Algorithms commonly used to solve problems.
Chapter 3: Planning and Scheduling Lesson Plan
CS223 Advanced Data Structures and Algorithms 1 Greedy Algorithms Neil Tang 4/8/2010.
Anany Levitin ACM SIGCSE 1999SIG. Outline Introduction Four General Design Techniques A Test of Generality Further Refinements Conclusion.
Tournament Trees CSE, POSTECH.
CS333 Algorithms
Advanced Topics in Algorithms and Data Structures Page 1 Parallel merging through partitioning The partitioning strategy consists of: Breaking up the given.
1 Greedy methods: Lecture 1 Jose Rolim University of Geneva.
CS333/ Topic 11 CS333 - Introduction CS333 - Introduction General information Goals.
Parallel Merging Advanced Algorithms & Data Structures Lecture Theme 15 Prof. Dr. Th. Ottmann Summer Semester 2006.
Polynomial time approximation scheme Lecture 17: Mar 13.
© J. Christopher Beck Lecture 18: Timetabling with Workforce Capacity.
1 Algorithm Design Techniques Greedy algorithms Divide and conquer Dynamic programming Randomized algorithms Backtracking.
Approximation Algorithms
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Bin Packing: From Theory to.
Bold Stroke January 13, 2003 Advanced Algorithms CS 539/441 OR In Search Of Efficient General Solutions Joe Hoffert
Approximation schemes Bin packing problem. Bin Packing problem Given n items with sizes a 1,…,a n  (0,1]. Find a packing in unit-sized bins that minimizes.
Design Techniques for Approximation Algorithms and Approximation Classes.
© 2010 AT&T Intellectual Property. All rights reserved. AT&T and the AT&T logo are trademarks of AT&T Intellectual Property. Case Studies: Bin Packing.
TECH Computer Science NP-Complete Problems Problems  Abstract Problems  Decision Problem, Optimal value, Optimal solution  Encodings  //Data Structure.
Greedy Methods and Backtracking Dr. Marina Gavrilova Computer Science University of Calgary Canada.
Approximation Schemes Open Shop Problem. O||C max and Om||C max {J 1,..., J n } is set of jobs. {M 1,..., M m } is set of machines. J i : {O i1,..., O.
1 Job Scheduling for Grid Computing on Metacomputers Keqin Li Proceedings of the 19th IEEE International Parallel and Distributed Procession Symposium.
Outline Introduction Minimizing the makespan Minimizing total flowtime
CS223 Advanced Data Structures and Algorithms 1 Review for Final Neil Tang 04/27/2010.
1 Algorithms & Data Structures for Games Lecture 2A Minor Games Programming.
Algorithm Design Methods 황승원 Fall 2011 CSE, POSTECH.
The bin packing problem. For n objects with sizes s 1, …, s n where 0 < s i ≤1, find the smallest number of bins with capacity one, such that n objects.
1 JOB SEQUENCING WITH DEADLINES The problem is stated as below. There are n jobs to be processed on a machine. Each job i has a deadline d i ≥ 0 and profit.
Introduction to NP Instructor: Neelima Gupta 1.
1 Ch18. The Greedy Methods. 2 BIRD’S-EYE VIEW Enter the world of algorithm-design methods In the remainder of this book, we study the methods for the.
Conceptual Foundations © 2008 Pearson Education Australia Lecture slides for this course are based on teaching materials provided/referred by: (1) Statistics.
BIN SORTING Problem Pack the following items in bins of size Firstly, find the lower bound by summing the numbers to be packed.
Approximation Algorithms for Scheduling Lecture 11.
Bin Packing First fit decreasing algorithm
Algorithm Design Methods
Design and Analysis of Algorithm
Analysis and design of algorithm
Design and Analysis of Computer Algorithm (CS575-01)
Exam 2 LZW not on syllabus. 73% / 75%.
Bin Packing First fit decreasing algorithm
Polynomial time approximation scheme
Richard Anderson Lecture 6 Greedy Algorithms
Bin Packing First fit decreasing algorithm
Richard Anderson Lecture 7 Greedy Algorithms
Bin Packing First fit decreasing algorithm
Selfish Load Balancing
Algorithm Design Methods
ICS 353: Design and Analysis of Algorithms
Algorithm Design Methods
Richard Anderson Winter 2019 Lecture 7
Chapter 3: Planning and Scheduling Lesson Plan
Bin Packing Michael T. Goodrich Some slides adapted from slides from
Approximation Algorithm
Algorithm Design Methods
Presentation transcript:

1 Chapter 8 Approximation Algorithms (Part II)

2 Outline Scheduling Independent tasks Bin packing

3 Scheduling independent tasks An instance of the scheduling problem is defined by a set of n task times, t i, 1 i n, and m, the number of processors. Obtaining minimum finish time schedules is NP- complete. The scheduling rule we will use is called the LPT (longest processing time) rule. Definition: An LPT schedule is one that is the result of an algorithm, which, whenever a processor becomes free, assigns to that processor a task whose time is the largest of those tasks not yet assigned.

4 Example Let m = 3, n = 6 and (t 1, t 2, t 3, t 4, t 5, t 6 ) = (8, 7, 6, 5, 4, 3). In an LPT schedule tasks 1, 2 and 3 respectively. Tasks 1, 2, and 3 are assigned to processors 1, 2 and 3. Tasks 4, 5 and 6 are respectively assigned to the processors 3, 2, and 1. The finish time is 11. Since t i /3 = 11, the schedule is also optimal P1 P

5 Example Let m = 3, n = 6 and (t 1, t 2, t 3, t 4, t 5, t 6, t 7 ) = (5, 5, 4, 4, 3, 3, 3). The LPT schedule is shown in the following figure. This has a finish time is 11. The optimal schedule is 9. Hence, for this instance |F*(I) – F(I)|/F*(I) = (11-9)/9=2/ P1 P2 P (a) LPT schedule(b) Optimal schedule 9

6 While the LPT rule may generate optimal schedules for some problem instances, it does not do so for all instances. How bad can LPT schedules be relative to optimal schedules? Theorem: [Graham] Let F*(I) be the finish time of an optimal m processor schedule for instance I of the task scheduling problem. Let F(I) be the finish time of an LPT schedule for the same instance, then |F*(I)-F(I)|/F*(I) 1/3 – 1/(3m) The proof of this theorem can be referred to the book Fundamentals of Computer Algorithms, E. Horowitz and S. Sahni, Pitman Publishing, 1978.

7 Bin Packing We are given n objects which have to be placed in bins of equal capacity L. Object i requires l i units of bin capacity. The objective is to determine the minimum number of bins needed to accommodate all n objects. Example: Let L = 10, n = 6 and (l 1, l 2, l 3, l 4, l 5, l 6 ) = (5, 6, 3, 7, 5,4) The bin packing problem is NP-complete.

8 Four heuristics One can derive many simple heuristics for the bin packing problem. In general, they will not obtain optimal packings. However, they obtain packings that use only a small fraction of bins more than an optimal packing. Four heuristics: First fit (FF) Best fit (BF) First fit Decreasing (FFD) Best fit Decreasing (BFD)

9 First-fit and Best-fit First-fit Index the bins 1, 2, 3,… All bins are initially filled to level 0. Objects are considered for packing in the order 1, 2, …, n. To pack object i, find the least index j such that bin j is filled to the level r (r L – l i ). Pack I into bin j. Bin j is now filled to level r + l i. Best-fit The initial conditions are the same as for FF. When object i is being considered, find the least j such that bin j is filled to a level r (r L – l i ) and r is as large as possible. Pack i into bin j. Bin j is now filled to level r + l i.

10 Example (a) First Fit (b) Best Fit

11 First-fit decreasing and Best-fit decreasing First-fit decreasing (FFD) Reorder the objects so that l i l i +1, 1 i n. Now use First-fit to pack the objects. Best-fit decreasing (BFD) Reorder the objects so that l i l i +1, 1 i n. Now use First-fit to pack the objects.

12 Example (c) First Fit Decreasing and Best Fit Decreasing FFD and BFD do better than either FF or BF on this instance. While FFD and BFD obtain optimal packings on this example, they do not in general obtain such a packings.

13 Theorem Let I be an instance of the bin packing problem and let F*(I) be the minimum number of bins needed for this instance. The packing generated by either FF or BF uses no more than (17/10)F*(I)+2 bins. The packings generated by either FFD or BFD uses no more than (11/9)F*(I)+4 bins. This proof of this theorem is long and complex (given by Johnson et al., 1974).

14 Appendix: A Taxonomy of Algorithm Design Strategies Strategy name Examples Bruce-force Sequential search, selection sort Divide-and-conquerQuicksort, mergesort, binary search Decrease-and-conquerInsertion sort, DFS, BFS Transform-and-conquerheapsort, Gauss elimination Greedy Prims, Dijkstras Dynamic ProgrammingFloyds Backtracking Branch-and-Bound Approximate algorithms Heuristics Meta-heuristics