1 / 32

Is 2  1D better than 2D?

Is 2  1D better than 2D?. Andrej Brodnik 1 , Mirko Zadravec 2 , Borut Žalik 2 1 University of Primorska & University of Ljubljana 2 University of Maribor. Outline. Problem definition Data structures used 2D data structures 2  1D data structures Empirical results

adina
Download Presentation

Is 2  1D better than 2D?

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Is 2  1D better than 2D? Andrej Brodnik1, Mirko Zadravec2, Borut Žalik2 1University of Primorska & University of Ljubljana 2 University of Maribor

  2. Outline • Problem definition • Data structures used • 2D data structures • 2  1D data structures • Empirical results • Conclusions or practice vs. theory Andrej Brodnik: Is 2 x 1D better than 2D?

  3. Problem • 2D space with n points • Incremental insertion: For all points p do: ds.Insert(p); ds.Neighbour(p); • Incremental dynamic version of Post-office problem (Knuth) • M. Smid, Closest-Point Problems in Computational Geometry Andrej Brodnik: Is 2 x 1D better than 2D?

  4. Data structures • No rocket science, just that it has to work • 2D: • no Voronoi diagram, • kd-trees, O(log n) • 2  1D: hashing and • Red-black trees • (a,b)-trees • (a,b)-deterministic skip lists Andrej Brodnik: Is 2 x 1D better than 2D?

  5. 2  1D Andrej Brodnik: Is 2 x 1D better than 2D?

  6. 2  1D • Number of stripes: m • Expected number of points in stripe T (Mannila et al.) T= C n * ln n/ln ln n m= n/T = 1/C n * ln ln n/ln n w= (xmax-xmin)/m C 0.6 (in tests: 0.2 < C < 1) • Inserted points are randomized Andrej Brodnik: Is 2 x 1D better than 2D?

  7. 2  1D • Algorithm: InsertAndFind(p): stripe= p.x/w; DS1D[stripe].Insert(p); Neighbour(p); Andrej Brodnik: Is 2 x 1D better than 2D?

  8. 2  1D Andrej Brodnik: Is 2 x 1D better than 2D?

  9. 2  1D • Two cases: • Need to search many stripes – O(m)= o(n) • Number of candidates is big and they are arranged on a circle – O(n) Andrej Brodnik: Is 2 x 1D better than 2D?

  10. RB-trees, (a,b)-DSL and (a,b)-trees • trees: neighbors linked • (a,b)-DSL: • between two high nodes are p lower nodes (a  p  b) • O(log n) time and O(n) space • (a,b)-trees: • B-trees with p children (a  p  b) but possibly at root • O(log n) time and O(n) space • b < 30, a = b/2 Andrej Brodnik: Is 2 x 1D better than 2D?

  11. Operations • We count the following operations: • Steps to find stripe and through the DS to find the spot for the point • Rotations necessary to balance the DS • Search in the secondary DS up or down to find the candidate • Jumps to neighboring stripes • Search in the secondary DS in neighboring stripes • Measure: average # of operations / inserted point Andrej Brodnik: Is 2 x 1D better than 2D?

  12. Gaussian distribution • Gaussian distribution • 10.000 points • 100.000 points • 1.000.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  13. Gaussian distribution – 10k Operations/point: min 20.12, max= 50.24 Andrej Brodnik: Is 2 x 1D better than 2D?

  14. Gaussian distribution – 100k Operations/point: min 22.64, max= 57.81 Andrej Brodnik: Is 2 x 1D better than 2D?

  15. Gaussian distribution – 1M Operations/point: min 24.60, max= 70.62 Andrej Brodnik: Is 2 x 1D better than 2D?

  16. Grid distribution • Grid distribution • 10.000 points • 100.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  17. Grid distribution – 10k Operations/point: min 18.36, max= 49.38 Andrej Brodnik: Is 2 x 1D better than 2D?

  18. Grid distribution – 100k Operations/point: min 20.68, max= 61.52 Andrej Brodnik: Is 2 x 1D better than 2D?

  19. Grid distribution – 1M Operations/point: min 24.35, max= 75.75 Andrej Brodnik: Is 2 x 1D better than 2D?

  20. Uniform distribution • Uniform distribution • 10.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  21. Uniform distribution Operations/point: min 19.26, max= 49.90 Andrej Brodnik: Is 2 x 1D better than 2D?

  22. Ellipsis distribution • Points on an elliptic arc • 10.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  23. Ellipsis distribution Operations/point: min 12.92, max= 44.00 Andrej Brodnik: Is 2 x 1D better than 2D?

  24. Circular distribution • Points on a circle with a point in the centre • 10.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  25. Circular distribution Operations/point: min 7.50, max= 42.26 (2514,99) Andrej Brodnik: Is 2 x 1D better than 2D?

  26. Combination of distributions • Mixture of clustered, Gaussian and uniform distribution • 100.000 points Andrej Brodnik: Is 2 x 1D better than 2D?

  27. Combination of distributions Operations/point: min 23.90, max= 64.16 Andrej Brodnik: Is 2 x 1D better than 2D?

  28. Lena’s distribution • Dark pixels from a rastered Lena • 114.215 points Andrej Brodnik: Is 2 x 1D better than 2D?

  29. Lena’s distribution Operations/point: min 13.24, max= 568.81 Andrej Brodnik: Is 2 x 1D better than 2D?

  30. GIS data • Real GIS data: border stones between the lots • 70.433 points Andrej Brodnik: Is 2 x 1D better than 2D?

  31. GIS data Operations/point: min 20.59, max= 61.29 Andrej Brodnik: Is 2 x 1D better than 2D?

  32. Conclusions • Need a better model? • Average and amortized analysis • Why m= 1/C n * ln ln n/ln n Andrej Brodnik: Is 2 x 1D better than 2D?

More Related