Dynamization




In computer science, dynamization is the process of transforming a static data structure into a dynamic one. Although static data structures may provide very good functionality and fast queries, their utility is limited because of their inability to grow/shrink quickly, thus making them inapplicable for the solution of dynamic problems, where the amount of the input data changes. Dynamization techniques provide uniform ways of creating dynamic data structures.



Decomposable search problems


We define problem P{displaystyle P}P of searching for the predicate M{displaystyle M}M match in the set S{displaystyle S}S as P(M,S){displaystyle P(M,S)}P(M,S). Problem P{displaystyle P}P is decomposable if the set S{displaystyle S}S can be decomposed into subsets Si{displaystyle S_{i}}S_{i} and there exists an operation +{displaystyle +}+ of result unification such that P(M,S)=P(M,S0)+P(M,S1)+⋯+P(M,Sn){displaystyle P(M,S)=P(M,S_{0})+P(M,S_{1})+dots +P(M,S_{n})}P(M,S) = P(M,S_0) + P(M,S_1) + dots + P(M,S_n).



Decomposition


Decomposition is a term used in computer science to break static data structures into smaller units of unequal size. The basic principle is the idea that any decimal number can be translated into a representation in any other base. For more details about the topic see Decomposition (computer science). For simplicity, binary system will be used in this article but any other base (as well as other possibilities such as Fibonacci numbers) can also be utilized.


If using the binary system, a set of n{displaystyle n}n elements is broken down into subsets of sizes with


2i∗ni{displaystyle 2^{i}*n_{i}}2^{i}*n_{i}

elements where ni{displaystyle n_{i}}n_{i} is the i{displaystyle i}i-th bit of n{displaystyle n}n in binary. This means that if n{displaystyle n}n has i{displaystyle i}i-th bit equal to 0, the corresponding set does not contain any elements. Each of the subset has the same property as the original static data structure. Operations performed on the new dynamic data structure may involve traversing log2⁡(n){displaystyle log _{2}left(nright)}log_{2}left(nright) sets formed by decomposition. As a result, this will add O(log⁡(n)){displaystyle O(log left(nright))}O(logleft(nright)) factor as opposed to the static data structure operations but will allow insert/delete operation to be added.


Kurt Mehlhorn proved several equations for time complexity of operations on the data structures dynamized according to this idea. Some of these equalities are listed.


If


PS(n){displaystyle P_{S}left(nright),!}P_Sleft(nright),! = time to build the static data structure
QS(n){displaystyle Q_{S}left(nright),!}Q_Sleft(nright),! = time to query the static data structure
QD(n){displaystyle Q_{D}left(nright),!}Q_Dleft(nright),! = time to query the dynamic data structure formed by decomposition
{displaystyle {overline {I}}}overline {I} = amortized insertion time

then


 QD(n)=O(QS(n)log⁡(n)){displaystyle Q_{D}left(nright)=O(Q_{S}left(nright)log left(nright)),!}Q_Dleft(nright) = O(Q_Sleft(nright)logleft(nright)),!
=O((PS(n)/n)log⁡(n)){displaystyle {overline {I}}=O(left(P_{S}left(nright)/nright)log left(nright))}overline{I}=O(left(P_Sleft(nright)/nright)logleft(nright))

If QS(n){displaystyle Q_{S}left(nright)}Q_Sleft(nright) is at least polynomial, then QD(n)=O(QS(n)){displaystyle Q_{D}left(nright)=Oleft(Q_{S}left(nright)right)}Q_Dleft(nright)=Oleft(Q_Sleft(nright)right).



Further reading


  • Kurt Mehlhorn, Data structures and algorithms 3, . An EATCS Series, vol. 3, Springer, 1984.



Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues