0% found this document useful (0 votes)
10 views8 pages

Lect 10

Uploaded by

20bsm033
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
10 views8 pages

Lect 10

Uploaded by

20bsm033
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 8
DYNAMIC PROGRAMMING WE witt Now Discuss ANOTHER ALGORITHMIC PARADIGM, DYNAMIC PROGRAMMING, we BEGIN WiTh AN ExAmece. SCWEDULING Joss WITH DEADLINES, PROFITS AND DURATIONS qwput: A List of sobs (d,49,),.---) Cdy ty 9.) deadline’ duration ——~ profit A schedule C = 60), C62), -, Cn) CLi) is the time at which job i scheduled to begin cle)#-1 means job i wot scheduled A sehedule 1s feasible tf f) Vi C)Fo D cle ted : : Lach job scheduled Amishes by ds deadline Ww weay CW)FO and C())20 either Cidet 4G) or CD44 # eli) No two jobs overlap The profit of « feasible schedule C, Plc) = B_ 4, 20 DUTFUT: A feasible schedule C such that PE) is dhe maximum possible WE FIRST SORT JOBS SUCH THAT aed. €... €d.ed LEMMA Let ¢ BE A FEASIBLE SCHEDULE such THAT AT Least ONG SoS 1S SCHEDULED. LeT i BE THE LARGEST gen NUMBER SCHEDULED IN C. LeT EVERY JOB SCHEDULED IW C FINISH By Time ¢. qMEN THERE ts A FEASIBLE SCHEDULE C' THAT SCHEDULES SNAE JOS AS C AND SUCH THAT cays mm {t43-t, AND SUCH THAT ALL OTHER 36S SCHEDULED BY c! ENO AT OR BEFORE minft,a.5-t; . Rroot_ sketch Enomple. Sugpose ‘jos 1,43 scheduled by C as Follows, c 4, 44 . Sa St os "Seb 3 Tob 2, é th bo i chad Tob Zz Tob 3 Glam Sob i can be shited eight to end at time mint, Ay. Thea all jobs to rqht GQ yb i con be shilted elt by same amount, DYNAMIC PROGRAMMING ALG HMA @ describe orray of values we want to compute 84) = mon} PC) [Cis a feasible schedule tn which only joks yom §i,.,i3 are | screduled and all jobs scheduled finish by time 4 otien, of tS A Ren,d) = desired output © gue recurrence for computing values of A ne row at a tue * Alo,t) = ostsd fo lecen, oS t6a Let tl = min fd; £3 -4; 4b is latest postiide, the that job iL can be scheduled yo end Noy “Hs deadline ond end by time t. Aut) = AuAa,#) 1 t Reo ov Otten, osted cary &e)+0 Shewiny AltA Lt) iro Case 4: U whith only jobs fom Li} ont scheduled , all sols Finish by te t, and C has maximn prtt. Case t © does wot schedule job tran © schedules only joes from tend so mene Mc equals AC1,4). thus Mit) s MEO. case 1 C schedules yole i. Lemma, There exists feasible C! where ct schedules same jes as C, schedules & begmning at time €! end all other jobs scheduled end by t! 1. tle!) = pe) = Bt) Lak Ch be same as Cy but Cr dotsit schedule jel c then pce y= Ait) -9, Rid 5 Ree) > AG) < Meee gy @ High LVEL PROGRAM FOR comruTWs A [* tefo..,d3 Blp,tJ ée~, te%,., tw, aa aSm Gr -29e DP algordnm has cunteme OlnC)

You might also like