4.1 Interval Scheduling. Chapter 4. Greedy Algorithms. Interval Scheduling. Interval Scheduling: Greedy Algorithms

Similar documents
The Mathematics of Sudoku

Uses for Binary Trees -- Binary Search Trees

A New Efficient Distributed Load Balancing Algorithm for OTIS-Star Networks

PRESENTED TO. Data Leakage Worldwide: The Effectiveness of Corporate Security Policies

Recall from Last Time: Disjoint Set ADT

1.- L a m e j o r o p c ió n e s c l o na r e l d i s co ( s e e x p li c a r á d es p u é s ).

Form: Parental Consent for Blood Donation

DATA MANAGEMENT POLICY. SUMMARY OF PRINCIPAL CHANGES General changes None for amendments in this revision, refer to Appendix II, UPR IM16.

H ig h L e v e l O v e r v iew. S te p h a n M a rt in. S e n io r S y s te m A rc h i te ct

A122 MARION COUNTY HEALTH BUILDING HVAC, GLAZING AND LIGHTING RENOVATION 75% DOCUMENTS 08/31/2015

Victims Compensation Claim Status of All Pending Claims and Claims Decided Within the Last Three Years

EuroFGI Workshop on IP QoS and Traffic Control TITOLO. A Receiver Side Approach for Real-Time Monitoring of IP Performance Metrics

MPLS FOR MISSION-CRITICAL MICROWAVE NETWORKS BUILDING A HIGHLY RESILIENT MICROWAVE NETWORK WITH MULTI-RING TOPOLOGY

M P L S /V P N S e c u rity , C is c o S y s te m s, In c. A ll rig h ts re s e rv e d.

