Download presentation
Presentation is loading. Please wait.
Published byCharles Miles Modified over 9 years ago
1
Constant Time Generation of Linear Extensions Akimitsu Ono Shin-ichi Nakano Gunma Univ. Out put Complete List of Linear Extensions of P Input Partial ordering P 34 12 1234 3124 1324 1342 1342 4312
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) Based on this technique many enumeration algorithms have designed. Algorithm Enumeration x = Find-first-One while x != NIL do Output x x = find-next-of (x)
4
Improvement In general, the output of enumeration algorithm is huge and dominates the running time. If we only output the difference of the objects, then we can improve the running time a lot. 0000 0001 0011 0010 0110 0111 0101 0100 1100 1101 1111 1110 1010 1011 1001 1000 (Combinatorial) Gray Code O(n) time/each O(1) time/each 0000 1 2 1 3 1 2 1 4 1 2 1 3 1 2 1
5
Hamiltonian Path Vertex ----- Object obj
6
Hamiltonian Path Vertex ----- Object Edge ----- difference is constnat obj
7
Hamiltonian Path Vertex ----- Object Edge ----- difference is constnat Hamiltonian Path ----- dictionary obj
8
Unfortunately Hamiltonian Path may not exist! Vertex ----- Object Edge ----- difference is constnat No Hamiltonian Path ----- No dictionary obj
9
Idea: However A Spanning Tree always exists! obj
10
Our Enummeration Algorithm 1 Define a spanning tree 2 Design two method find-root find-children-of(x) Algorithm enumeration x = find-root find-children-of (x) Algorithm find-children-of(x) Output(x) as a difference find-children-of(x) for each child xi do find-children-of(xi) obj 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 Out put A Linear Extension of P Input Partial ordering P 34 12 1234 Many scheduling problems with precedence constraints are modeled by a linear extension of a partial ordering Given a partial ordering P, one can compute a linear extension of P in O(n+m) time. See page 549 of (All arrow go right!) job
13
Generating All Linear Extensions Out put Complete List of Linear Extensions of P Input Partial ordering P 34 12 1234 3124 1324 1342 1342 4312
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 Input Partial ordering P 34 12 1234 3124 13241342 1342 4312
16
Pruesse and Ruskey 94 Input Partial ordering P 34 12 1234 3124 13241342 1342 4312 If we can find a Hamiltonian Path then we can output each in O(1) time. However, …..
17
Pruesse and Ruskey 94 Input Partial ordering P 34 12 1234 3124 13241342 1342 4312 1234 3124 13241342 1342 4312
18
Pruesse and Ruskey 94 Input Partial ordering P 34 12 1234 3124 13241342 1342 4312 1234 3124 13241342 1342 4312 G X K 2 Hamiltonian ! O(n) time for Trace Output O(1) time/each
19
Our Algorithm 1234 3124 1324 Root Define A sequence of linear extensions for each A linear extension P Parent of P within n step we always reach the Root
20
Family Tree of Linear Extensions 1234 3124 1342 132413424312
21
Our Algorithm 1234
22
1234 3124 1342 Root Child of Root
23
Our Algorithm 1234 3124 1342 132413424312
24
Example Input Partial ordering P 35 12 4 6 123456 132456124356123546123564 312456132546 135246 132564 135264 135624 312546 351246 315246 312564 315264 351264 315624 351624 356124
25
How can we find children Input Partial ordering P 35 12 4 6 123456 132456124356123546123564 312456132546 135246 132564 135264 135624 312546 351246 315246 312564 315264 351264 315624 351624 356124 #Type 1 Child 0 #Type 2 Child 3 #Type 3 Child 0 We can find k children in O(k) time
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-Even Travarsal 123456 132456124356123546123564 312456132546 135246 132564 135264 135624 312546 351246 315246 312564 315264 351264 315624 351624 356124 Algorithm find-children-of(x) If depth is odd Output(x) for each child xi do find-children-of(xi) If depth is even Output(x) 2 1 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
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!
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.