A Simple Yet Fast Algorithm for the Closest-Pair Problem Using Sorted Projections on Multi-dimensions
|
|
- Barnard Little
- 6 years ago
- Views:
Transcription
1 A Simple Yet Fast Algorithm for the Closest-Pair Problem Using Sorted Projections on Multi-dimensions Mehmet E. Dalkılıç and Serkan Ergun Abstract We present a simple greedy algorithm, QuickCP, for finding the closestpair of points on a plane. It is based on the observation that if two points are close to each other, then it is very likely that their sorted projections to x-axis and/or to y-axis will reflect that closeness. Therefore we order our search starting from the pairs with closest x-projections (and closest y-projections) to find the closest pair quickly and make a fast exit. Empirical data up to 2 26 (over sixty million points) indicates that this approach quickly detects the closest pair and it is, on average 7 percent faster than the classical divide-and-conquer algorithm registering, to the best of our knowledge, the fastest recorded solution times in the literature for the planar closest-pair problem. A second contribution of our work is that QuickCP can be used as part of the divide-and-conquer algorithms to handle small sub-problems. Measurements on data up to 2 26 points show that this co-operation speeds up the basic divide-andconquer algorithm on average 5 percent. Key words: closest pair problem, greedy algorithm, algorithmic engineering Introduction We address one of the most basic problems in Computational Geometry. Given n points on a plane, find the two points closest to each other. Closest-point problems are fundamental to the Computational Geometry and has applications in graphics, computer vision, geographical information systems, and molecular modeling [6, 8, 9]. Mehmet E. Dalkılıç Serkan Ergun International Computer Institute, Ege University, Izmir, Turkey, {mehmet.emin.dalkilic,serkan.ergun}@ege.edu.tr
2 2 Mehmet E. Dalkılıç and Serkan Ergun It is commonly agreed that the best (most practical) way of solving the above stated two-dimensional closest-pair of points problem is to employ the O(n log n) divide-and-conquer algorithm introduced by Bentley and Shamos []. Although there exist O(n) randomized algorithms [2, 5] for the closest points problem, due to their high implementation complexity, these algorithms are difficult to implement and therefore, the divide and conquer algorithm is often the practical choice for many applications. Using the sorted projections of the input points in x- and y-dimension, a simpler and faster (than the divide and conquer) algorithm can be developed. Even if the algorithm has a worst-case time complexity of O(n 2 ), with a much better average time performance it can be practical and useful. Moreover, any algorithm considerably faster than the divide-and-conquer closest pair (DivConCP) algorithm for the small problem sizes, can be used to speed up the DivConCP algorithm by quickly solving the small sub-problems for it. 2 Proposed Algorithm: QuickCP A typical textbook implementation of the DivConCP algorithm (e.g., [6]) begins with two arrays A and B: in the first array all points are sorted by increasing x- coordinate and in the second array by increasing y-coordinate. Arrays A and B, in fact, contain, respectively, the sorted x-projections and y-projections of the input points. Our observation that these sorted projection arrays can be used in an entirely different fashion than that of the DivConCP algorithm, has led us to the QuickCP algorithm given below. Our main assertion is that if two points are close to each other, then it is very likely that their sorted projections to the x-axis and/or to the y-axis will reflect that closeness. Therefore we can walk through the x-sorted and y-sorted lists in rounds (, 2,..., n ) pairing each point with its r-closest neighbor in both dimensions in the r th round. Empirical data obtained over many runs of the QuickCP algorithm on uniformly distributed random data from 2 4 up to 2 26 (over sixty million) points suggest that QuickCP finds the closest pair and terminates (after guaranteeing that no closer pairs exist) within O(logn) rounds. 2. Algorithm Description QuickCP algorithm is given in Algorithm. It takes a set of two-dimensional points, P, and creates two auxiliary arrays A and B holding the x-sorted and y-sorted points. The algorithm runs in a loop indexed by r. In the first round (r = ), distances for -closest-x pairs and -closest-y pairs are computed recording the minimum distance seen so far. And in the same round, we compute X min which represents the minimum x distance between any -closest-x pairs. Similarly we have Y min representing the minimum y distance between any -closest-y pairs. It is not difficult to
3 A Simple Yet Fast Algorithm for the Closest-Pair Problem 3 Algorithm QuickCP(P) // P = {P,P 2,...,P n } where P i = (x i,y i ) i.e., n input points A sortbyx(p) // Sort P by x-values, store in A i.e., {A(), A(2),..., A(n)} B sortbyy (P) // Sort P by y-values, store in B i.e., {B(), B(2),..., B(n)} d min for r = to n do // at most n rounds X min, Y min for i = to n r do X A(i + r).x A(i).x // A(j).x is the x-value of A(j) Y A(i + r).y A(i).y // A(j).y is the y-value of A(j) X min min( X min, X) // update X min d A X 2 + Y 2 // distance between points A(i) and A(i+r) X B(i + r).x B(i).x // B(j).x is the x-value of B(j) Y B(i + r).y B(i).y // B(j).y is the y-value of B(j) Y min min( Y min, Y ) // update Y min d B X 2 + Y 2 // distance between points B(i) and B(i+r) d min min(d min,d A,d B ) // update d min end for if d min < ( X min ) 2 + ( Y min ) 2 then break // Termination Condition end if end for convince oneself that at this or any later round no two points can be closer to each other than that of ( X min ) 2 + ( Y min ) 2. These minimum distances ( X min, Y min ) together with the closest pair distance so far (d min ) gives us the opportunity to specify the termination condition. At round r each point in the input is first paired with its r-closest-x neighbor and then with its r-closest-y neighbor. If we take the minimum of the X values over all pairs in round r, any pair in any later round will produce X values greater than or equal to that of round r. The same is valid for the Y values. In other words if we define Xmin i as the minimum X value at round i and Y min i as the minimum Y value at round i then X min X 2 min Y min Y 2 min... X n min... Y n min Furthermore, if we have Xmin r and Y min r at round r, in later rounds it is guaranteed that all pairs will produce distances at least as big as ( Xmin r )2 + ( Ymin r )2. In other words, ( Xmin r )2 + ( Ymin r )2 is a lower bound for the distance of any two points. Therefore, we compare the d min at the end of the r th round with this lower bound and if d min ( Xmin r )2 + ( Ymin r )2 then there is no need to look further; the distance of our current closest pair is the final answer. ()
4 4 Mehmet E. Dalkılıç and Serkan Ergun 2.2 Correctness of the Algorithm Case I. Algorithm runs full n rounds. At the r th round for each point A i ( i n r) in the x-sorted list, the algorithm computes distance to its r-closest-x neighbor where r-closest-x neighbor is the point A i+r which is the point r positions left of A i in the x-sorted array. Similarly, at the r th round, the algorithm computes for each point B j ( j n r) in the y-sorted list, the distance to its r-closest-y neighbor where r-closest-y neighbor is the point B i+r which is the point r positions left of B j in the y-sorted array. Therefore if algorithm runs all the rounds, each point will be paired with every other point (in fact twice; once as a i-closest-x neighbor and j-closest-y neighbor where i, j n ). Since the algorithm goes through all possible pairings it will definitely find the closest pair. Since there are n(n )/2 pairs in total, this represents the worst case time complexity of the algorithm which is O(n 2 ). Case II. Algorithm exits at a round r (r < n ). Clearly d min is the minimum distance of any pair explored so far. Is it the minimum distance of any pair not explored yet? The answer is yes because d min computed at the round r satisfies d min ( X r min )2 + ( Y r min )2 and therefore d min is a lower bound on the distance of any pair that would be explored in any round q > r due to (). 2.3 Empirical Average Case Complexity We have implemented our algorithm in C and measured the round number it terminated, under uniformly distributed random inputs of varying size. The results are shown in Fig. where the best fitting curve to this data is c logn + c 2. Since each round s time complexity is O(n), these empirical results suggest that the average case time complexity of the algorithm is O(nlogn). 3 Experiments We compared our algorithm with the closest pair algorithms provided by Jiang and Gillespie [4]. In their paper, they compared different versions of the divide and conquer closest pair algorithm (Basic-7, GWZ-3, Basic-2, 2-pass, Hybrid, Adaptive, Combined). Furthermore, they provided their source code of the test program and the experimental data online at mjiang/ closestpair/. We simply added our algorithm coded in C and run the same test on an Intel Core i7-92, with 2 GB memory and operating system Ubuntu. (64 bit). Test uses randomly generated inputs, sized from 2 4,2 5,...,2 26. For each input size executions (with different random number seeds) are performed. We have selected for comparison with our algorithm QuickCP, Basic-7 (the basic divide-and-conquer algorithm computing seven distances for each point in the
5 A Simple Yet Fast Algorithm for the Closest-Pair Problem round count c log n + c2 Empirical expectation number of points Fig. Expected termination round numbers for different input sizes combine step), GWZ-3 (a divide and conquer algorithm with an optimized combine step, developed by Ge et. al. [3]), Basic-2 (a hybrid of Basic-7 and GWZ-3, independently developed in [4] and [7]), and Combined (an improved version of Basic-2 by two heuristics, presented in [4]). We have not selected algorithm 2-pass because it was the worst of all. Tables and 2 display the total run times for Basic-7, GWZ-3, Basic-2, Combined and our algorithm QuickCP for small (2 4 to 2 4 ) and large (2 5 to 2 26 ) input sizes. Table Total run times (ms) for small input sizes n Basic-7 Basic-2 GWZ-3 Comb. QuickCP Table 2 Total run times (sec) for large input sizes n Basic-7 Basic-2 GWZ-3 Comb. QuickCP Figures 2 and 3 shows, for various inputs sizes, the total run time ratios of GWZ- 3, Basic-2, Combined and QuickCP over Basic-7. QuickCP is the fastest of all. For small (2 4 to 2 4 ) input sizes the run time ratio of QuickCP over Basic-7 is which corresponds to a speed-up of.64. For large (2 5 to 2 26 ) input sizes the run time ratio of QuickCP over Basic-7 is.57 which corresponds to a speed-up of.74. Overall
6 6 Mehmet E. Dalkılıç and Serkan Ergun run time ratio of QuickCP over Basic-7 is.59 which corresponds to a speed-up of.7. In other words, QuickCP is on average 7% faster than Basic-7. The second fastest algorithm is Combined that is on average 3% faster than Basic-7. Basic-2 and GWZ-3, respectively, overall 5% and 3% faster than Basic-7. Combined is the most engineered and optimized algorithm among the suit in [4] and QuickCP is on average 39% faster with a tendency to increase the difference with larger input sizes. Basic 2 GWZ 3 Combined QuickCP Basic 2 GWZ 3 Combined QuickCP Fig. 2 Total run time ratios of Basic-2, GWZ-3, Combined, and QuickCP over Basic-7 for small input sizes Fig. 3 Total run time ratios of Basic-2, GWZ-3, Combined, and QuickCP over Basic-7 for large input sizes All Closest Pair Algorithms spend a large portion of their times on the preprocessing i.e., sorting. Thus, unless a sorting algorithm practically faster than Quick- Sort is found (and takes its place in code libraries), a portion of the run time corresponding to this preprocessing can not be reduced. Therefore, in Figures 4 and 5 we give the run times where preprocessing times excluded. When preprocessing times are excluded, QuickCP is, on average, 6.95 times faster than Basic-7 and the speed-up shows a tendency to increase with larger input sizes. Other three algorithms, Combined, Basic-2 and GWZ-3 line-up with.98,.4 and.32 speed-up over Basic-7, respectively. 4 Improving Divide and Conquer Noting that QuickCP has O(n 2 ) worst-case time complexity, with the guaranteed O(nlogn) time complexity the divide and conquer closest pair algorithms has an advantage. On the other hand, as the experiments show QuickCP is faster. Therefore, we can combine the strong sides of the two, leading to a faster O(nlogn) algorithm. To that extent, we have modified the divide and conquer algorithms (Basic-7, GWZ- 3, Basic-2, and Combined) so that they switch to QuickCP when sub-problems become smaller than a threshold size (determined empirically to be 2 n). We renamed
7 A Simple Yet Fast Algorithm for the Closest-Pair Problem 7 Basic 2 GWZ 3 Combined QuickCP Basic 2 GWZ 3 Combined QuickCP Fig. 4 (Total preprocessing) time ratios of Basic-2, GWZ-3, Combined, and QuickCP over Basic-7 for small input sizes Fig. 5 (Total preprocessing) time ratios of Basic-2, GWZ-3, Combined, and QuickCP over Basic-7 for large input sizes the new versions of the algorithms as Basic-7*, GWZ-3*, Basic-2*, and Combined*. We tested the improved versions on the same data and the same setup of the previous section. Basic 7* Basic 2* GWZ 3* Combined* Basic 7* Basic 2* GWZ 3* Combined* Fig. 6 Total run time ratios of Basic-7*, Basic- 2*, GWZ-3* and Combined* over Basic-7 for small input sizes Fig. 7 Total run time ratios of Basic-7*, Basic- 2*, GWZ-3* and Combined* over Basic-7 for large input sizes Figures 6 and 7 show, for various inputs sizes, the total run time ratios of Basic- 7*, GWZ-3*, Basic-2*, and Combined over Basic-7. Our first observation is that all four algorithms provide a 6% average speed-up over Basic-7 for small input sizes. However, for large input sizes this relative speed-up goes down to 5% for Basic-2* and GWZ-3*; and about 42% for Basic-7* and Combined*. Overall average speed improvements relative to Basic-7 are 55% for Basic-2* and GWZ-3*; and 5% for Basic-7* and Combined*. Compared to the original speed-ups of these algorithms over Basic-7 we see that GWZ-3*, Basic-2* and Combined gained an additional 42%, 4% and 9% speed-up, respectively. For instance while the original imple-
8 8 Mehmet E. Dalkılıç and Serkan Ergun mentation of Basic-2 as given in [4] provides a 5% speed improvement over Basic- 7, our QuickCP boosted version of the same algorithm, Basic-2*, achieves a 55% speed improvement over Basic-7. Basic-7*, QuickCP embedded version of the basic divide and conquer algorithm is 5% faster than its original version, Basic-7. With this newly found partnership, Basic-7* becomes about 2% faster than Combined, the most optimized divide and conquer algorithm in the set. Basic-7* is about 35% faster than other engineered divide and conquer algorithms, Basic-2 and GWZ-3. An interesting observation with improved divide and conquer algorithms (Basic- 7*, Basic-2* and GWZ-3*) is that when the small sub-problems are handled by embedded QuickCP, efficiently, their performances tend to become similar. In other words, performance advantages of optimized algorithms (Basic-2 and GWZ-3) over basic algorithm (Basic-7) diminish, possibly because the improvement obtained by embedding QuickCP in these algorithms, dominates the other optimizations. When we exclude the preprocessing times, results as displayed in Figs. 8 and 9, show that compared to the original speed-ups of these algorithms over Basic-7 we see that Basic-7*, GWZ-3*, Basic-2* and Combined* gained an additional 22%, 26%, 25% and 4% speed-up, respectively. Basic 7* Basic 2* GWZ 3* Combined* Basic 7* Basic 2* GWZ 3* Combined* Fig. 8 (Total preprocessing) time ratios of Basic-7*, Basic-2*, GWZ-3*, and Combined* over Basic-7 for small input sizes Fig. 9 (Total preprocessing) time ratios of Basic-7*, Basic-2*, GWZ-3*, and Combined* over Basic-7 for large input sizes Even though the impact of this high speed-up improvements on the total run times are relatively less e.g., 4% for Basic-2*, this represent a significant improvement on an already engineered and fine-tuned divide and conquer algorithm. As a final note, the run time values given in [4] excludes the preprocessing times and the best improvement ratio they obtain is.558 which corresponds to 79% speed improvement which is achieved via the Combined algorithm. In this paper by embedding the QuickCP we have obtained a better version of the Combined (labeled Combined*) with an additional speed improvement of 4% when preprocessing times are excluded. Furthermore, this 4% speed-up is a relatively low improvement rate compared to the average improvement rate of about 25% that we have achieved for the other three divide and conquer algorithms.
9 A Simple Yet Fast Algorithm for the Closest-Pair Problem 9 5 Conclusion We have presented a new and practical algorithm, QuickCP, for closest-pair problem. QuickCP is both simpler and faster than the divide-and-conquer algorithms for computing the closest pair of points. We have implemented and tested QuickCP for random inputs up to sixty million points and on average it is 7% faster than the classical divide and conquer while about 4% faster than the most optimized divided and conquer algorithm (called Combined in the paper). Furthermore, when we exclude the preprocessing times QuickCP s speed advantage gets much bigger. Another contribution of QuickCP is that it can be embedded in the divide and conquer algorithms to quickly handle small cases. We have pursued this option and observed that even the classic divide and conquer closest pair algorithm (called Basic-7 in the paper) becomes faster than the most optimized divide and conquer algorithm. QuickCP algorithm described in two-dimensions in this paper, can easily be extended to three and upper dimensions. Also we are planning to adapt our approach to other problems in Computational Geometry and Graphics. Acknowledgements We sincerely thank Minghui Jiang and Joel Gillespie for their generosity of sharing their source code and experiment data. We are planning to do the same after publishing our research. References. Bentley, J.L., Shamos, M.I.: Divide-and-conquer in multidimensional space. In: Proceedings of the eighth annual ACM symposium on Theory of computing, STOC 76, pp ACM, New York, NY, USA (976) 2. Dietzfelbinger, M., Hagerup, T., Katajainen, J., Penttonen, M.: A reliable randomized algorithm for the closest-pair problem. J. Algorithms 25(), 9 5 (997) 3. Ge, Q., Wang, H.T., Zhu, H.: An improved algorithm for finding the closest pair of points. Journal of Computer Science and Technology 2, 27 3 (26)..7/s Jiang, M., Gillespie, J.: Engineering the divide-and-conquer closest pair algorithm. J. Comput. Sci. Technol. 22(4), (27) 5. Khuller, S., Matias, Y.: A simple randomized sieve algorithm for the closest-pair problem. Information and Computation 8(), (995) 6. Kleinberg, J., Tardos, E.: Algorithm Design. Addison-Wesley (26) 7. Pereira, J.C., Lobo, F.G.: An optimized divide-and-conquer algorithm for the closest-pair problem in the planar case. Journal of Computer Science and Technology 27(4), (22) 8. Preparata, F.P., Shamos, M.I.: Computational geometry: an introduction. Springer-Verlag New York, Inc., New York, NY, USA (985) 9. Smid, M.: Closest-point problems in computational geometry. Handbook of Computational Geometry pp (997)
Closest Pair of Points. Cormen et.al 33.4
Closest Pair of Points Cormen et.al 33.4 Closest Pair of Points Closest pair. Given n points in the plane, find a pair with smallest Euclidean distance between them. Fundamental geometric problem. Graphics,
More information6. Concluding Remarks
[8] K. J. Supowit, The relative neighborhood graph with an application to minimum spanning trees, Tech. Rept., Department of Computer Science, University of Illinois, Urbana-Champaign, August 1980, also
More informationDivide-and-Conquer Algorithms
Divide-and-Conquer Algorithms Divide and Conquer Three main steps Break input into several parts, Solve the problem in each part recursively, and Combine the solutions for the parts Contribution Applicable
More informationProceedings of the 5th WSEAS International Conference on Telecommunications and Informatics, Istanbul, Turkey, May 27-29, 2006 (pp )
A Rapid Algorithm for Topology Construction from a Set of Line Segments SEBASTIAN KRIVOGRAD, MLADEN TRLEP, BORUT ŽALIK Faculty of Electrical Engineering and Computer Science University of Maribor Smetanova
More informationComplementary Graph Coloring
International Journal of Computer (IJC) ISSN 2307-4523 (Print & Online) Global Society of Scientific Research and Researchers http://ijcjournal.org/ Complementary Graph Coloring Mohamed Al-Ibrahim a*,
More informationDetermining Differences between Two Sets of Polygons
Determining Differences between Two Sets of Polygons MATEJ GOMBOŠI, BORUT ŽALIK Institute for Computer Science Faculty of Electrical Engineering and Computer Science, University of Maribor Smetanova 7,
More informationADAPTIVE TEXTURE IMAGE RETRIEVAL IN TRANSFORM DOMAIN
THE SEVENTH INTERNATIONAL CONFERENCE ON CONTROL, AUTOMATION, ROBOTICS AND VISION (ICARCV 2002), DEC. 2-5, 2002, SINGAPORE. ADAPTIVE TEXTURE IMAGE RETRIEVAL IN TRANSFORM DOMAIN Bin Zhang, Catalin I Tomai,
More informationPlanar Point Location
C.S. 252 Prof. Roberto Tamassia Computational Geometry Sem. II, 1992 1993 Lecture 04 Date: February 15, 1993 Scribe: John Bazik Planar Point Location 1 Introduction In range searching, a set of values,
More informationDivide-Conquer-Glue Algorithms
Divide-Conquer-Glue Algorithms Closest Pair Tyler Moore CSE 3353, SMU, Dallas, TX Lecture 12 5. DIVIDE AND CONQUER mergesort counting inversions closest pair of points randomized quicksort median and selection
More informationGreedy, Divide and Conquer
Greedy, ACA, IIT Kanpur October 5, 2013 Greedy, Outline 1 Greedy Algorithms 2 3 4 Greedy, Greedy Algorithms Greedy algorithms are generally used in optimization problems Greedy, Greedy Algorithms Greedy
More informationComputational Geometry
Lecture 1: Introduction and convex hulls Geometry: points, lines,... Geometric objects Geometric relations Combinatorial complexity Computational geometry Plane (two-dimensional), R 2 Space (three-dimensional),
More information5. DIVIDE AND CONQUER I
5. DIVIDE AND CONQUER I mergesort counting inversions closest pair of points randomized quicksort median and selection Lecture slides by Kevin Wayne Copyright 2005 Pearson-Addison Wesley Copyright 2013
More informationComputing intersections in a set of line segments: the Bentley-Ottmann algorithm
Computing intersections in a set of line segments: the Bentley-Ottmann algorithm Michiel Smid October 14, 2003 1 Introduction In these notes, we introduce a powerful technique for solving geometric problems.
More information(Master Course) Mohammad Farshi Department of Computer Science, Yazd University. Yazd Univ. Computational Geometry.
1 / 17 (Master Course) Mohammad Farshi Department of Computer Science, Yazd University 1392-1 2 / 17 : Mark de Berg, Otfried Cheong, Marc van Kreveld, Mark Overmars, Algorithms and Applications, 3rd Edition,
More informationOptimal Routing-Conscious Dynamic Placement for Reconfigurable Devices
Optimal Routing-Conscious Dynamic Placement for Reconfigurable Devices Ali Ahmadinia 1, Christophe Bobda 1,Sándor P. Fekete 2, Jürgen Teich 1, and Jan C. van der Veen 2 1 Department of Computer Science
More informationLecture Notes on Sorting
Lecture Notes on Sorting 15-122: Principles of Imperative Computation Frank Pfenning Lecture 4 September 2, 2010 1 Introduction Algorithms and data structures can be evaluated along a number of dimensions,
More informationREPRESENTATION OF BIG DATA BY DIMENSION REDUCTION
Fundamental Journal of Mathematics and Mathematical Sciences Vol. 4, Issue 1, 2015, Pages 23-34 This paper is available online at http://www.frdint.com/ Published online November 29, 2015 REPRESENTATION
More informationOptimal Sequential Multi-Way Number Partitioning
Optimal Sequential Multi-Way Number Partitioning Richard E. Korf, Ethan L. Schreiber, and Michael D. Moffitt Computer Science Department University of California, Los Angeles Los Angeles, CA 90095 IBM
More informationDr. Amotz Bar-Noy s Compendium of Algorithms Problems. Problems, Hints, and Solutions
Dr. Amotz Bar-Noy s Compendium of Algorithms Problems Problems, Hints, and Solutions Chapter 1 Searching and Sorting Problems 1 1.1 Array with One Missing 1.1.1 Problem Let A = A[1],..., A[n] be an array
More informationAN O(NlogN) MINIMAL SPANNING TREE ALGORITHM FOR N POINTS IN THE PLANE *
BIT 26 (1986), 7-16 AN O(NlogN) MINIMAL SPANNING TREE ALGORITHM FOR N POINTS IN THE PLANE * R. C. CHANG and R. C. T. LEE National Chiao Tung University, National Tsing Hua University, Hsinchu, Hsinchu,
More informationEfficient minimum spanning tree construction without Delaunay triangulation
Information Processing Letters 81 (2002) 271 276 Efficient minimum spanning tree construction without Delaunay triangulation Hai Zhou a,, Narendra Shenoy b, William Nicholls b a Electrical and Computer
More informationLorentzian Distance Classifier for Multiple Features
Yerzhan Kerimbekov 1 and Hasan Şakir Bilge 2 1 Department of Computer Engineering, Ahmet Yesevi University, Ankara, Turkey 2 Department of Electrical-Electronics Engineering, Gazi University, Ankara, Turkey
More information7 Sorting Algorithms. 7.1 O n 2 sorting algorithms. 7.2 Shell sort. Reading: MAW 7.1 and 7.2. Insertion sort: Worst-case time: O n 2.
7 Sorting Algorithms 7.1 O n 2 sorting algorithms Reading: MAW 7.1 and 7.2 Insertion sort: 1 4 3 2 1 3 4 2 Selection sort: 1 4 3 2 Bubble sort: 1 3 2 4 7.2 Shell sort Reading: MAW 7.4 Introduction: Shell
More informationVicinities for Spatial Data Processing: a Statistical Approach to Algorithm Design
Vicinities for Spatial Data Processing: a Statistical Approach to Algorithm Design Peter Y. Wu wu@rmu.edu Department of Computer and Information Systems Sushil Acharya acharya@rmu.edu Department of Engineering
More informationAutomatic Detection of Change in Address Blocks for Reply Forms Processing
Automatic Detection of Change in Address Blocks for Reply Forms Processing K R Karthick, S Marshall and A J Gray Abstract In this paper, an automatic method to detect the presence of on-line erasures/scribbles/corrections/over-writing
More informationOptimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of C
Optimum Alphabetic Binary Trees T. C. Hu and J. D. Morgenthaler Department of Computer Science and Engineering, School of Engineering, University of California, San Diego CA 92093{0114, USA Abstract. We
More informationRevised version, February 1991, appeared in Information Processing Letters 38 (1991), 123{127 COMPUTING THE MINIMUM HAUSDORFF DISTANCE BETWEEN
Revised version, February 1991, appeared in Information Processing Letters 38 (1991), 123{127 COMPUTING THE MINIMUM HAUSDORFF DISTANCE BETWEEN TWO POINT SETS ON A LINE UNDER TRANSLATION Gunter Rote Technische
More informationEfficient hybrid search algorithm on ordered datasets
Efficient hybrid search algorithm on ordered datasets Adnan Saher Mohammed a,, Ş ahin Emrah Amrahov b, Fatih V. Ç elebi c a Ankara Yıldırım Beyazıt University, Graduate School of Natural Sciences, Computer
More informationAPPLICATION OF FLOYD-WARSHALL LABELLING TECHNIQUE: IDENTIFICATION OF CONNECTED PIXEL COMPONENTS IN BINARY IMAGE. Hyunkyung Shin and Joong Sang Shin
Kangweon-Kyungki Math. Jour. 14 (2006), No. 1, pp. 47 55 APPLICATION OF FLOYD-WARSHALL LABELLING TECHNIQUE: IDENTIFICATION OF CONNECTED PIXEL COMPONENTS IN BINARY IMAGE Hyunkyung Shin and Joong Sang Shin
More informationExtensible Point Location Algorithm
Extensible Point Location Algorithm Rashmi Sundareswara and Paul Schrater Department of Computer Science and Engineering University of Minnesota, Twin Cities, USA sundares@cs.umn.edu, schrater@umn.edu
More informationClosest Pair of Points in the Plane. Closest pair of points. Closest Pair of Points. Closest Pair of Points
Closest Pair of Points Closest pair of points. Given n points in the plane, find a pair with smallest euclidean distance between them. Closest Pair of Points in the Plane Inge i Gørtz The slides on the
More informationTraining Algorithms for Robust Face Recognition using a Template-matching Approach
Training Algorithms for Robust Face Recognition using a Template-matching Approach Xiaoyan Mu, Mehmet Artiklar, Metin Artiklar, and Mohamad H. Hassoun Department of Electrical and Computer Engineering
More informationA General Class of Heuristics for Minimum Weight Perfect Matching and Fast Special Cases with Doubly and Triply Logarithmic Errors 1
Algorithmica (1997) 18: 544 559 Algorithmica 1997 Springer-Verlag New York Inc. A General Class of Heuristics for Minimum Weight Perfect Matching and Fast Special Cases with Doubly and Triply Logarithmic
More informationTime-Optimal Algorithm for Computing the Diameter of a Point Set on a Completely Overlapping Network
Time-Optimal Algorithm for Computing the Diameter of a Point Set on a Completely Overlapping Network Prapaporn Techa-angkoon and Saowaluk Rattanaudomsawat Abstract- Given a finite set P of n points in
More informationEvaluation Measures. Sebastian Pölsterl. April 28, Computer Aided Medical Procedures Technische Universität München
Evaluation Measures Sebastian Pölsterl Computer Aided Medical Procedures Technische Universität München April 28, 2015 Outline 1 Classification 1. Confusion Matrix 2. Receiver operating characteristics
More informationA Learning Based and Vision Guided Robotic Agent Replanning Framework and a Case Study
IC-AI'4 A Learning Based and Vision Guided Robotic Agent Replanning Framework and a Case Study Şule Yıldırım, Postdoctor, Norwegian University of Science and Technology, Institutt for datateknikk og informasjonsvitenskap
More informationSpatial data structures in 2D
Spatial data structures in 2D 1998-2016 Josef Pelikán CGG MFF UK Praha pepca@cgg.mff.cuni.cz http://cgg.mff.cuni.cz/~pepca/ Spatial2D 2016 Josef Pelikán, http://cgg.mff.cuni.cz/~pepca 1 / 34 Application
More informationA SIMPLE APPROXIMATION ALGORITHM FOR NONOVERLAPPING LOCAL ALIGNMENTS (WEIGHTED INDEPENDENT SETS OF AXIS PARALLEL RECTANGLES)
Chapter 1 A SIMPLE APPROXIMATION ALGORITHM FOR NONOVERLAPPING LOCAL ALIGNMENTS (WEIGHTED INDEPENDENT SETS OF AXIS PARALLEL RECTANGLES) Piotr Berman Department of Computer Science & Engineering Pennsylvania
More informationSet Cover with Almost Consecutive Ones Property
Set Cover with Almost Consecutive Ones Property 2004; Mecke, Wagner Entry author: Michael Dom INDEX TERMS: Covering Set problem, data reduction rules, enumerative algorithm. SYNONYMS: Hitting Set PROBLEM
More informationProgramming II (CS300)
1 Programming II (CS300) Chapter 08 : Algorithm Analysis MOUNA KACEM mouna@cs.wisc.edu Fall 2018 Algorithm Analysis 2 Introduction Running Time Big-Oh Notation Keep in Mind Introduction Algorithm Analysis
More informationTesting Isomorphism of Strongly Regular Graphs
Spectral Graph Theory Lecture 9 Testing Isomorphism of Strongly Regular Graphs Daniel A. Spielman September 26, 2018 9.1 Introduction In the last lecture we saw how to test isomorphism of graphs in which
More information4.5 VISIBLE SURFACE DETECTION METHODES
4.5 VISIBLE SURFACE DETECTION METHODES A major consideration in the generation of realistic graphics displays is identifying those parts of a scene that are visible from a chosen viewing position. There
More information5.4 Closest Pair of Points
5.4 Closest Pair of Points Closest pair. Given n points in the plane, find a pair with smallest Euclidean distance between them. Fundamental geometric primitive. Graphics, computer vision, geographic information
More informationA Hybrid Recursive Multi-Way Number Partitioning Algorithm
Proceedings of the Twenty-Second International Joint Conference on Artificial Intelligence A Hybrid Recursive Multi-Way Number Partitioning Algorithm Richard E. Korf Computer Science Department University
More informationConvergent Bounds on the Euclidean Distance
Convergent Bounds on the Euclidean Distance Yoonho Hwang Hee-Kap Ahn Department of Computer Science and Engineering Pohang University of Science and Technology POSTECH, Pohang, Gyungbuk, KoreaROK) {cypher,heekap}@postech.ac.kr
More information100 points total. CSE 3353 Homework 2 Spring 2013
Name: 100 points total CSE 3353 Homework 2 Spring 2013 Assignment is due at 9:30am on February 28. Submit a hard copy of the assignment, including a copy of your code and outputs as requested in the assignment.
More informationBuilding Optimal Alphabetic Trees Recursively
Building Optimal Alphabetic Trees Recursively Ahmed A Belal 1, Mohamed S Selim 2, Shymaa M Arafat 3 Department of Computer Science & Automatic Control, Faculty of Engineering, Alexandria University, Egypt
More informationA Genetic Algorithm Applied to Graph Problems Involving Subsets of Vertices
A Genetic Algorithm Applied to Graph Problems Involving Subsets of Vertices Yaser Alkhalifah Roger L. Wainwright Department of Mathematical Department of Mathematical and Computer Sciences and Computer
More informationExpected Time in Linear Space
Optimizing Integer Sorting in O(n log log n) Expected Time in Linear Space Ajit Singh M. E. (Computer Science and Engineering) Department of computer Science and Engineering, Thapar University, Patiala
More informationPseudo code of algorithms are to be read by.
Cs502 Quiz No1 Complete Solved File Pseudo code of algorithms are to be read by. People RAM Computer Compiler Approach of solving geometric problems by sweeping a line across the plane is called sweep.
More informationApplications of Geometric Spanner
Title: Name: Affil./Addr. 1: Affil./Addr. 2: Affil./Addr. 3: Keywords: SumOriWork: Applications of Geometric Spanner Networks Joachim Gudmundsson 1, Giri Narasimhan 2, Michiel Smid 3 School of Information
More informationA DISTRIBUTED SYNCHRONOUS ALGORITHM FOR MINIMUM-WEIGHT SPANNING TREES
ISSN: 2778-5795 A DISTRIBUTED SYNCHRONOUS ALGORITHM FOR MINIMUM-WEIGHT SPANNING TREES Md. Mohsin Ali 1, Mst. Shakila Khan Rumi 2 1 Department of Computer Science, The University of Western Ontario, Canada
More informationTrademark Matching and Retrieval in Sport Video Databases
Trademark Matching and Retrieval in Sport Video Databases Andrew D. Bagdanov, Lamberto Ballan, Marco Bertini and Alberto Del Bimbo {bagdanov, ballan, bertini, delbimbo}@dsi.unifi.it 9th ACM SIGMM International
More informationGeometric Streaming Algorithms with a Sorting Primitive (TR CS )
Geometric Streaming Algorithms with a Sorting Primitive (TR CS-2007-17) Eric Y. Chen School of Computer Science University of Waterloo Waterloo, ON N2L 3G1, Canada, y28chen@cs.uwaterloo.ca Abstract. We
More informationCS224W Project Write-up Static Crawling on Social Graph Chantat Eksombatchai Norases Vesdapunt Phumchanit Watanaprakornkul
1 CS224W Project Write-up Static Crawling on Social Graph Chantat Eksombatchai Norases Vesdapunt Phumchanit Watanaprakornkul Introduction Our problem is crawling a static social graph (snapshot). Given
More informationPacking Two Disks into a Polygonal Environment
Packing Two Disks into a Polygonal Environment Prosenjit Bose, School of Computer Science, Carleton University. E-mail: jit@cs.carleton.ca Pat Morin, School of Computer Science, Carleton University. E-mail:
More informationLECTURE NOTES OF ALGORITHMS: DESIGN TECHNIQUES AND ANALYSIS
Department of Computer Science University of Babylon LECTURE NOTES OF ALGORITHMS: DESIGN TECHNIQUES AND ANALYSIS By Faculty of Science for Women( SCIW), University of Babylon, Iraq Samaher@uobabylon.edu.iq
More informationSAMPLE OF THE STUDY MATERIAL PART OF CHAPTER 6. Sorting Algorithms
SAMPLE OF THE STUDY MATERIAL PART OF CHAPTER 6 6.0 Introduction Sorting algorithms used in computer science are often classified by: Computational complexity (worst, average and best behavior) of element
More informationCOSC 311: ALGORITHMS HW1: SORTING
COSC 311: ALGORITHMS HW1: SORTIG Solutions 1) Theoretical predictions. Solution: On randomly ordered data, we expect the following ordering: Heapsort = Mergesort = Quicksort (deterministic or randomized)
More informationKeywords: Binary Sort, Sorting, Efficient Algorithm, Sorting Algorithm, Sort Data.
Volume 4, Issue 6, June 2014 ISSN: 2277 128X International Journal of Advanced Research in Computer Science and Software Engineering Research Paper Available online at: www.ijarcsse.com An Efficient and
More informationUse of Multi-category Proximal SVM for Data Set Reduction
Use of Multi-category Proximal SVM for Data Set Reduction S.V.N Vishwanathan and M Narasimha Murty Department of Computer Science and Automation, Indian Institute of Science, Bangalore 560 012, India Abstract.
More informationModule 6 P, NP, NP-Complete Problems and Approximation Algorithms
Module 6 P, NP, NP-Complete Problems and Approximation Algorithms Dr. Natarajan Meghanathan Associate Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu
More informationProposal: k-d Tree Algorithm for k-point Matching
Proposal: k-d Tree Algorithm for k-point Matching John R Hott University of Virginia 1 Motivation Every drug seeking FDA approval must go through Phase II and III clinical trial periods (trials on human
More informationPlanar union of rectangles with sides parallel to the coordinate axis
6 th International Conference on Applied Informatics Eger, Hungary, January 27 31, 2004. Planar union of rectangles with sides parallel to the coordinate axis Daniel Schmid, Hanspeter Bopp Department of
More informationPerformance Evaluation Metrics and Statistics for Positional Tracker Evaluation
Performance Evaluation Metrics and Statistics for Positional Tracker Evaluation Chris J. Needham and Roger D. Boyle School of Computing, The University of Leeds, Leeds, LS2 9JT, UK {chrisn,roger}@comp.leeds.ac.uk
More informationA Method of Measuring Shape Similarity between multi-scale objects
A Method of Measuring Shape Similarity between multi-scale objects Peng Dongliang, Deng Min Department of Geo-informatics, Central South University, Changsha, 410083, China Email: pengdlzn@163.com; dengmin028@yahoo.com
More informationA New Method for Skeleton Pruning
A New Method for Skeleton Pruning Laura Alejandra Pinilla-Buitrago, José Fco. Martínez-Trinidad, and J.A. Carrasco-Ochoa Instituto Nacional de Astrofísica, Óptica y Electrónica Departamento de Ciencias
More informationProcedia Computer Science
Procedia Computer Science 3 (2011) 1049 1054 Procedia Computer Science 00 (2010) 000 000 Procedia Computer Science www.elsevier.com/locate/procedia www.elsevier.com/locate/procedia WCIT-2010 A simple shuffle-based
More informationJanuary 10-12, NIT Surathkal Introduction to Graph and Geometric Algorithms
Geometric data structures Sudebkumar Prasant Pal Department of Computer Science and Engineering IIT Kharagpur, 721302. email: spp@cse.iitkgp.ernet.in January 10-12, 2012 - NIT Surathkal Introduction to
More informationModel-based segmentation and recognition from range data
Model-based segmentation and recognition from range data Jan Boehm Institute for Photogrammetry Universität Stuttgart Germany Keywords: range image, segmentation, object recognition, CAD ABSTRACT This
More informationA Random Number Based Method for Monte Carlo Integration
A Random Number Based Method for Monte Carlo Integration J Wang and G Harrell Department Math and CS, Valdosta State University, Valdosta, Georgia, USA Abstract - A new method is proposed for Monte Carlo
More informationSorting N-Elements Using Natural Order: A New Adaptive Sorting Approach
Journal of Computer Science 6 (2): 163-167, 2010 ISSN 1549-3636 2010 Science Publications Sorting N-Elements Using Natural Order: A New Adaptive Sorting Approach 1 Shamim Akhter and 2 M. Tanveer Hasan
More informationImage-Space-Parallel Direct Volume Rendering on a Cluster of PCs
Image-Space-Parallel Direct Volume Rendering on a Cluster of PCs B. Barla Cambazoglu and Cevdet Aykanat Bilkent University, Department of Computer Engineering, 06800, Ankara, Turkey {berkant,aykanat}@cs.bilkent.edu.tr
More informationAlgorithms and Applications
Algorithms and Applications 1 Areas done in textbook: Sorting Algorithms Numerical Algorithms Image Processing Searching and Optimization 2 Chapter 10 Sorting Algorithms - rearranging a list of numbers
More informationSupplementary Material for The Generalized PatchMatch Correspondence Algorithm
Supplementary Material for The Generalized PatchMatch Correspondence Algorithm Connelly Barnes 1, Eli Shechtman 2, Dan B Goldman 2, Adam Finkelstein 1 1 Princeton University, 2 Adobe Systems 1 Overview
More informationParallel Merge Sort with Double Merging
Parallel with Double Merging Ahmet Uyar Department of Computer Engineering Meliksah University, Kayseri, Turkey auyar@meliksah.edu.tr Abstract ing is one of the fundamental problems in computer science.
More informationThe Unified Segment Tree and its Application to the Rectangle Intersection Problem
CCCG 2013, Waterloo, Ontario, August 10, 2013 The Unified Segment Tree and its Application to the Rectangle Intersection Problem David P. Wagner Abstract In this paper we introduce a variation on the multidimensional
More informationModule 6 NP-Complete Problems and Heuristics
Module 6 NP-Complete Problems and Heuristics Dr. Natarajan Meghanathan Professor of Computer Science Jackson State University Jackson, MS 39217 E-mail: natarajan.meghanathan@jsums.edu P, NP-Problems Class
More informationA Simple but Effective Approach to Video Copy Detection
A Simple but Effective Approach to Video Copy Detection Gerhard Roth, Robert Laganière, Patrick Lambert, Ilias Lakhmiri, and Tarik Janati gerhardroth@rogers.com, laganier@site.uottawa.ca, patrick.lambert@univ-savoie.fr
More informationReliability Measure of 2D-PAGE Spot Matching using Multiple Graphs
Reliability Measure of 2D-PAGE Spot Matching using Multiple Graphs Dae-Seong Jeoune 1, Chan-Myeong Han 2, Yun-Kyoo Ryoo 3, Sung-Woo Han 4, Hwi-Won Kim 5, Wookhyun Kim 6, and Young-Woo Yoon 6 1 Department
More informationLecture #2. 1 Overview. 2 Worst-Case Analysis vs. Average Case Analysis. 3 Divide-and-Conquer Design Paradigm. 4 Quicksort. 4.
COMPSCI 330: Design and Analysis of Algorithms 8/28/2014 Lecturer: Debmalya Panigrahi Lecture #2 Scribe: Yilun Zhou 1 Overview This lecture presents two sorting algorithms, quicksort and mergesort, that
More information3-Dimensional Object Modeling with Mesh Simplification Based Resolution Adjustment
3-Dimensional Object Modeling with Mesh Simplification Based Resolution Adjustment Özgür ULUCAY Sarp ERTÜRK University of Kocaeli Electronics & Communication Engineering Department 41040 Izmit, Kocaeli
More informationAnalysis of Algorithms. Unit 4 - Analysis of well known Algorithms
Analysis of Algorithms Unit 4 - Analysis of well known Algorithms 1 Analysis of well known Algorithms Brute Force Algorithms Greedy Algorithms Divide and Conquer Algorithms Decrease and Conquer Algorithms
More informationEvaluation of Power Consumption of Modified Bubble, Quick and Radix Sort, Algorithm on the Dual Processor
Evaluation of Power Consumption of Modified Bubble, Quick and, Algorithm on the Dual Processor Ahmed M. Aliyu *1 Dr. P. B. Zirra *2 1 Post Graduate Student *1,2, Computer Science Department, Adamawa State
More informationA Distributed Formation of Orthogonal Convex Polygons in Mesh-Connected Multicomputers
A Distributed Formation of Orthogonal Convex Polygons in Mesh-Connected Multicomputers Jie Wu Department of Computer Science and Engineering Florida Atlantic University Boca Raton, FL 3343 Abstract The
More informationA fast approximation of the Voronoi diagram for a set of pairwise disjoint arcs
A fast approximation of the Voronoi diagram for a set of pairwise disjoint arcs Dmytro Kotsur Taras Shevchenko National University of Kyiv 64/13, Volodymyrska, st., Kyiv, Ukraine dkotsur@gmail.com Vasyl
More informationRepeating Segment Detection in Songs using Audio Fingerprint Matching
Repeating Segment Detection in Songs using Audio Fingerprint Matching Regunathan Radhakrishnan and Wenyu Jiang Dolby Laboratories Inc, San Francisco, USA E-mail: regu.r@dolby.com Institute for Infocomm
More informationComputational Geometry
Windowing queries Windowing Windowing queries Zoom in; re-center and zoom in; select by outlining Windowing Windowing queries Windowing Windowing queries Given a set of n axis-parallel line segments, preprocess
More informationComparing Centralized and Decentralized Distributed Execution Systems
Comparing Centralized and Decentralized Distributed Execution Systems Mustafa Paksoy mpaksoy@swarthmore.edu Javier Prado jprado@swarthmore.edu May 2, 2006 Abstract We implement two distributed execution
More informationX-tree. Daniel Keim a, Benjamin Bustos b, Stefan Berchtold c, and Hans-Peter Kriegel d. SYNONYMS Extended node tree
X-tree Daniel Keim a, Benjamin Bustos b, Stefan Berchtold c, and Hans-Peter Kriegel d a Department of Computer and Information Science, University of Konstanz b Department of Computer Science, University
More informationA 2k-Kernelization Algorithm for Vertex Cover Based on Crown Decomposition
A 2k-Kernelization Algorithm for Vertex Cover Based on Crown Decomposition Wenjun Li a, Binhai Zhu b, a Hunan Provincial Key Laboratory of Intelligent Processing of Big Data on Transportation, Changsha
More informationAn Efficient Decoding Technique for Huffman Codes Abstract 1. Introduction
An Efficient Decoding Technique for Huffman Codes Rezaul Alam Chowdhury and M. Kaykobad Department of Computer Science and Engineering Bangladesh University of Engineering and Technology Dhaka-1000, Bangladesh,
More informationDistance-based Outlier Detection: Consolidation and Renewed Bearing
Distance-based Outlier Detection: Consolidation and Renewed Bearing Gustavo. H. Orair, Carlos H. C. Teixeira, Wagner Meira Jr., Ye Wang, Srinivasan Parthasarathy September 15, 2010 Table of contents Introduction
More informationGeometric Data Structures
Geometric Data Structures 1 Data Structure 2 Definition: A data structure is a particular way of organizing and storing data in a computer for efficient search and retrieval, including associated algorithms
More informationGenerating Tool Paths for Free-Form Pocket Machining Using z-buffer-based Voronoi Diagrams
Int J Adv Manuf Technol (1999) 15:182 187 1999 Springer-Verlag London Limited Generating Tool Paths for Free-Form Pocket Machining Using z-buffer-based Voronoi Diagrams Jaehun Jeong and Kwangsoo Kim Department
More information6. Parallel Volume Rendering Algorithms
6. Parallel Volume Algorithms This chapter introduces a taxonomy of parallel volume rendering algorithms. In the thesis statement we claim that parallel algorithms may be described by "... how the tasks
More informationAlgorithms and Data Structures
Algorithms and Data Structures Spring 2019 Alexis Maciel Department of Computer Science Clarkson University Copyright c 2019 Alexis Maciel ii Contents 1 Analysis of Algorithms 1 1.1 Introduction.................................
More informationFinding Shortest Path on Land Surface
Finding Shortest Path on Land Surface Lian Liu, Raymond Chi-Wing Wong Hong Kong University of Science and Technology June 14th, 211 Introduction Land Surface Land surfaces are modeled as terrains A terrain
More informationVoronoi Diagrams. A Voronoi diagram records everything one would ever want to know about proximity to a set of points
Voronoi Diagrams Voronoi Diagrams A Voronoi diagram records everything one would ever want to know about proximity to a set of points Who is closest to whom? Who is furthest? We will start with a series
More informationOUTPUT-SENSITIVE ALGORITHMS FOR TUKEY DEPTH AND RELATED PROBLEMS
OUTPUT-SENSITIVE ALGORITHMS FOR TUKEY DEPTH AND RELATED PROBLEMS David Bremner Dan Chen John Iacono Stefan Langerman Pat Morin ABSTRACT. The Tukey depth (Tukey 1975) of a point p with respect to a finite
More information