1 / 31

Constant Time Generation of Linear Extensions

Constant Time Generation of Linear Extensions. Akimitsu Ono Shin-ichi Nakano Gunma Univ. Input Partial ordering P. Out put Complete List of Linear Extensions of P. 1. 2. 3. 4. 1. 3. 4. 2. 1. 2. 1. 3. 2. 4. 3. 1. 4. 2. 3. 4. 3. 1. 2. 4. 3. 4. 1. 2.

lyndon
Télécharger la présentation

Constant Time Generation of Linear Extensions

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Constant Time Generation of Linear Extensions Akimitsu Ono Shin-ichi Nakano Gunma Univ. Input Partial ordering P Out put Complete List of Linear Extensions of P 1 2 3 4 1 3 4 2 1 2 1 3 2 4 3 1 4 2 3 4 3 1 2 4 3 4 1 2

  2. Generation Problems Given a class C of objects we wish to enumerate efficiently every object in C without duplications Application: Test data

  3. Basic Enumeration Algorithm 1 Define a dictionary 2 Design two methods find-first-One find-next-of(x) Algorithm Enumeration x = Find-first-One while x != NIL do Output x x = find-next-of (x) Based on this technique many enumeration algorithms have designed.

  4. Improvement (Combinatorial) Gray Code 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 0000 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1 In general, the output of enumeration algorithmis huge and dominates therunning time. If we only output the difference of the objects, then we can improve the running time a lot. O(n) time/each  O(1) time/each

  5. Hamiltonian Path Vertex ----- Object obj obj obj obj obj obj

  6. Hamiltonian Path Vertex ----- Object Edge ----- difference is constnat obj obj obj obj obj obj

  7. Hamiltonian Path Vertex ----- Object Edge ----- difference is constnat Hamiltonian Path ----- dictionary obj obj obj obj obj obj

  8. Unfortunately Hamiltonian Path may not exist! Vertex ----- Object Edge ----- difference is constnat No Hamiltonian Path ----- No dictionary obj obj obj obj obj obj

  9. Idea: However A Spanning Tree always exists! obj obj obj obj obj obj

  10. Our Enummeration Algorithm obj 1 Define a spanning tree 2 Design two method find-root find-children-of(x) obj obj obj obj obj obj Algorithm find-children-of(x) Output(x) as a difference find-children-of(x) for each child xi do find-children-of(xi) Algorithm enumeration x = find-root find-children-of (x) If we can find k children in O(k) time, then we can find each object O(1) time for each

  11. Our Enumeration Algorithms Based on this technique (output only difference) + (tree structure) we have designed many enumeration algorithms. Biconnected plane triangulations ICALP2001 Triconnected plane triangulations COCOON 2001 Floorplan ISAAC 2001 Planted tree IPL 2002 Free tree WG2004 Linear extension This Talk plane graph

  12. Linear Extensions Many scheduling problems with precedence constraints are modeled by a linear extension of a partial ordering Input Partial ordering P Out put A Linear Extension of P (All arrow go right!) 1 2 3 4 job job 1 2 job job Given a partial ordering P, one can compute a linear extension of P in O(n+m) time. See page 549 of 3 4

  13. Generating All Linear Extensions Input Partial ordering P Out put Complete List of Linear Extensions of P 1 2 3 4 1 3 4 2 1 2 1 3 2 4 3 1 4 2 3 4 3 1 2 4 3 4 1 2

  14. Known Enumeration Algorithms for Linear Extensions • Well 71 O(n)time / each • Knuth, Szwarcfiter 74 O(m+n)time / each • Vorol and Rotem 81 O(n)time / each • Pruesse and Ruskey 94 O(1)time / each on average • This Talk O(1)time / each (worst case)

  15. Pruesse and Ruskey 94 1 2 3 4 Input Partial ordering P 1 3 2 4 1 2 3 1 2 4 1 3 4 2 3 4 3 1 4 2 3 4 1 2

  16. Pruesse and Ruskey 94 If we can find a Hamiltonian Path then we can output each in O(1) time. However,….. 1 2 3 4 Input Partial ordering P 1 3 2 4 1 2 3 1 2 4 1 3 4 2 3 4 3 1 4 2 3 4 1 2

  17. 1 1 2 2 3 3 4 4 1 1 3 3 2 2 4 4 3 3 1 1 2 2 4 4 1 1 3 3 4 4 2 2 3 3 1 1 4 4 2 2 3 3 4 4 1 1 2 2 Pruesse and Ruskey 94 Input Partial ordering P 1 2 3 4

  18. 1 1 2 2 3 3 4 4 1 1 3 3 2 2 4 4 3 3 1 1 2 2 4 4 1 1 3 3 4 4 2 2 3 3 1 1 4 4 2 2 3 3 4 4 1 1 2 2 Pruesse and Ruskey 94 G X K2 Input Partial ordering P 1 2 3 4 Hamiltonian ! O(n) time for Trace Output O(1) time/each

  19. Our Algorithm Define A sequence of linear extensions for each A linear extension P 3 1 2 4 Parent of P 1 3 2 4 Root 1 2 3 4 within n step we always reach the Root

  20. Family Tree of Linear Extensions 1 2 3 4 1 3 2 4 1 3 4 2 3 1 2 4 3 1 4 2 3 4 1 2

  21. Our Algorithm 1 2 3 4

  22. Our Algorithm Root 1 2 3 4 1 3 2 4 1 3 4 2 Child of Root

  23. Our Algorithm 1 2 3 4 1 3 2 4 1 3 4 2 3 1 2 4 3 1 4 2 3 4 1 2

  24. Example 123456 Input Partial ordering P 132456 124356 123546 123564 312456 132546 132564 4 1 2 135246 135264 135624 6 3 5 315246 312546 351264 356124 351246 315264 351624 312564 315624

  25. How can we findchildren #Type 1 Child 0 #Type 2 Child 3 #Type 3 Child 0 123456 Input Partial ordering P 132456 124356 123546 123564 312456 132546 132564 4 1 2 135246 135264 135624 6 3 5 315246 312546 351264 356124 351246 315264 351624 We can find k children in O(k) time 312564 315624

  26. Running Time Preprocessing find root linear extension O(m+n) time Then trace the tree in O(n) time O(1) time / each on average

  27. Odd-EvenTravarsal Algorithm find-children-of(x) If depth isodd Output(x) for each child xi do find-children-of(xi) If depth iseven Output(x) 1 123456 3 4 20 10 132456 124356 123546 123564 11 5 2 312456 132546 132564 7 16 135246 135264 13 135624 8 15 6 19 315246 312546 351264 14 356124 351246 9 315264 351624 17 12 312564 18 315624

  28. Running Time Preprocessing find root linear extension O(m+n) time Then O(1) time / each on average ( in worst case)

  29. Summary A simple enumeration algorithm for linear extensions Preprocessing find a linear extension O(m+n) time then trace the tree in O(n) time Output O(1) time / each

  30. Future Works Can we estimate # of descendant objects in the tree without constructing the tree? load balancing

  31. Thank you for your attention! Give me questions and suggestions!

More Related