Tight lower bounds for online labeling problem

Reading time: 7 minute
...

📝 Abstract

We consider the file maintenance problem (also called the online labeling problem) in which n integer items from the set {1,…,r} are to be stored in an array of size m >= n. The items are presented sequentially in an arbitrary order, and must be stored in the array in sorted order (but not necessarily in consecutive locations in the array). Each new item must be stored in the array before the next item is received. If r<=m then we can simply store item j in location j but if r>m then we may have to shift the location of stored items to make space for a newly arrived item. The algorithm is charged each time an item is stored in the array, or moved to a new location. The goal is to minimize the total number of such moves done by the algorithm. This problem is non-trivial when n=<m<r. In the case that m=Cn for some C>1, algorithms for this problem with cost O(log(n)^2) per item have been given [IKR81, Wil92, BCD+02]. When m=n, algorithms with cost O(log(n)^3) per item were given [Zha93, BS07]. In this paper we prove lower bounds that show that these algorithms are optimal, up to constant factors. Previously, the only lower bound known for this range of parameters was a lower bound of \Omega(log(n)^2) for the restricted class of smooth algorithms [DSZ05a, Zha93]. We also provide an algorithm for the sparse case: If the number of items is polylogarithmic in the array size then the problem can be solved in amortized constant time per item.

💡 Analysis

We consider the file maintenance problem (also called the online labeling problem) in which n integer items from the set {1,…,r} are to be stored in an array of size m >= n. The items are presented sequentially in an arbitrary order, and must be stored in the array in sorted order (but not necessarily in consecutive locations in the array). Each new item must be stored in the array before the next item is received. If r<=m then we can simply store item j in location j but if r>m then we may have to shift the location of stored items to make space for a newly arrived item. The algorithm is charged each time an item is stored in the array, or moved to a new location. The goal is to minimize the total number of such moves done by the algorithm. This problem is non-trivial when n=<m<r. In the case that m=Cn for some C>1, algorithms for this problem with cost O(log(n)^2) per item have been given [IKR81, Wil92, BCD+02]. When m=n, algorithms with cost O(log(n)^3) per item were given [Zha93, BS07]. In this paper we prove lower bounds that show that these algorithms are optimal, up to constant factors. Previously, the only lower bound known for this range of parameters was a lower bound of \Omega(log(n)^2) for the restricted class of smooth algorithms [DSZ05a, Zha93]. We also provide an algorithm for the sparse case: If the number of items is polylogarithmic in the array size then the problem can be solved in amortized constant time per item.

📄 Content

Tight lower bounds for online labeling problem Jan Bul´anek∗ Michal Kouck´y† Michael Saks‡ August 30, 2018 Abstract We consider the file maintenance problem (also called the online labeling problem) in which n integer items from the set {1, . . . , r} are to be stored in an array of size m ≥n. The items are presented sequentially in an arbitrary order, and must be stored in the array in sorted order (but not necessarily in consecutive locations in the array). Each new item must be stored in the array before the next item is received. If r ≤m then we can simply store item j in location j but if r > m then we may have to shift the location of stored items to make space for a newly arrived item. The algorithm is charged each time an item is stored in the array, or moved to a new location. The goal is to minimize the total number of such moves the algorithm has to do. This problem is non-trivial when n ≤m < r. In the case that m = Cn for some C > 1, algorithms for this problem with cost O(log(n)2) per item have been given [IKR81, Wil92, BCD+02]. When m = n, algorithms with cost O(log(n)3) per item were given [Zha93, BS07]. In this paper we prove lower bounds that show that these algorithms are optimal, up to constant factors. Previously, the only lower bound known for this range of parameters was a lower bound of Ω(log(n)2) for the restricted class of smooth algorithms [DSZ05a, Zha93]. We also provide an algorithm for the sparse case: If the number of items is polylogarithmic in the array size then the problem can be solved in amortized constant time per item. 1 Introduction The file maintenance problem In this paper we consider the file maintenance problem in which n integer items from the set {1, . . . , r} are to be stored in an array of size m ≥n. The items are presented sequentially in an arbitrary order, and must be stored in the array in sorted order (but not necessarily in consecutive locations). Each new item must be stored in the array before the next item is received. If r ≤m then we can simply store item j in location j but if r > m then we may have to shift the location of stored items to make space for a newly arrived item. The algorithm is charged each time an item is stored in the array, or moved to a new location. The goal is to minimize the total number of such moves the algorithm has to do. This problem is non-trivial when n ≤m < r. ∗MFF UK and Institute of Mathematics, Academy of Sciences, Prague, e-mail: honyai@seznam.cz. Partially supported by GAUK project no. 344711, grant GA ˇCR P202/10/0854, project No. 1M0021620808 of MˇSMT ˇCR, Institutional Research Plan No. AV0Z10190503 and grant IAA100190902 of GA AV ˇCR. †Institute of Mathematics, Academy of Sciences, Prague, e-mail: koucky@math.cas.cz. Currently on sabbatical at the University of Toronto partially supported by NSERC. Partially supported by GA ˇCR P202/10/0854, project No. 1M0021620808 of MˇSMT ˇCR, Institutional Research Plan No. AV0Z10190503 and grant IAA100190902 of GA AV ˇCR. ‡Department of Mathematics, Rutgers University, e-mail: saks@math.rutgers.edu. Supported in part by NSF under grant CCF-0832787. 1 arXiv:1112.5636v1 [cs.DS] 23 Dec 2011 An alternate formulation is the online labeling problem in which arriving items must be assigned an integer label in the range [1, m] so that the order on the labels agrees with the numerical ordering on the items. The algorithm pays one each time an item is labeled or relabeled. Typically in the literature the file maintenance problem refers to the small space regime in which m = O(n). This case is the focus of this paper. Itai et al. [IKR81] were the first to design an algorithm that maintains an array of size m = O(n) sorted while making only O(n log(n)2) moves in total, i.e., in amortized setting the algorithm makes O(log(n)2) moves per item. Willard [Wil92] improved this algorithm to the worst case setting of O(log(n)2) moves per item and Bender et al. [BCD+02] further simplified his result. The Itai et al. approach can be modified so that for an array of size m = n1+ϵ, ϵ > 0 constant, it uses only O(log(n)) moves per item, amortized (folklore). For the case that the array size m is exactly the number of items n, [Zha93] gave an algorithm that achieves a surprising amortized bound O(log(n)3) moves per item; this result was simplified in [BS07]. In recent years there has been renewed interest in this problem due to its applications in the design of cache-oblivious algorithms, e.g., design of cache-oblivious B-trees [BDFC05, BFJ02] and cache-oblivious dynamic dictionaries [BDIW04]. However, until now it was not known whether the maintenance algorithms for the small space regime can be improved to achieve better amortized cost. Our results In this paper we prove an Ω(n log(n)2) lower bound on the number of moves for inserting n items into array of size m = O(n) for any online labeling algorithm, matching the known upper bound up to constant factors. For the case of array size m = n + n1−ϵ, we

This content is AI-processed based on ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut