w orst case e cien t data structures gerth st lting bro
play

W orst Case Ecien t Data Structures Gerth Stlting Bro dal - PowerPoint PPT Presentation

W orst Case Ecien t Data Structures Gerth Stlting Bro dal BRICS Departmen t of Computer Science Univ ersit y of Aarh us and MaxPlanc kInstitut f ur Informatik Saarbr uc k en Ov erview


  1. W orst Case E�cien t Data Structures Gerth St�lting Bro dal BRICS Departmen t of Computer Science Univ ersit y of Aarh us and Max�Planc k�Institut f � ur Informatik Saarbr uc � k en �

  2. Ov erview � Priorit y queues Comparison based data structures � Lo w er b ounds for comparison based data structures � RAM data structures � P arallel data structures � � P artial p ersisten t data structures G� S� Bro dal� W orst case e�cien t data structures �

  3. Priorit y Queues Main tain a set of elemen ts from a totally ordered univ erse �sa y n in tegers� under the op erations� � FindMin � Q � �� � t � Q� e � Inser �� �� �� � DeleteMin � Q � �� � Delete � Q� e �� �� �� �� � Meld � Q � � Q � � �� �� � � DecreaseKey � Q� �� e� e �� �Assume the lo cation of is kno wn� e G� S� Bro dal� W orst case e�cien t data structures �

  4. Priorit y Queues Man y priorit y queues are based on heap ordered trees� �� i�e� � eac h no de stores an elemen t and the elemen t stored �� �� �� at a no de is � the elemen t stored at the no de�s parren t� �� �� �� The priorit y queues �heaps� of Willi ams are �� based on one heap ordered binary tree� �� �� �� � and can b e p er� Inser t DeleteMin �� �� �� �� formed in �log n � time� O Willi ams ���� �� �� �� G� S� Bro dal� W orst case e�cien t data structures �

  5. Linking Heap Ordered T rees More recen t data structures are �� �� �� based on linking heap ordered �� �� �� �� �� �� �� trees of the same size� �� �� �� �� �� �� Ex�� Binomial Queues are based on �log n � heap ordered trees� O �� �� �� �� �� Inser t ���� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� Binomial queues supp ort and in amortized Theorem Inser t Meld constan t time and in amortized �log n � time� O DeleteMin V uillemin ���� G� S� Bro dal� W orst case e�cien t data structures �

  6. Constan t Time Meldable Priorit y Queues and can b e supp orted in w orst case Theorem Inser t Meld constan t time and in w orst case �log n � time� DeleteMin O � One heap ordered tree� �� 0 � One linking p er and Meld � Inser t �� 3 � ��� or � sons of eac h rank �� �� �� �� �� �� 2 1 1 1 0 2 less than the paren t�s rank� �� �� �� �� �� �� �� �� � one arbitrary rank ed son� 1 0 0 0 0 1 1 0 �� �� �� �� �� � The ro ot has rank �� 0 0 0 1 0 �� �� 0 0 Bro dal ���� G� S� Bro dal� W orst case e�cien t data structures �

  7. Constan t Time DecreaseKey Fib onacci heaps supp ort in amortized Theorem DecreaseKey constan t time and in amortized �log n � time� DeleteMin O F redman� T arjan ���� Relaxed heaps supp ort in w orst case Theorem DecreaseKey constan t time and in w orst case �log n � time� O DeleteMin Meld requires ��log n � time� Driscoll� Gab o w� Shrairman� T arjan ���� and can b e supp orted in w orst Theorem DecreaseKey Meld case constan t time and in w orst case �log n � time� O DeleteMin Bro dal ���� � ��� heap ordered trees� O � Relaxed heaps� � A n um b er of in v arian ts to solv e the tec hnical dep endencies � G� S� Bro dal� W orst case e�cien t data structures �

  8. Comparison Based Priorit y Queues Driscoll Gab o w F redman Shrairman Williams V uillemin Bro dal T arjan T arjan Bro dal ���� ���� ���� ���� ���� ���� Heaps Binomial Fib onacci Relaxed Queues� Heaps� Heaps FindMin O��� O��� O��� O��� O��� O��� Inser t O�log n � O��� O��� O��� O��� O��� Meld O� n � O��� O��� O��� O�log n � O��� Delete�Min� O�log n � O�log n � O�log n � O�log n � O�log n � O�log n � DecreaseKey O�log n � O�log n � O�log n � O��� O��� O��� �Amortized b ounds G� S� Bro dal� W orst case e�cien t data structures �

  9. Comparison Based Priorit y Queues Lo w er Bounds Comparison based sorting requires �� n log n � Theorem comparisons� � or require ��log n � comparisons� Inser t DeleteMin If and mak e � t � comparisons� then Theorem Inser t Delete O n requires comparisons� FindMin � t � � O � a doubly link ed list is an optimal priorit y queue implemen tation� � If mak es o � n � comparisons� and � n � Theorem Meld FindMin O comparisons� �� then and require ��log n � � � Delete DeleteMin comparisons� Bro dal� Chaudh uri� Radhakrishnan ���� G� S� Bro dal� W orst case e�cien t data structures �

  10. RAM Priorit y Queues A unit cost Random Access Mac hine with w ord size � Mo del� w �� shifting� bit�wise b o olean op erations� W ord op erations� w In tegers in the range � �� � � �� Elemen ts� Op erations� � FindMin � Q � � t � Q� e � Inser � Delete � Q� e � � Pred � Q� e �� Pred � f �� � �� � �� � �� � �� � �� g � �� � � ��� The ab o v e op erations can b e p erformed in �log � time� Theorem O w v an Emde Boas ���� ��� O � an �log log n � priorit y queue for � log n � O w G� S� Bro dal� W orst case e�cien t data structures ��

  11. RAM Priorit y Queues v an Emde Boas Thorup� Andersson Bro dal ���� ���� ���� ���� FindMin ��� ��� ��� ��� ��� O O O O O p Inser t O �log w � O �log log n � O � log n � O � f � n �� O �log log n � p Delete �log � �log log n � � log n � � f � n �� �log log n � O w O O O O p log log n n Pred �log � � log n � � � � � O w O O O � n � log log f n p log log � n � log n � f � n �Amortized b ounds G� S� Bro dal� W orst case e�cien t data structures ��

  12. Outline of RAM Priorit y Queue � � � n � lev els f van Emde Boas � f � n � � elemen ts �t in to a w ord � log n lev els � n � f �� f � n �� P ac k ed searc h trees of degree � with bu�ers of dela y ed Inser t and op erations� supp orting and in w orst Delete Inser t Delete case � f � n �� time� O � Tw o lev el data structure �v an Emde Boas and pac k ed�� � P ac k ed searc h trees� Andersson ����� � Bu�er trees for external memory � Arge ����� � List merging in ��� w ords� Alb ers� Hagerup ����� O � Standard deamortization tec hniques� Bro dal ���� G� S� Bro dal� W orst case e�cien t data structures ��

  13. Adopting P arallelism to Priorit y Queues Question� Is it p ossible to obtain comparison based priorit y queues supp orting op erations in o �log n � time b y using a non�constan t n um b er of pro cessors � Answ er� Y es� � n � pro cessors can supp ort and O Inser t DeleteMin in constan t time� P P P P P P � � � � � � �� �� �� �� �� �� �� �� �� �� �� �� F olklore G� S� Bro dal� W orst case e�cien t data structures ��

  14. Outline of P arallel Priorit y Queue P P P P � � � � �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� i � Pro cessor P main tains �� � or � trees of size � � i � P arallel linking and unlinking of trees� �log n � pro cessors can supp ort t � and Theorem O Inser Meld in constan t time� An extension of the data structure DeleteMin supp orts and in constan t time to o� Delete DecreaseKey Bro dal ���� G� S� Bro dal� W orst case e�cien t data structures ��

Recommend


More recommend