Instructor Neelima Gupta Table of Contents Factor 2 algorithm for Bin Packing Factor 2 algorithm for Minimum Makespan Scheduling Reference:

Slides:



Advertisements
Similar presentations
Algorithm Design Methods Spring 2007 CSE, POSTECH.
Advertisements

 Review: The Greedy Method
MCS 312: NP Completeness and Approximation algorithms Instructor Neelima Gupta
Chapter 5 Fundamental Algorithm Design Techniques.
Greedy Algorithms Greed is good. (Some of the time)
MS 101: Algorithms Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Greedy Algorithms.
Combinatorial Algorithms
MCA 520: Graph Theory Instructor Neelima Gupta
Merge Sort 4/15/2017 6:09 PM The Greedy Method The Greedy Method.
PTAS for Bin-Packing. Special Cases of Bin Packing 1. All item sizes smaller than Claim 1: Proof: If then So assume Therefore:
Instructor Neelima Gupta Table of Contents Lp –rounding Dual Fitting LP-Duality.
Parameterized Approximation Scheme for the Multiple Knapsack Problem by Klaus Jansen (SODA’09) Speaker: Yue Wang 04/14/2009.
Online Algorithms Motivation and Definitions Paging Problem Competitive Analysis Online Load Balancing.
1 Combinatorial Dominance Analysis The Knapsack Problem Keywords: Combinatorial Dominance (CD) Domination number/ratio (domn, domr) Knapsack (KP) Incremental.
Polynomial time approximation scheme Lecture 17: Mar 13.
Truthful Mechanisms for One-parameter Agents Aaron Archer, Eva Tardos Presented by: Ittai Abraham.
Job Scheduling Lecture 19: March 19. Job Scheduling: Unrelated Multiple Machines There are n jobs, each job has: a processing time p(i,j) (the time to.
Approximation Algorithms Motivation and Definitions TSP Vertex Cover Scheduling.
1 The Greedy Method CSC401 – Analysis of Algorithms Lecture Notes 10 The Greedy Method Objectives Introduce the Greedy Method Use the greedy method to.
10/31/02CSE Greedy Algorithms CSE Algorithms Greedy Algorithms.
Iterative Flattening in Cumulative Scheduling. Cumulative Scheduling Problem Set of Jobs Each job consists of a sequence of activities Each activity has.
Improved results for a memory allocation problem Rob van Stee University of Karlsruhe Germany Leah Epstein University of Haifa Israel WADS 2007 WAOA 2007.
Instructor Neelima Gupta
MCS312: NP-completeness and Approximation Algorithms
Instructor Neelima Gupta Introduction to some tools to designing algorithms through Sorting Iterative Divide and Conquer.
Yossi Azar Tel Aviv University Joint work with Ilan Cohen Serving in the Dark 1.
1 Approximation Algorithm Instructor: yedeshi
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.
MCA 202: Discrete Mathematics Instructor Neelima Gupta
Design Techniques for Approximation Algorithms and Approximation Classes.
Great Theoretical Ideas in Computer Science.
MS 101: Algorithms Instructor Neelima Gupta
Genome Rearrangements [1] Ch Types of Rearrangements Reversal Translocation
The Fast Optimal Voltage Partitioning Algorithm For Peak Power Density Minimization Jia Wang, Shiyan Hu Department of Electrical and Computer Engineering.
Princeton University COS 423 Theory of Algorithms Spring 2001 Kevin Wayne Approximation Algorithms These lecture slides are adapted from CLRS.
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.
MS 101: Algorithms Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Review of Lower Bounding Techniques Decision Trees Linear Sorting Selection Problems.
The Greedy Method. The Greedy Method Technique The greedy method is a general algorithm design paradigm, built on the following elements: configurations:
Outline Introduction Minimizing the makespan Minimizing total flowtime
MCS 101: Algorithms Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Class NP Class NPC Approximation Algorithms.
MCS 312: NP Completeness and Approximation algorthms Instructor Neelima Gupta
1 Chapter 5-1 Greedy Algorithms Slides by Kevin Wayne. Copyright © 2005 Pearson-Addison Wesley. All rights reserved.
© The McGraw-Hill Companies, Inc., Chapter 12 On-Line Algorithms.
Instructor Neelima Gupta Instructor: Ms. Neelima Gupta.
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.
Lecture 9COMPSCI.220.FS.T Lower Bound for Sorting Complexity Each algorithm that sorts by comparing only pairs of elements must use at least 
1 EE5900 Advanced Embedded System For Smart Infrastructure Static Scheduling.
11 -1 Chapter 12 On-Line Algorithms On-Line Algorithms On-line algorithms are used to solve on-line problems. The disk scheduling problem The requests.
Spring 2008The Greedy Method1. Spring 2008The Greedy Method2 Outline and Reading The Greedy Method Technique (§5.1) Fractional Knapsack Problem (§5.1.1)
Introduction to NP Instructor: Neelima Gupta 1.
Approximation Algorithms by bounding the OPT Instructor Neelima Gupta
MCS 312: NP Completeness and Approximation Algorithms Instructor Neelima Gupta
Instructor Neelima Gupta Table of Contents Introduction to Approximation Algorithms Factor 2 approximation algorithm for TSP Factor.
BIN SORTING Problem Pack the following items in bins of size Firstly, find the lower bound by summing the numbers to be packed.
Algorithm Design Methods
Advanced Algorithms Analysis and Design
Exam 2 LZW not on syllabus. 73% / 75%.
Polynomial time approximation scheme
Richard Anderson Lecture 6 Greedy Algorithms
Richard Anderson Lecture 7 Greedy Algorithms
Selfish Load Balancing
Algorithm Design Methods
EE5900 Advanced Embedded System For Smart Infrastructure
Algorithm Design Methods
MCS 312: NP Completeness and Approximation algorthms
Algorithm Design Methods
Richard Anderson Autumn 2019 Lecture 7
Presentation transcript:

Instructor Neelima Gupta

Table of Contents Factor 2 algorithm for Bin Packing Factor 2 algorithm for Minimum Makespan Scheduling Reference: Vazirani.

Bin Packing Problem: Definition Given n items of sizes x 1, … x n between 0 and 1, excluding 0, but including 1. Find a packing in unit-sized bins that minimizes the number of bins used.

Greedy Approach: factor 2 Consider items in any arbitrary order. At any iteration I, we have a set of partially filled bins B 1 …. B k To insert the next element x i, we check if it can be put in any of the already used bin. If not then we open another bin B k=1

Analysis : 2 factor approximation Prove by induction that if at any iteration we have m bins then at least m-1 of them are at least half full. Thus (m-1)/2 < Sum_{i,n} x i Since bins are of unit length, sum of item sizes is a lower bound on OPT. i.e Sum_{i,n} x i <= OPT Thus m – 1 < 2 OPT i.e m <= 2OPT

Minimum Makespan Scheduling Given n jobs with processing times p 1 ……. P n and an integer m, find an assignment of the jobs to m identical machines so that the completion time, called the makespan is minimized.

Greedy Approach: factor 2 Consider jobs in any arbitrary order. Schedule the next job on the machine with the minimum makespan so far.

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 1 J5 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 1 J6 7 J5 Thanks to: Isha Jaiswal (12 ) (MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 1 J6 7 J5 Thanks to: Isha Jaiswal (12 )(MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 1 J6 7 J5 Thanks to: Isha Jaiswal (12 )(MCS ‘ 12)

M1 M2 M3 t=0 Machine s Jobs Processing time J1 2 J2 3 J3 8 J4 5 J5 1 J6 7 2 J1 J2 3 J3 8 J4 5 1 J6 7 J5 Thanks to: Isha Jaiswal (12 )(MCS ‘ 12)

Analysis : 2 factor approximation Average mount of time for which a machine runs is (sum_{i} p i ) /m Clearly OPT >= (sum_{i} p i ) /m Proof: Suppose t i denotes the completion time of the ith machine in OPT. Then (sum_{i} p i ) /m is nothing but (sum_{i} t i ) /m Thus, OPT = max{t i } >= (sum_{i} t i ) /m = (sum_{i} p i ) /m Also, OPT >= max{p i }

Contd.. Consider the machine M whose makespan is maximum in our solution. Let p l be the processing time of the last job j l scheduled on M. Let s l be the start time of j l on M. Then, makespan of our solution = s l + p l Let j 1 ….j r be the jobs scheduled just before j l. Then s l = min{T i } <= (sum_{i = j 1 ….j r T i } )/m = (sum_{i = j 1 ….j r p i } )/m <= (sum_{i} p i ) /m Thus s l + p l <= (sum_{i} p i ) /m + max{p i } <= 2 OPT.

Consolidated by: Sumedha Upadhyaya( 42), Prachi Nagpal(41) (MCS '09)