/*

tis, cis cunc - cunc - tis, cis tis, cis cunc - tis, func - def - def - tis, U func - def - func - tis, pa - tri pa - tri pa - tri tu - per - tu -

Attorney Directory. Prepared for on 12/8/2008. Helping you balance work and life. To use your plan:

Reading. Minimum Spanning Trees. Outline. A File Sharing Problem. A Kevin Bacon Problem. Spanning Trees. Section 9.6

Matching Execution Histories of Program Versions

11 + Non-verbal Reasoning

A simple algorithm to generate the minimal separators and the maximal cliques of a chordal graph

Distributed Systems Principles and Paradigms. Chapter 11: Distributed File Systems. Distributed File Systems. Example: NFS Architecture


ELECTRICAL CAPACITY SYMBOL EQUIPMENT TYPE LOCATION / SERVING MFR MODEL (GALLONS) VOLTS PH AMPS WATTS

Campus Sustainability Assessment and Related Literature

B rn m e d s rlig e b e h o v... 3 k o n o m i S s k e n d e tils k u d o g k o n o m is k frip la d s... 7 F o r ld re b e ta lin g...

Inductive Proximity Sensors For Reliable Precision Feedback

Paper Technics Orientation Course in Papermaking 2009:

Hermes: Dynamic Partitioning for Distributed Social Network Graph Databases

CompactPCI Connectors acc. to PIGMG 2.0 Rev. 3.0

Erfa rin g fra b y g g in g a v

Frederikshavn kommunale skolevæsen

- ASSEMBLY AND INSTALLATION -

Chapter 3 Chemical Equations and Stoichiometry

Operation Transform Formulae for the Generalized. Half Canonical Sine Transform


EM EA. D is trib u te d D e n ia l O f S e rv ic e

Endomines - Ilomantsi Gold Project

W h a t is m e tro e th e rn e t

B a rn e y W a r f. U r b a n S tu d ie s, V o l. 3 2, N o. 2, ±3 7 8

1. Oblast rozvoj spolků a SU UK 1.1. Zvyšování kvalifikace Školení Zapojení do projektů Poradenství 1.2. Financování

Schedule C. Notice in terms of Rule 5(10) of the Capital Gains Rules, 1993


Opis przedmiotu zamówienia - zakres czynności Usługi sprzątania obiektów Gdyńskiego Centrum Sportu

News English.com Ready-to-Use English Lessons by Sean Banville Level 6 Travelling to and from work is work, says EU

Oracle PL/SQL Programming Advanced

w ith In fla m m a to r y B o w e l D ise a se. G a s tro in te s tin a l C lin ic, , K a s h iw a z a, A g e o C ity, S a ita m a

Two-stage Framework for Visualization of Clustered High Dimensional Data

PC Problems HelpDesk Service Agreement

Masters Mens Physique 45+

News English.com Ready-to-Use English Lessons by Sean Banville

FILTER TECHNICAL DATA COMPONENTS


V e r d e s I s t v á n a l e z r e d e s V Á L T O Z Á S O K. F E L A D A T O K. GONDOK A S O R K A TO N A I

*Not on the Table of Information for Physics C, since Thermodynamics is not a Physics C topic.

Using Predictive Modeling to Reduce Claims Losses in Auto Physical Damage



U.S. Department of Housing and Urban Development: Weekly Progress Report on Recovery Act Spending

With Rejoicing Hearts/ Con Amor Jovial. A Fm7 B sus 4 B Cm Cm7/B

PIN #1 ID FIDUCIAL LOCATED IN THIS AREA TOP VIEW. ccc C SIDE VIEW

Authenticated Encryption. Jeremy, Paul, Ken, and Mike

COMPUTER NETWORKS Protocol architectures

WAVEGUIDES (& CAVITY RESONATORS)

Lessons On Movies.com MUCH ADO ABOUT NOTHING

CC01[PE] 4mm² BLK. 16mm² [CC01] ASSEMBLY PLATE CB10PE. 16mm². 16mm²

Menu Structure. Section 5. Introduction. General Functions Menu

SEPTEMBER Unit 1 Page Learning Goals 1 Short a 2 b 3-5 blends 6-7 c as in cat 8-11 t p

Change Your History How Can Soccer Knowledge Improve Your Business Processes?

3 Signals and Systems: Part II

Federation of State Boards of Physical Therapy Jurisdiction Licensure Reference Guide Topic: PTA Supervision Requirements

Lessons On Movies.com THE GREAT GATSBY.

Elements from Another Universe: Understanding the Beauty of the Periodic Table

Binary Search Trees. Definition Of Binary Search Tree. The Operation ascend() Example Binary Search Tree

indirect electro-pneumatic, pneumatic, manual, mechanical pneumatic spring, mechanical spring G1/8 6,5 890

Table 12: Availability Of Workers Compensation Insurance Through Homeowner s Insurance By Jurisdiction

WIRING DIAGRAMS 0. Wire Color. Circuit. Connector. Wire Position in Connector. Wire Identification. Connector Location

The Lincoln National Life Insurance Company Variable Life Portfolio

Transient Voltage Suppressor SMBJ5.0 - SMBJ440CA

SCO TT G LEA SO N D EM O Z G EB R E-

i n g S e c u r it y 3 1B# ; u r w e b a p p li c a tio n s f r o m ha c ke r s w ith t his å ] í d : L : g u id e Scanned by CamScanner

A Quick Guide to Colleges. Offering Engineering Degrees

With content marketing, you can move beyond measuring success in terms of impressions, awareness, or perception.

The Cat in the Hat. by Dr. Seuss. A a. B b. A a. Rich Vocabulary. Learning Ab Rhyming

Roof Terraces. Structural assemblies

I n la n d N a v ig a t io n a co n t r ib u t io n t o eco n o m y su st a i n a b i l i t y

SEE PAGE 2 FOR BRUSH MOTOR WIRING SEE PAGE 3 FOR MANUFACTURER SPECIFIC BLDC MOTOR WIRING EXAMPLES A

Mathematics. Vectors. hsn.uk.net. Higher. Contents. Vectors 128 HSN23100

Federation of State Boards of Physical Therapy Jurisdiction Licensure Reference Guide Topic: Continuing Competence

az évi L X V. tv á ra figyelem m el 20. sz á m ú UTASÍTÁSA B u d a p e s t, é v i jú liu s hó 2 8 -á n.

Jesus Performed Miracles

Earthquake Hazard Zones: The relative risk of damage to Canadian buildings

Transcription:

1 ptr 4 41 Intrvl Suln ry lortms Sls y Kvn Wyn opyrt 5 Prson-son Wsly ll rts rsrv Intrvl Suln Intrvl Suln: ry lortms Intrvl suln Jo strts t s n nss t Two os omptl ty on't ovrlp ol: n mxmum sust o mutully omptl os ry tmplt onsr os n som orr Tk o prov t's omptl wt t ons lry tkn Wt orr? os tt v st nswr? Wy or wy not? os t lp to ry out orr? 3 4

5 Intrvl Suln: ry lortms Intrvl Suln: ry lortms ry tmplt onsr os n som orr Tk o prov t's omptl wt t ons lry tkn ry tmplt onsr os n som orr Tk o prov t's omptl wt t ons lry tkn [rlst strt tm] onsr os n snn orr o strt tm s [rlst ns tm] onsr os n snn orr o ns tm rks rlst strt tm [Sortst ntrvl] onsr os n snn orr o ntrvl lnt - s rks sortst ntrvl [wst onlts] or o, ount t numr o onltn os Sul n snn orr o onlts rks wst onlts 6 Intrvl Suln: ry lortm Intrvl Suln ry lortm onsr os n nrsn orr o ns tm Tk o prov t's omptl wt t ons lry tkn Sort os y ns tms so tt 1 n os slt φ or = 1 to n { (o omptl wt ) {} } rturn 1 3 4 5 6 7 8 9 1 11 Implmntton O(n lo n) Rmmr o * tt ws lst to Jo s omptl wt s * 7 8

9 Intrvl Suln Intrvl Suln 1 3 4 5 6 7 8 9 1 11 1 3 4 5 6 7 8 9 1 11 1 Intrvl Suln Intrvl Suln 1 3 4 5 6 7 8 9 1 11 1 3 4 5 6 7 8 9 1 11 11 1

13 Intrvl Suln Intrvl Suln 1 3 4 5 6 7 8 9 1 11 1 3 4 5 6 7 8 9 1 11 14 Intrvl Suln Intrvl Suln 1 3 4 5 6 7 8 9 1 11 1 3 4 5 6 7 8 9 1 11 15 16

17 Intrvl Suln: orrtnss Torm ry lortm s optml P ( ry stys ) Lt 1,, k os pk y ry, 1,, m tos n som optml soluton Sow ( r ) ( r ) y nuton on r ss: 1 osn to v mn ns tm, so ( 1 ) ( 1 ) In: ( r ) ( r ) s( r+1 ), so r+1 s mon t nts onsr y ry wn t pk r+1, & t pks mn ns, so ( r+1 ) ( r+1 ) Smlrly, k m, ls k+1 s mon (nonmpty) st o nts or k+1 o r+1 strts tr r ns, so nlu n mn( ) 41 Intrvl Prttonn ry: 1 1 r r+1 OPT: 1 r r+1 Intrvl Prttonn Intrvl Prttonn s Intrvl rp olorn Intrvl prttonn Ltur strts t s n nss t ol: n mnmum numr o lssrooms to sul ll lturs so tt no two our t t sm tm n t sm room Vrts = lsss; s = onltn lss prs; rnt olors = rnt ssn rooms Room 4 Not: rp olorn s vry r n nrl, ut rps orrsponn to ntrvl ntrstons r mu smplr spl J s x: Ts sul uss 4 lssrooms to sul 1 lturs Room 3 Room Room 1 I 9 9:3 1 1:3 11 11:3 1 1:3 1 1:3 :3 3 3:3 4 4:3 9 9:3 1 1:3 11 11:3 1 1:3 1 1:3 :3 3 3:3 4 4:3 19

1 Intrvl Prttonn Intrvl Prttonn: Lowr oun on Optml Soluton Intrvl prttonn Ltur strts t s n nss t ol: n mnmum numr o lssrooms to sul ll lturs so tt no two our t t sm tm n t sm room x: Ts sul uss only 3 T pt o st o opn ntrvls s t mxmum numr tt ontn ny vn tm no ollsons t ns Ky osrvton Numr o lssrooms n pt x: pt o sul low = 3 sul low s optml,, ll ontn 9:3 Q os tr lwys xst sul qul to pt o ntrvls? 9 9:3 1 1:3 11 11:3 1 1:3 1 1:3 :3 3 3:3 4 4:3 9 9:3 1 1:3 11 11:3 1 1:3 1 1:3 :3 3 3:3 4 4:3 Intrvl Prttonn: ry lortm Intrvl Prttonn: ry nlyss ry lortm onsr lturs n nrsn orr o strt tm: ssn ltur to ny omptl lssroom Sort ntrvls y strtn tm so tt s 1 s s n numr o llot lssrooms or = 1 to n { (lt s omptl wt som lssroom k, 1 k ) sul ltur n lssroom k ls llot nw lssroom + 1 sul ltur n lssroom + 1 + 1 } Implmntton O(n lo n) or lssroom Implmntton? k, mntn t ns Run-tm? o t lst o Kp t lssrooms n prorty Nxt quu W? Osrvton ry lortm nvr suls two nomptl lturs n t sm lssroom Torm ry lortm s optml P Lt = numr o lssrooms tt t ry lortm llots lssroom s opn us w n to sul o, sy, tt s nomptl wt ll -1 prvously us lssrooms Sn w sort y strt tm, ll ts nomptlts r us y lturs tt strt no ltr tn s Tus, w v lturs ovrlppn t tm s + ε, pt Ky osrvton ll suls us pt lssrooms, so = pt n ry s optml 3 4

5 Intrvl Prttonn: lt Proo (xn rumnt) Wn 4t room, room 1 ws r; wy not swp t n tr? (: t onlts wt ltr stu n sul, w omnos) ut: room 4 sul tr 11: s onlt-r; so s room 1 sul, so oul swp ot post-11: suls Wy os t lp? lys nn 4t room; rpt 4 Suln to Mnmz Ltnss lnr: Lt S* n opt s wt ltst us o lst room Wn tt room s, ll otrs n us, ls w oul swp, ontrtn ltst 9 9:3 1 1:3 11 11:3 1 1:3 1 1:3 :3 3 3:3 4 4:3 Suln to Mnmz Ltnss Mnmzn Ltnss: ry lortms Mnmzn ltnss prolm Snl rsour prosss on o t tm Jo rqurs t unts o prossn tm n s u t tm I strts t tm s, t nss t tm = s + t Ltnss: l = mx {, - } ol: sul ll os to mnmz mxmum ltnss L = mx l x: 1 3 4 5 6 t 3 1 4 3 6 8 9 9 14 15 ry tmplt onsr os n som orr [Sortst prossn tm rst] onsr os n snn orr o prossn tm t [rlst ln rst] onsr os n snn orr o ln [Smllst slk] onsr os n snn orr o slk - t ltnss = ltnss = mx ltnss = 6 3 = 9 = 8 6 = 15 1 = 6 5 = 14 4 = 9 1 13 14 15 7 8

9 Mnmzn Ltnss: ry lortms Mnmzn Ltnss: ry lortm ry tmplt onsr os n som orr ry lortm rlst ln rst [Sortst prossn tm rst] onsr os n snn orr o prossn tm t t 1 1 1 ountrxmpl [Smllst slk] onsr os n snn orr o slk - t t 1 1 1 1 1 1 ountrxmpl Sort n os y ln so tt 1 n t or = 1 to n ssn o to ntrvl [t, t + t ] s t, t + t t t + t output ntrvls [s, ] 1 t 3 6 8 3 1 9 1 = 6 = 8 3 = 9 4 = 9 5 = 14 6 = 15 1 13 14 15 4 4 9 5 3 14 6 15 mx ltnss = 1 3 Mnmzn Ltnss: No Il Mnmzn Ltnss: Invrsons Osrvton Tr xsts n optml sul wt no l tm = 4 = 6 = 1 = 4 = 6 = 1 n nvrson n sul S s pr o os n su tt: ln < ut sul or nvrson k ltr ln rlr ln Osrvton ry sul s no nvrsons Osrvton T ry sul s no l tm Osrvton I sul (wt no l tm) s n nvrson, t s on wt pr o nvrt os sul onsutvly (I & rn t onsutv, tn look t t o k sul rt tr I k <, tn (,k) s onsutv nvrson; not, tn (k,) s n nvrson, & nrr to otr - rpt) Osrvton Swppn nt nvrson rus # nvrsons y 1 (xtly) 31 3

33 Mnmzn Ltnss: Invrsons Mnmzn Ltnss: No Invrsons n nvrson n sul S s pr o os n su tt: ln < ut sul or nvrson or swp tr swp lm Swppn two onsutv, nvrt os rus t numr o nvrsons y on n os not nrs t mx ltnss ' ( ltr ln, so s lss try tn ws) lm ll nvrson-r suls S v t sm mx ltnss P I S s no nvrsons, tn lns o sul os r monotonlly nonrsn,, ty nrs (or sty t sm) s w wlk trou t sul rom lt to rt Two su suls n r only n t orr o os wt t sm lns Wtn roup o os wt t sm ln, t mx ltnss s t ltnss o t lst o n t roup - orr wtn t roup osn t mttr ln 5 ln 1 ln 18 P Lt l t ltnss or t swp, n lt l ' t trwrs l' k = l k or ll k, l' l only movs l " I o s now lt: = " # (nton) ltr, ut t s = # ( nss t tm ) no ltr tn $ # ( $ ) ws, so mx not = l (nton) nrs t=1 ltnss 34! Mnmzn Ltnss: orrtnss o ry lortm ry nlyss Strts Torm ry sul S s optml P Lt S* n optml sul wt t wst numr o nvrsons n ssum S* s no l tm I S* s n nvrson, lt - n nt nvrson Swppn n os not nrs t mxmum ltnss n strtly rss t numr o nvrsons Ts ontrts nton o S* So, S* s no nvrsons ut tn Ltnss(S) = Ltnss(S*) ry lortm stys Sow tt tr stp o t ry lortm, ts soluton s t lst s oo s ny otr lortm's Struturl sovr smpl "struturl" oun ssrtn tt vry possl soluton must v rtn vlu Tn sow tt your lortm lwys vs ts oun xn rumnt rully trnsorm ny soluton to t on oun y t ry lortm wtout urtn ts qulty 35 36

Optml Oln n 1 43 Optml n Pronunton: 'ks unton: noun tymoloy: rn, rom r to prss, n pl splly or onln n prsrvn provsons or mplmnts unton: trnstv vr to pl,, or stor n -Wstr s tonry n wt pty to stor k tms Squn o m tm rqusts 1,,, m t: tm lry n wn rqust mss: tm not lry n wn rqust: must rn rqust tm nto, n vt som xstn tm, ull ol vton sul tt mnmzs numr o msss x: k =, ntl =, rqusts:,,,,,,, Optml vton sul: msss rqusts 38 Optml Oln n: rtst-in-utur rtst-n-utur vt tm n t tt s not rqust untl rtst n t utur urrnt : utur qurs: mss t ts on Torm [lly, 196s] s optml vton sul P lortm n torm r ntutv; proo s sutl Motvton: Onln prolm s typlly wt s n n prt - wt to vt wtout sn t utur ow to vlut su n l? wr msss s ovously ttr, ut ow w? s usul nmrk - st onln l s unknown, ut t s no ttr tn, so onln prormn los to s s t st you n op or 4