Presentation is loading. Please wait.

Presentation is loading. Please wait.

Longest Increasing Subsequences in Windows Based on Canonical Antichain Partition Erdong Chen (Joint work with Linji Yang & Hao Yuan) Shanghai Jiao Tong.

Similar presentations


Presentation on theme: "Longest Increasing Subsequences in Windows Based on Canonical Antichain Partition Erdong Chen (Joint work with Linji Yang & Hao Yuan) Shanghai Jiao Tong."— Presentation transcript:

1 Longest Increasing Subsequences in Windows Based on Canonical Antichain Partition Erdong Chen (Joint work with Linji Yang & Hao Yuan) Shanghai Jiao Tong Univ.

2 Outline Problem Definition Canonical Antichain Partition Sweep Algorithm Complexity Analysis Conclusion

3 Longest Increasing Subsequence (LIS) 698235147 2347 2357 Input sequence: All Longest Increasing Subsequences:

4 LIS in a Window 698235147 698 The length of LIS within the window is 2 69 Sequence a Window

5 Longest Increasing Sequence in A Set of Variable-size Windows (LISSET) 698235147 89651435328951473289696535325732 Length of LIS = 2 Length of LIS = 3 Length of LIS = 2 Length of LIS = 4 OUTPUT = 11 + = + +

6 Longest Increasing Sequence in A Set of Variable-size Windows (LISSET) 698235147 96535325732 Length of LIS = 2 Length of LIS = 3 Length of LIS = 2 Length of LIS = 4 OUTPUT = 11 + = + +

7 Related Works Knuth proposed an O(n log n) algorithm for LIS problem Fredman proved an Ω(n log n) lower bound under the decision tree model An O(n log log n) algorithm is possible by using van Emde Boas tree on a permutation.

8 Related Works (Cont.) Longest Increasing Subsequences in Sliding Windows (LISW problem) (by Michael H. Albert et al), Time Complexity O(OUTPUT + n log log n) We called it Longest Increasing Subsequences in Fixed-size windows

9 LISW Problem 698235 89628932 853235669 OUTPUT = 14 + = + + + + + + 5 n = 6 w = 3 Length of LIS = 1 Length of LIS = 2 Length of LIS = 1 Length of LIS = 2 Length of LIS = 3 Length of LIS = 2 Length of LIS = 1 96 9 32 532 53 5 6 96 n+w-1 = 8 windows

10 Our Contribution A algorithm for the generalized problem LISSET To solve the sub case LISW problem, our algorithm runs in O(OUTPUT) time. The best result among previous attempts on LISW is O(OUTPUT + n log log n)

11 Canonical Antichain Partition The sequence: 6, 9, 8, 2, 3, 5, 1, 4, 7 p1(1,6) p4(4,2) p7(7,1) p2(2,9) p3(3,8) p5(5,3) p6(6,5) p8(8,4) p9(9,7)

12 Dominance Order p1(1,6) p4(4,2) p7(7,1) p2(2,9) p3(3,8) p5(5,3) p6(6,5) p8(8,4) p9(9,7) Points in this region dominates p1 Points in this region dominates p4 a<b iff x a <x b & y a <y b

13 Height of points by Dominance Order p1 p4 p7 p2 p3 p5 p6 p8 p9 Height = 1

14 p1 p4 p7 p2 p3 p5 p6 p8 Height of points by Dominance Order Height = 1 Height = 2

15 p1 p4 p7 p2 p3 p5 p6 p8 Height of points by Dominance Order Height = 1 Height = 2 Height = 3 Height = 4

16 Antichain and Chain p1=HEAD(1) p4 p7=TAIL(1) p2=HEAD(2) p3 p5=TAIL(2) p6=HEAD(3) p8=TAIL(3) p9=HEAD(4) =TAIL(4) L(1) L(2) L(3) L(4) Antichain: x i =y i+1

17 p1 p4 p7 p2 p3 p5 p6 p8 p9 L(1) L(2) L(3) L(4) Antichain and Chain Chain: x i <x i+1 & y i <y i+1 Max Element Min Element The longest chain corresponds the LIS The sequence: 6, 9, 8, 2, 3, 5, 1, 4, 7

18 Sweep Algorithm Sweep from left to right Operations – DELETE operation (Delete at left) e.g.: delete 6 – INSERT operation (Insert at right) e.g.: insert 2 – QUERY operation Algorithm Flow 896 289

19 DELETE operation p1=pdel p3 p7 p5 p2 p4 p6 L(1) L(2) L(3) D(1) = {p1} D(2) = {p2} D(3) = {p4,p5}

20 DELETE operation (Cont.) p1=pdel p3 p7 p5 p2 p4 p6 D(2) L(1)/D(1) D(3) L(2)/D(2) L(3)/D(3)

21 After the Delete operation p1=pdel p3 p7 p5 p2 p4 p6 L’(3) L’(1) L’(2)

22 Analysis of Delete operation Theorem 2. The cost of one DELETE operation equals the total number of points whose height decreases, i.e., O(|D|).

23 INSERT & QUERY operations Theorem 3. The cost of INSERT operation equals the length of the LIS with the pINS as the maximum element. Theorem 4. The cost of outputting a longest chain equals to the length of the output subsequence.

24 Algorithm Flow Step 1: Sort the windows W i by their left endpoints (if two windows share the same left endpoint, the longer window comes first) O(n+m) Step 2: initialize current window to ∅ Step 3: slide the window from W j to W j+1 (j=1,2,…m-1)

25 Details of Step 3 Move from W j to W j+1, W j =(a 1,b 1 ), W j+1 =(a 2,b 2 ) Disjoint Overlap Contain – Same left endpoint – Different left endpoints QUERY(r 2 ) to output a LIS within W j+1

26 Amotized Complexity Analysis Given a sequence π = π 1 π 2... π n depth i is defined to be the largest height that π i achieved in the m windows. In other words, among all increasing subsequences in m windows, depth i is the length of the longest one with π i as the maximal element.

27 Complexity of each operation by Amortize Analysis QUERY operation: O(OUTPUT) INSERT operation: DELETE operations: (A point p i can decrease at most depth i times)

28 Complexity Analysis of LISSET Theorem 5 (LISSET Problem). The algorithm described above computes the m longest increasing subsequences, one for each window, in total time:

29 Complexity Analysis of LISW depth i equals the length of the output in window π i-w+1, π i-w+2, …, π i So, And, Thus,

30 Complexity Analysis of LISW Theorem 6 (LISW Problem). Our algorithm finds the longest increasing subsequence in a sliding window over a sequence of n elements in O(OUTPUT) time.

31 Future Works…

32 Questions?


Download ppt "Longest Increasing Subsequences in Windows Based on Canonical Antichain Partition Erdong Chen (Joint work with Linji Yang & Hao Yuan) Shanghai Jiao Tong."

Similar presentations


Ads by Google