Bin packing and scheduling

Vergelijkbare documenten
SAMPLE 11 = + 11 = + + Exploring Combinations of Ten + + = = + + = + = = + = = 11. Step Up. Step Ahead

ALGORITMIEK: answers exercise class 7

Add the standing fingers to get the tens and multiply the closed fingers to get the units.

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 8 februari 2010

Basic operations Implementation options

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

z x 1 x 2 x 3 x 4 s 1 s 2 s 3 rij rij rij rij

(1) De hoofdfunctie van ons gezelschap is het aanbieden van onderwijs. (2) Ons gezelschap is er om kunsteducatie te verbeteren

ANGSTSTOORNISSEN EN HYPOCHONDRIE: DIAGNOSTIEK EN BEHANDELING (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Preschool Kindergarten

MyDHL+ Van Non-Corporate naar Corporate

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE

Classification of triangles

Travel Survey Questionnaires

Group work to study a new subject.

The k-server problem 17.Januar 2008

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 7 februari 2011

Uitwerking van opgaven in Sipser

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGE. Toets Inleiding Kansrekening 1 22 februari 2013

Esther Lee-Varisco Matt Zhang

Engels op Niveau A2 Workshops Woordkennis 1

Settings for the C100BRS4 MAC Address Spoofing with cable Internet.

Opgave 2 Geef een korte uitleg van elk van de volgende concepten: De Yield-to-Maturity of a coupon bond.

Interaction Design for the Semantic Web

B1 Woordkennis: Spelling

Meetkunde en Lineaire Algebra

Luister alsjeblieft naar een opname als je de vragen beantwoordt of speel de stukken zelf!

After that, the digits are written after each other: first the row numbers, followed by the column numbers.

Calculator spelling. Assignment

Four-card problem. Input

Algorithmen II. Peter Sanders. Übungen: Moritz Kobitzsch und Dennis Schieferdecker. Institut für Theoretische Informatik, Algorithmik II.

MyDHL+ ProView activeren in MyDHL+

General info on using shopping carts with Ingenico epayments

Quality requirements concerning the packaging of oak lumber of Houthandel Wijers vof ( )

Handleiding Zuludesk Parent

Eye Feature Detection Towards Automatic Strabismus Screening

Aim of this presentation. Give inside information about our commercial comparison website and our role in the Dutch and Spanish energy market

The upside down Louisa tutorial by Dorothée: Noortjeprullemie.blogspot.be Written for Compagnie M.: m.com

RECEPTEERKUNDE: PRODUCTZORG EN BEREIDING VAN GENEESMIDDELEN (DUTCH EDITION) FROM BOHN STAFLEU VAN LOGHUM

It s all about the money Group work

Laboratory report. Independent testing of material surfaces. Analysis of leaching substances in treated wood samples conform guide line EU 10/2011

LONDEN MET 21 GEVARIEERDE STADSWANDELINGEN 480 PAGINAS WAARDEVOLE INFORMATIE RUIM 300 FOTOS KAARTEN EN PLATTEGRONDEN

LDA Topic Modeling. Informa5ekunde als hulpwetenschap. 9 maart 2015

Het is geen open boek tentamen. Wel mag gebruik gemaakt worden van een A4- tje met eigen aantekeningen.

2019 SUNEXCHANGE USER GUIDE LAST UPDATED

i(i + 1) = xy + y = x + 1, y(1) = 2.

The first line of the input contains an integer $t \in \mathbb{n}$. This is followed by $t$ lines of text. This text consists of:

TOEGANG VOOR NL / ENTRANCE FOR DUTCH : lator=c&camp=24759

CHROMA STANDAARDREEKS

L.Net s88sd16-n aansluitingen en programmering.

Davide's Crown Caps Forum

Firewall van de Speedtouch 789wl volledig uitschakelen?

Concept of Feedback. P.S. Gandhi Mechanical Engineering IIT Bombay

Meetkunde en Lineaire Algebra

Introductie in flowcharts

Empowerment project. Driejarig project van Rotaryclub Rhenen-Veenendaal

04/11/2013. Sluitersnelheid: 1/50 sec = 0.02 sec. Frameduur= 2 x sluitersnelheid= 2/50 = 1/25 = 0.04 sec. Framerate= 1/0.

Global TV Canada s Pulse 2011

TECHNISCHE UNIVERSITEIT EINDHOVEN Faculteit Wiskunde en Informatica. Examination 2DL04 Friday 16 november 2007, hours.

0515 DUTCH (FOREIGN LANGUAGE)

Pure Bending. A beam satisfying above given requirements are shown below: Why this surface is called neutral will be explained later in the lecture.

How to install and use dictionaries on the ICARUS Illumina HD (E652BK)

Persoonlijke informatie / Personal information

Tentamen T1 Chemische Analysemethoden 6 maart 2014

Hoe met Windows 8 te verbinden met NDI Remote Office (NDIRO) How to connect With Windows 8 to NDI Remote Office (NDIRO

Activant Prophet 21. Prophet 21 Version 12.0 Upgrade Information

!!!! Wild!Peacock!Omslagdoek!! Vertaling!door!Eerlijke!Wol.!! Het!garen!voor!dit!patroon!is!te!verkrijgen!op! Benodigdheden:!!

My Inspiration I got my inspiration from a lamp that I already had made 2 years ago. The lamp is the you can see on the right.

Exercise P672 Lightweight Structures. A.P.H.W. Habraken. Report

L.Net s88sd16-n aansluitingen en programmering.

20 twenty. test. This is a list of things that you can find in a house. Circle the things that you can find in the tree house in the text.

FOR DUTCH STUDENTS! ENGLISH VERSION NEXT PAGES. Tentamen Inleiding Kansrekening 1 27 maart 2013

Online Resource 1. Title: Implementing the flipped classroom: An exploration of study behaviour and student performance

Ontpopping. ORGACOM Thuis in het Museum

FRAME [UPRIGHT MODEL] / [DEPTH] / [HEIGHT] / [FINISH] TYPE OF BASEPLATE P Base plate BP80 / E alternatives: ZINC finish in all cases

Intermax backup exclusion files

Daylight saving time. Assignment

De grondbeginselen der Nederlandsche spelling / Regeling der spelling voor het woordenboek der Nederlandsche taal (Dutch Edition)

Never trust a bunny. D. J. Bernstein University of Illinois at Chicago. Tanja Lange Technische Universiteit Eindhoven

1a. We werken het geval voor het tandenpoetsen uit. De concepten zijn (we gebruiken Engelse termen en afkortingen):

Het Effect van Verschil in Sociale Invloed van Ouders en Vrienden op het Alcoholgebruik van Adolescenten.

AE1103 Statics. 25 January h h. Answer sheets. Last name and initials:

This appendix lists all the messages that the DRS may send to a registrant's administrative contact.

Puzzle. Fais ft. Afrojack Niveau 3a Song 6 Lesson A Worksheet. a Lees de omschrijvingen. Zet de Engelse woorden in de puzzel.

Issues in PET Drug Manufacturing Steve Zigler PETNET Solutions April 14, 2010

Stretching T. Mertens

Illustrator Tutorial - How to Create a Watch

Example. Dutch language lesson. Dutch & German Language Education Pieter Wielick

OPEN TRAINING. Onderhandelingen met leveranciers voor aankopers. Zeker stellen dat je goed voorbereid aan de onderhandelingstafel komt.

Buy Me FILE 5 BUY ME BK 2

De Branch-and-Bound methode

3e Mirror meeting pren April :00 Session T, NVvA Symposium

MyDHL+ Exportzending aanmaken

ESOMAR PAPER: Four simple strategies: 25% more ROI for newspaper advertisement

Impact en disseminatie. Saskia Verhagen Franka vd Wijdeven

/ /

GOVERNMENT NOTICE. STAATSKOERANT, 18 AUGUSTUS 2017 No NATIONAL TREASURY. National Treasury/ Nasionale Tesourie NO AUGUST

Transcriptie:

Sanders/van Stee: Approximations- und Online-Algorithmen 1 Bin packing and scheduling Overview Bin packing: problem definition Simple 2-approximation (Next Fit) Better than 3/2 is not possible Asymptotic PTAS Scheduling: minimizing the makespan (repeat) PTAS

Sanders/van Stee: Approximations- und Online-Algorithmen 2 Bin packing: problem definition Input: n items with sizes a 1,...,a n (0,1] Goal: pack these items into a minimal number of bins Each bin has size 1

Sanders/van Stee: Approximations- und Online-Algorithmen 3 Bin packing: problem definition Input: n items with sizes a 1,...,a n (0,1] Goal: pack these items into a minimal number of bins Each bin has size 1

Sanders/van Stee: Approximations- und Online-Algorithmen 4 A simple (online!) algorithm is Next Fit Place items in a bin until next item does not fit Then, close the bin and start a new bin Approximation ratio is 2 (and competitive ratio is also 2)

Sanders/van Stee: Approximations- und Online-Algorithmen 5 A simple (online!) algorithm is Next Fit Place items in a bin until next item does not fit Then, close the bin and start a new bin Approximation ratio is 2 (and competitive ratio is also 2)

Sanders/van Stee: Approximations- und Online-Algorithmen 6 A simple (online!) algorithm is Next Fit Place items in a bin until next item does not fit Then, close the bin and start a new bin Approximation ratio is 2 (and competitive ratio is also 2)

Sanders/van Stee: Approximations- und Online-Algorithmen 7 A simple (online!) algorithm is Next Fit Place items in a bin until next item does not fit Then, close the bin and start a new bin Approximation ratio is 2 (and competitive ratio is also 2)

Sanders/van Stee: Approximations- und Online-Algorithmen 8 A general lower bound It is possible to improve on Next Fit, for instance by using First Fit. However... Lemma 1. There is no algorithm with approximation ratio below 3/2, unless P=NP Proof: reduction from PARTITION PARTITION = given a set of items of total size B, can you split them into two subsets of equal size? This problem is known to be NP-hard

Sanders/van Stee: Approximations- und Online-Algorithmen 9 The reduction Input is a set of items of total size 2 Does this input fit in two bins? An algorithm with approximation ratio < 3/2 must give a packing in two bins (not three) if one exists Thus, it must solve PARTITION, which is NP-hard

Sanders/van Stee: Approximations- und Online-Algorithmen 10 The asymptotic performance ratio This result deals with small inputs What about more reasonable instances? For a given input I, let OPT(I) denote the optimal number of bins needed to pack it Idea: we are interested in the worst ratio for large inputs

Sanders/van Stee: Approximations- und Online-Algorithmen 11 The asymptotic performance ratio sup I A(I) OPT(I) Note: we also use this measure to compare online algorithms

Sanders/van Stee: Approximations- und Online-Algorithmen 12 The asymptotic performance ratio sup I A(I) OPT(I) Note: we also use this measure to compare online algorithms

Sanders/van Stee: Approximations- und Online-Algorithmen 13 The asymptotic performance ratio R A = limsup n sup I { } A(I) OPT(I) OPT(I)=n. Note: we also use this measure to compare online algorithms

Sanders/van Stee: Approximations- und Online-Algorithmen 14 A positive result We can show the following theorem: Theorem 1. For any ε>0, there is an algorithm A ε that runs in time polynomial in n and for which A ε (I) (1+2ε)OPT(I)+1 I Meaning: you can get as close to the optimal solution as you want The degree of the polynomial depends on ε: the closer you want to get to the optimum, the more time it takes

Sanders/van Stee: Approximations- und Online-Algorithmen 15 A simple case All items have size at least ε at most M = 1/ε items fit in a bin There are only K different item sizes at most R= ( M+K) M bin types (M items in a bin, K+ 1 options per item) We know that at most n bins are needed to pack all items at most ( n+r) R feasible packings need to be checked We can do this in polynomial (in n) time Note: this is extremely impractical Example: n=50,k = 6,ε=1/3, then 1.98 10 37 options

Sanders/van Stee: Approximations- und Online-Algorithmen 16 Generalizing the simple case (1) Suppose there are more different item sizes (at most n). Do the following: Sort items Make groups containing nε 2 items In each group, round sizes up to largest size in group

Sanders/van Stee: Approximations- und Online-Algorithmen 17 Generalizing the simple case (2) So far we had a lower bound of ε on the item sizes. How do we pack instances that also contain such small items? Ignore items < ε (small items) at the start Apply algorithm on remaining items Fill up bins with small items

Sanders/van Stee: Approximations- und Online-Algorithmen 18 The small items If all small items fit in the bins used to pack L, we use no more than OPT(L) bins Else, all bins except the last are full by at least 1 ε OPT(I) is at least the total size of all the items OPT(I) ALG(I) 1 1 ε ALG(I) (1+2ε)OPT(I)+1 This proves the theorem.

Sanders/van Stee: Approximations- und Online-Algorithmen 19 A better solution The core algorithm is very much brute force We can improve by using dynamic programming We no longer need a lower bound on the sizes There are k different item sizes An input is of the form (n 1,...,n k ) We want to calculate OPT(n 1,...,n k ), the optimal number of bins to pack this input

Sanders/van Stee: Approximations- und Online-Algorithmen 20 The base case Consider an input (n 1,...,n k ) with n= n j items Determine set of k-tuples (subsets of the input) that can be packed into a single bin That is, all tuples (q 1,...,q k ) for which OPT(q 1,...,q k )=1 and for which 0 q j n j for all j There are at most n k such tuples, each tuple can be checked in linear time (Exercise: there are at most(n/k) k such tuples) Denote this set by Q

Sanders/van Stee: Approximations- und Online-Algorithmen 21 Dynamic programming For each k-tuple q Q, we have OPT(q)=1 Calculate remaining values by using the recurrence OPT(i 1,...,i k )=1+min q Q OPT(i 1 q 1,...,i k q k ) Exercise: think about the order in which we can calculate these values Each value takes O(n k ) time, so we can calculate all values in O(n 2k ) time This gives us in the end the value of OPT(n 1,...,n k )

Sanders/van Stee: Approximations- und Online-Algorithmen 22 Advantages Much faster than simple brute force Can be used to create PTAS for load balancing! PTAS from Algorithmentechnik: separate l largest jobs assign them optimally add smallest jobs greedily Time O(m l + n). For ε=1/3,m=15 we have m l = 8.5 10 32. This PTAS could only be used for very small m and large ε.

Sanders/van Stee: Approximations- und Online-Algorithmen 23 Scheduling Independent Weighted Jobs on Parallel Machines x( j): Machine where job j is executed 1 2 3 4 5 n... t i L i : x( j)=i t j, load of machine i... Objective: Minimize Makespan??...? L max = max i L i... 1 2 m Details: Identical machines, independent jobs, known processing times, offline NP-hard

Sanders/van Stee: Approximations- und Online-Algorithmen 24 Old results Greedy algorithm is (2 1 m )-approximation LPT is (4/3 1 3m )-approximation New result: PTAS for load balancing Idea: find optimal makespan using binary search

Sanders/van Stee: Approximations- und Online-Algorithmen 25 A step in the binary search Let current guess for the makespan be t

Sanders/van Stee: Approximations- und Online-Algorithmen 26 A step in the binary search Let current guess for the makespan be t Remove small items: smaller than tε

Sanders/van Stee: Approximations- und Online-Algorithmen 27 A step in the binary search Let current guess for the makespan be t Remove small items: smaller than tε Round remaining sizes down using geometric rounding

Sanders/van Stee: Approximations- und Online-Algorithmen 28 A step in the binary search Let current guess for the makespan be t Remove small items: smaller than tε Round remaining sizes down using geometric rounding Find optimal solution in bins of size t

Sanders/van Stee: Approximations- und Online-Algorithmen 29 A step in the binary search Let current guess for the makespan be t Remove small items: smaller than tε Round remaining sizes down using geometric rounding Find optimal solution in bins of size t Extend to near-optimal solution for entire input

Sanders/van Stee: Approximations- und Online-Algorithmen 30 A step in the binary search Let current guess for the makespan be t Remove small items: smaller than tε Round remaining sizes down using geometric rounding Find optimal solution in bins of size t Extend to near-optimal solution for entire input More than m bins needed: increase t At most m bins needed: decrease t

Sanders/van Stee: Approximations- und Online-Algorithmen 31 Geometric rounding Each large item is rounded down so that its size is of the form tε(1+ε) i for some i 0 Since large items have size at least tε, this leaves 1 k= log 1+ε ε different sizes

Sanders/van Stee: Approximations- und Online-Algorithmen 32 Geometric rounding Each large item is rounded down so that its size is of the form tε(1+ε) i for some i 0 Since large items have size at least tε, this leaves 1 k= log 1+ε ε different sizes We find a packing for the rounded down items in bins of size t

Sanders/van Stee: Approximations- und Online-Algorithmen 33 Geometric rounding Each large item is rounded down so that its size is of the form tε(1+ε) i for some i 0 Since large items have size at least tε, this leaves 1 k= log 1+ε ε different sizes We find a packing for the rounded down items in bins of size t This gives a valid packing in bins of size t(1+ε)

Sanders/van Stee: Approximations- und Online-Algorithmen 34 Geometric rounding Each large item is rounded down so that its size is of the form tε(1+ε) i for some i 0 Since large items have size at least tε, this leaves 1 k= log 1+ε ε different sizes We find a packing for the rounded down items in bins of size t This gives a valid packing in bins of size t(1+ε) We add the small items to those bins (and to new bins if needed)

Sanders/van Stee: Approximations- und Online-Algorithmen 35 Comparing to the optimal solution We use bins of size t(1+ε) Claim: OPT needs at least as many bins of size t to pack these items

Sanders/van Stee: Approximations- und Online-Algorithmen 36 Comparing to the optimal solution We use bins of size t(1+ε) Claim: OPT needs at least as many bins of size t to pack these items Proof: If we need no extra bins for the small items, we have found an optimal packing for the rounded down items in bins of size t

Sanders/van Stee: Approximations- und Online-Algorithmen 37 Comparing to the optimal solution We use bins of size t(1+ε) Claim: OPT needs at least as many bins of size t to pack these items Proof: If we need no extra bins for the small items, we have found an optimal packing for the rounded down items in bins of size t Else, all bins (except maybe the last one) are full by at least t

Sanders/van Stee: Approximations- und Online-Algorithmen 38 Connection between bin packing and scheduling We look for the smallest t such that we can pack the items in m bins (machines). Suppose that we can find the exact value of t Then, OPT also needs m bins of size t to pack these items In other words, the makespan on m machines is at least t. (For smaller t, the items cannot all be placed below a level of t.)

Sanders/van Stee: Approximations- und Online-Algorithmen 39 The binary search We start with the following lower bound on OPT: { } LB=max t j /m,maxt j j Greedy gives a schedule which is at most twice this value, this is an upper bound for OPT Each step of the binary search halves this interval We repeat until the length of the interval is at most ε LB Let T be the upper bound of this interval Then T OPT+ ε LB (1+ε) OPT The makespan of our algorithm is at most(1+ε)t

Sanders/van Stee: Approximations- und Online-Algorithmen 40 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT.

Sanders/van Stee: Approximations- und Online-Algorithmen 41 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT. Notes: 1 The number of item sizes is k= log 1+ε ε

Sanders/van Stee: Approximations- und Online-Algorithmen 42 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT. Notes: 1 The number of item sizes is k= log 1+ε ε 1 The number of iterations in the binary search is log 2 ε

Sanders/van Stee: Approximations- und Online-Algorithmen 43 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT. Notes: 1 The number of item sizes is k= log 1+ε ε 1 The number of iterations in the binary search is log 2 ε The running time of the dynamic programming algorithm is O(n 2k )

Sanders/van Stee: Approximations- und Online-Algorithmen 44 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT. Notes: 1 The number of item sizes is k= log 1+ε ε 1 The number of iterations in the binary search is log 2 ε The running time of the dynamic programming algorithm is O(n 2k ) 1 The running time of our algorithm is O( log 2 ε n 2k ) n=50,ε=1/3 7.8 10 13 options

Sanders/van Stee: Approximations- und Online-Algorithmen 45 Conclusion Theorem 2. For any ε>0, there is an algorithm A ε which works in polynomial time in n and which gives a schedule with makespan at most (1+ε) 2 OPT <(1+3ε)OPT. Notes: 1 The number of item sizes is k= log 1+ε ε 1 The number of iterations in the binary search is log 2 ε The running time of the dynamic programming algorithm is O(n 2k ) 1 The running time of our algorithm is O( log 2 ε n 2k ) There is no FPTAS for this problem