Presentation is loading. Please wait.

Presentation is loading. Please wait.

Space Efficient and Output Sensitive Greedy Algorithms on Intervals Toshiki Saitoh (Kobe University) Joint work with ・ Takashi Horiyama (Saitama University)

Similar presentations


Presentation on theme: "Space Efficient and Output Sensitive Greedy Algorithms on Intervals Toshiki Saitoh (Kobe University) Joint work with ・ Takashi Horiyama (Saitama University)"— Presentation transcript:

1 Space Efficient and Output Sensitive Greedy Algorithms on Intervals Toshiki Saitoh (Kobe University) Joint work with ・ Takashi Horiyama (Saitama University) ・ David G. Kirkpatrick (UBC) ・ Yota Otachi (JAIST) ・ Ryuhei Uehara (JAIST) ・ Yushi Uno (Osaka Prefecture University) ・ Katsuhisa Yamanaka (Iwate University)

2 Background There are many big data We need to process big data, efficiently. Big data is too big! We cannot read the data at once. Polynomial space algorithms do not work! We have to consider machine models with space constraint

3 Machine Model with Space Constraint Streaming model Online algorithms Multi-pass algorithms Read-only random-access model Input: read-only and random-access media Workspace: random-access, but O(s) extra workspace (s<n) Output: write-only media There are many results for sorting and selection Time-space tradeoff We try to study more general problems!

4 Our Results Algorithms on Intervals Maximum independent set Minimum dominating set Connected dominating set Paired dominating set etc. These algorithms are Greedy Space efficient Memory adjustable priority queues [Asano et al. 2013] Output sensitive Running time depends on the output size To achieve output sensitiveness, we propose a new operation and its analysis This talk!

5 Maximum Independent Set on Intervals Independent set on intervals Set of intervals such that two distinct intervals do not intersect Maximum independent set problem on intervals Input: A set of intervals Output: Maximum cardinality independent set (unweighted) Independent set Maximum one

6 Algorithms (Known and Ours) TimeSpaceIdea Greedy O(n log n)O(n) wordsSorting Snoeyink [2004] O(n log k)O(n) words Divide and Conquer Bhattacharya et al. [2014] O(n’ (log s + n/s))O(s) wordsHeap Ours 1 O(n’ (log sk/n + n/s))O(s) wordsTournament Trees Ours 2 O(n’’ (log wsk/n + n/(ws))) O(s) words = O(ws) bits Navigation Piles Trigger Piles n: # input intervals, k: output size 1 word = w bits (w>log n) n’ = min{n, sk}, n’’ = min{n, wsk}

7 Greedy Algorithm 1. Sort the intervals according to their right and r = -∞ 2. While there exists a candidate do 3. Extract an interval I with minimum right 4. If l(I) > r then output I and set r = r(I) 1 2 3 4 5 6 7 8 9 10 11 Input array (Read only) 5 8 1 3 10 7 9 2 11 4 6 1 2 3 4 5 6 7 8 9 10 11 Sorting O(n) workspace r : the right of the last output interval

8 Workspace: O(s) words Min-heap H The size of the heap is O(s) Complete binary tree with s nodes Partition the input into s blocks At most one interval from each block is in the heap H Key: right endpoint Validity: Left endpoint is larger than r r is the right of the last output interval Each internal node has smaller element of its children … … …… … B1B1 B2B2 BsBs … Min-heap size O(s) Bhattacharya’s Algorithm (1)

9 … … …… … B1B1 B2B2 BsBs … r Min-heap size O(s) Bhattacharya’s Algorithm (2) 1. Initialize the heap H and r=-∞ 2. While H is not empty do 3. Pop an interval I with minimum right in H 4. if I does not contain r then 5. Output I and update r 6. Search a next interval J from the block which include I Next interval J has min-right such that l(J)>r 7. Push J into the heap H

