DOI QR코드

DOI QR Code

A New Complexity Analysis of the SymMerge Algorithm

SymMerge 알고리즘의 새로운 복잡도 분석

  • Kim, Pok-Son (Department of Mathematics, Kookmin University)
  • Received : 2015.03.22
  • Accepted : 2015.09.23
  • Published : 2015.10.25

Abstract

The SymMerge algorithm is an efficient merging algorithm for input sequences u and v of sizes $\left|u \right|=m$ and $\left|v \right|=n$, $m{\leq}n$. We consider complexity analysis for SymMerge algorithm regarding to the required number of comparisons. The focus of the previous complexity analysis was on finding the values of upper bounds, i.e. showing the asymptotical optimality. In this paper, in a different way from the previous complexity analysis, we show that the overall required number of comparisons for two representative special cases "symmetric case" and "maximum spanning case" can be calculated exactly i.e. the least upper bounds regarding to the required number of comparisons are calculated. Symmerge requires exactly $m\;log\frac{n}{m}+4m-logm-3$ comparisons for symmetric case of sizes $m=2^k,\;n=2^l,l{\geq}k$ of input sequences and exactly $\frac{1}{2}m^2+(m+1)logm-\frac{3}{2}m+2$ comparisons for maximum spanning case of sizes $m=2^k,n=2^m-m$ of input sequences. Additionally we show that the complexity of the Symmerge algorithm regarding to the overall required number of comparisons for these special cases can be defined by recurrence relations.

SymMerge 알고리즘은 두 입력수열 u와 v ($\left|u \right|=m$, $\left|v \right|=n$, $m{\leq}n$)에 대한 효율적 병합 알고리즘이다. SymMerge 알고리즘의 비교횟수와 관련한 복잡도 분석을 하고자 하며 지금까지의 복잡도 분석은 복잡도의 상계값을 찾으므로 점근적 계산방법을 통해 이루어졌다. 이 논문에서는 지금까지의 분석방법과는 달리 SymMerge 알고리즘의 대표적 두 special case에 해당하는 "Symmetric case"와 "Maximum spanning case"에 있어서 병합을 위해 요구되는 정확한 비교횟수를 즉 비교횟수의 최소상계 값을 계산해 보이고자 한다. "Symmetric case"의 경우 사이즈 $m=2^k,\;n=2^l,l{\geq}k$인 임의의 입력수열에 대해 SymMerge 알고리즘이 필요로 하는 비교횟수는 정확하게 $m\;log\frac{n}{m}+4m-logm-3$ 이고 "Maximum spanning case"의 경우 사이즈 $m=2^k,n=2^m-m$ 인 임의의 입력수열에 대해 SymMerge 알고리즘이 필요로 하는 비교횟수는 정확하게 $\frac{1}{2}m^2+(m+1)logm-\frac{3}{2}m+2$ 임을 계산해 보인다. 추가로 이들 두 special case에 있어서 요구되는 비교횟수가 재귀적 함수에 의해 정의될 수 있음을 보인다.

Keywords

References

  1. K. Dudzinski and A. Dydek. "On a stable storage merging algorithm." Information Processing Letters, Vol. 12, pp. 5-8, February 1981. https://doi.org/10.1016/0020-0190(81)90065-X
  2. V. Geert, J. Katajainen, T. Pasanen, "Asymptotically ecient in-place merging." Theoretical Computer Science 237 (1/2), pp. 159-181, 2000. https://doi.org/10.1016/S0304-3975(98)00162-5
  3. J. Chen, "Optimizing stable in-place merging." Theoretical Computer Science 302 (1/3), pp. 191-210, 2003. https://doi.org/10.1016/S0304-3975(02)00775-2
  4. P. S. Kim and A. Kutzner, "Ratio Based Stable in-Place Merging," TAMC 2008, Lecture Notes in Computer Science, Springer, Vol. 4978, pp. 246-257, 2008.
  5. P. S. Kim and A. Kutzner, "Stable Minimum Storage Merging by Symmetric Comparisons," ESA 2004, Lecture Notes in Computer Science, Springer, Vol. 3221, pp. 714-723, 2004.
  6. P. S. Kim and A. Kutzner, "On a Simple and Stable Merging Algorithm," Journal of The Korean Institute of Intelligent Systems, Vol. 20, No. 4, pp. 455-462, 2010. https://doi.org/10.5391/JKIIS.2010.20.4.455
  7. P. S. Kim, "Complexity of the Symmerge Algorithm," Journal of The Korean Institute of Intelligent Systems, Vol. 18, No. 2, pp. 272-277, 2008. https://doi.org/10.5391/JKIIS.2008.18.2.272