DOI QR코드

DOI QR Code

On a Simple and Stable Merging Algorithm

단순하고 스테이블한 머징알고리즘

  • Received : 2010.03.06
  • Accepted : 2010.06.20
  • Published : 2010.08.25

Abstract

We investigate the worst case complexity regarding the number of comparisons for a simple and stable merging algorithm. The complexity analysis shows that the algorithm performs O(mlog(n/m)) comparisons for two sequences of sizes m and n $m{\leq}n$. So, according to the lower bound for merging $\Omega$(mlog(n/m)), the algorithm is asymptotically optimal regarding the number of comparisons. For proving the worst case complexity we divide the domain of all inputs into two disjoint cases. For either of these cases we will extract a special subcase and prove the asymptotic optimality for these two subcases. Using this knowledge for special cases we will prove the optimality for all remaining cases. By using this approach we give a transparent solution for the hardly tractable problem of delivering a clean complexity analysis for the algorithm.

단순하고 스테이블한 머징알고리즘의 비교횟수와 관련된 worst case 복잡도를 분석한다. 복잡도 분석을 통해 소개되는 알고리즘이 m 과 n, $m{\leq}n$ 사이즈의 두 수열에 대해 O(mlog(n/m))의 비교횟수를 요구하는 사실을 증명한다. 그래서 병합에 있어서의 하계가 $\Omega$(mlog(n/m))이라는 사실로부터 우리의 알고리즘이 비교횟수와 관련해 점근적 최적 알고리즘에 해당함 을 추론가능하다. worst case 복잡도 증명을 위해 모든 입력수열로 구성된 정의구역을 두개의 서로소인 집합으로 나눈다. 그런 후 서로소인 각각의 집합으로 부터 특수한 subcase를 구별한 후 이들 subcase 각각에 대해 점근적 최적성을 증명한다. 이 증명을 바탕으로 나머지 모든 경우에 대한 최적성 또한 추론 또는 증명 가능함을 소개한다. 이로써 우리는 복잡도 분석이 까다로운 알고리즘에 대해 투명한 하나의 해를 제시한다.

Keywords

References

  1. D. E. Knuth, The Art of Computer Programming, Addison-Wesley, Vol. 3: Sorting and Searching, 1973.
  2. 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
  3. A. Symvonis, “Optimal stable merging,” Computer Journal, Vol. 38, pp. 681-690, 1995. https://doi.org/10.1093/comjnl/38.8.681
  4. V. Geffert, J. Katajainen and T. Pasanen, “Asymptotically efficient in-place merging,” Theoretical Computer Science, Vol. 237, No. 1/2, pp. 159-181, 2000. https://doi.org/10.1016/S0304-3975(98)00162-5
  5. J. Chen. "Optimizing stable in-place merging," Theoretical Computer Science, Vol. 302, No. 1/3, pp. 191-210, 2003. https://doi.org/10.1016/S0304-3975(02)00775-2
  6. P. S. Kim and A. Kutzner, “On Optimal and Efficient in-Place Merging,” SOFSEM 2006, Lecture Notes in Computer Science, Springer, Vol. 3831, pp. 350-359, 2006. https://doi.org/10.1007/11611257_33
  7. 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. https://doi.org/10.1007/978-3-540-79228-4_22
  8. M. A. Kronrod, “An optimal ordering algorithm without a field operation,” Dokladi Akad. Nauk SSSR, Vol. 186, pp. 1256-1258, 1969.
  9. H. Mannila and E. Ukkonen, “A simple linear-time algorithm for in situ merging," Information Processing Letters, Vol. 18, pp. 203-208, 1984. https://doi.org/10.1016/0020-0190(84)90112-1
  10. F. Hwang and S. Lin, “A simple algorithm for merging two disjoint linearly ordered sets," SIAM J. Comput., Vol. 1, no. 1, pp. 31-39, 1972. https://doi.org/10.1137/0201004
  11. 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. https://doi.org/10.1007/978-3-540-30140-0_63
  12. C++ Standard Template Library, “http://www.sgi.com/tech/stl."
  13. K. Mollerhoj AND C.U. Sottrup, “Undersogelse og implementation af effektiv inplace merge," tech. rep., CPH STL Reports 2002-06, Department of Computer Science, University of Copenhagen, Denmark, June 2002.

Cited by

  1. A New Complexity Analysis of the SymMerge Algorithm vol.25, pp.5, 2015, https://doi.org/10.5391/JKIIS.2015.25.5.515