10 Bhattacharya’s Algorithm (3) Computation time: O(min{n, sk}(log s+n/s)) Pop and Push operation: O(log s) time Search operation: O(n/s) time #while loop iterations: min {n, sk} n: Each element is pushed into the heap at most once sk: Output at least one element after s time loop … … …… … B1B1 B2B2 BsBs n/s Min-heap size O(s) … log s Redundant! 1. Initialize the heap H and r=-∞ 2. While H is not empty do 3. Pop an interval I with minimum right in H 4. if I does not contain r then 5. Output I and update r 6. Search a next interval J from the block which include I Next interval J has min-right such that l(J)>r 7. Push J into the heap H

11 Results TimeSpaceIdea Greedy O(n log n)O(n) wordsSorting Snoeyink [2004] O(n log k)O(n) words Divide and Conquer Bhattacharya et al. [2014] O(n’ (log s + n/s))O(s) wordsHeap Ours 1 O(n’ (log sk/n + n/s))O(s) wordsTournament Trees Ours 2 O(n’’ (log wsk/n + n/(ws))) O(s) words = O(ws) bits Navigation Piles Trigger Piles n: # input intervals, k: output size 1 word = w bits n’ = min{n, sk}, n’’ = min{n, wsk}

12 Workspace: O(s) words [Asano et al. 2013] Min-tournament tree Complete binary tree with s leaves #nodes: 2s-1 Partition the input into s blocks Each leaf corresponds to a block At most one interval from each block is in the tree Key: right endpoint Validity: Left endpoint is larger than r Each internal node has minimum element in its children … … …… … B1B1 B2B2 BsBs … … Tournament Trees

13 After Output One Interval Naïve update process Extract the root interval Find a next interval in the corresponding block Update nodes in the path from the leaf to the root Our update procedure Bottom up and recursive update Updating intervals from the leaf to the root If there is an invalid interval in the updating path, then we refresh it recursively. …… invalid BiBi The root interval might be invalid! Valid interval: No intersection with outputted intervals After refresh, the root interval is valid. Lemma 1

14 Our algorithm 1 1. Initialize the tournament tree T and r=-∞ 2. While T is not empty do 3. Output an interval I in the root of T and update r 4. Refresh at the root of T Let T’ be a binary tree with height h and s’ leaves. The number of nodes in T’ is O(s’ log 2 h /s’). Lemma 2 invalid (Intuitive proof) Maximizing the number of nodes h log s’ h - log s’ 2s’-1 s’ (h – log s’) = s’ log 2 h /s’ s’

15 Our algorithm 1 #iteration: k = output size Let s i be #updated leaves in i th loop Refresh cost: O(s i log s/s i + s i n/s) Updating cost: O(s i log s/s i ) from Lemma 2, h=log s, s’=s i Search cost: O(s i n/s) 1. Initialize the tournament tree T and r=-∞ 2. While T is not empty do 3. Output an interval I in the root of T and update r 4. Refresh at the root of T Let T’ be a binary tree with height h and s’ leaves. The number of nodes in T’ is O(s’ log 2 h /s’). Lemma 2 invalid Time complexity

16 Results TimeSpaceIdea Greedy O(n log n)O(n) wordsSorting Snoeyink [2004] O(n log k)O(n) words Divide and Conquer Bhattacharya et al. [2014] O(n’ (log s + n/s))O(s) wordsHeap Ours 1 O(n’ (log sk/n + n/s))O(s) wordsTournament Trees Ours 2 O(n’’ (log wsk/n + n/(ws))) O(s) words = O(ws) bits Navigation Piles Trigger Piles n: # input intervals, k: output size 1 word = w bits n’ = min{n, sk}, n’’ = min{n, wsk}

17 Conclusion and Future Works New operation and its analysis for priority queues Algorithms on intervals Maximum independent set Minimum dominating set Connected dominating set Paired dominating set etc. Future Works Independent dominating set on intervals Weighted problems Implementation of these algorithms Running time are same


Download ppt "Space Efficient and Output Sensitive Greedy Algorithms on Intervals Toshiki Saitoh (Kobe University) Joint work with ・ Takashi Horiyama (Saitama University)"

Similar presentations


Ads by Google