Algorithm Engineering (aka. How to Write Fast Code) CS26 S260 - - PowerPoint PPT Presentation

algorithm engineering
SMART_READER_LITE
LIVE PREVIEW

Algorithm Engineering (aka. How to Write Fast Code) CS26 S260 - - PowerPoint PPT Presentation

Algorithm Engineering (aka. How to Write Fast Code) CS26 S260 Lecture cture 12 Yan n Gu An Overview of Geometry Processing What is geometry processing? Gr Graph h studi dies es the rela latio ionsh nship ip of objects ts


slide-1
SLIDE 1

Algorithm Engineering

(aka. How to Write Fast Code)

An Overview of Geometry Processing

CS26 S260 – Lecture cture 12 Yan n Gu

slide-2
SLIDE 2

What is geometry processing?

  • Gr

Graph h studi dies es the rela latio ionsh nship ip of objects ts

  • Ge

Geometry try studies dies the lo locatio ions ns of the objects ts themse mselv lves es

slide-3
SLIDE 3

Lots of real-world applications

3

slide-4
SLIDE 4

4

Database / Data warehouses Data mining / Data science Machine learning / Artificial intelligence

Every area requires geometry processing

Computational biology Computer graphics Geometric Information Systems (GIS)

slide-5
SLIDE 5

Computational Geometry

  • Started in mid 70’s
  • Focused

sed on a abst strac actin ting g the ge geometri tric proble lems, ms, and design ign and analy lysis is of alg lgorit ithms hms for these e proble lems ms

  • Many

y proble lems ms well ll-sol solved ved, , whil ile e many y other proble lems ms remain in open

  • UC

UCR CS R CS 133 133 - Co Computa utationa tional l Ge Geometry try

  • MIT 6.

6.838 - Ge Geomet etric ic Computat utation ion

5

slide-6
SLIDE 6

Good references for sequential geometric algorithms

6

“Four Dutchmen” “The elephant book” Har-Peled’s book

slide-7
SLIDE 7

Algorithm Engineering

Theory Practice

O(n log n) O(n) O(log n)

  • Theory

y is is no no lo longe ger suffic fficie ient nt to g guarant antee ee go good theoretic tical al perfo forma mance nce, , becaus ause e comput uter er archite itectu cture e becomes mes sig ignific ificantl antly y more sophi histic sticate ated

  • Parall

llel elism, ism, I/O ef effici ficienc ency, y, new hardw dware re such h as non-vo vola latil tile e memori

  • ries,

es, and spec ecific ific applic licat ation ions

slide-8
SLIDE 8

Convex Hull, Triangulation, and others

8

slide-9
SLIDE 9

Convex hull

  • A set is convex if every line segment connecting two points in

the set is fully contained in the set

  • Example applications: nearest/farthest point to a line, point

9

slide-10
SLIDE 10

How to construct a convex hull

  • Dozens of algorithms sequentially, a few parallel ones for 2D
  • Randomized incremental construction
  • Only requires 𝑷(log 𝒐) rounds if adding all possible points

[BGSS SPAA 2020]

10 1 2 4 3 11 7 5 9 10 8 6

slide-11
SLIDE 11

What’s triangulation for?

slide-12
SLIDE 12

What’s a good triangulation?

slide-13
SLIDE 13
  • No points are in the circumcircle of each triangle
  • Getting practical parallel algorithms for DT is notoriously hard

Delaunay triangulation (DT)

slide-14
SLIDE 14

Delaunay triangulation (DT)

  • Again, consider the incremental construction
slide-15
SLIDE 15
  • Again, consider the incremental construction

Delaunay triangulation (DT)

slide-16
SLIDE 16
  • Again, consider the incremental construction
  • 2D parallel version is given in [BGSS SPAA 2016 / JACM 2020]
  • Higher-D version is in [BGSS SPAA 2020], since 𝒍-D DT can be

subsumed by (𝒍 + 𝟐)-D convex hull

Delaunay triangulation (DT)

slide-17
SLIDE 17

Point location

  • In a 2D plain, decide which polygon a query point belongs to
  • Example solution: trapezoidal decomposition (no parallel solution)
  • Other options: Delaunay refinement

17

slide-18
SLIDE 18

Range Searches

18

slide-19
SLIDE 19

Example range searches

  • Nearest neighbor search
  • 𝒍-nearest neighbor (𝒍NN)

search

  • Near neighbor counting
  • Rectangular range search
  • Rectangle queries
  • Three-sided queries
  • Segment (stabbing)

queries

19

  • Ray-scene intersection

queries

  • Collision detection
  • etc.

Building blocks in other algorithms / systems

slide-20
SLIDE 20

Classic (sequential) data structures

  • Quad/octree
  • 𝒍-d tree
  • Interval tree
  • Segment tree
  • Range tree
  • Priority tree
  • Other augmented trees
  • R-tree, bounding volume hierarchy (BVH)

20

slide-21
SLIDE 21

Why trees?

21 1 2 3 A B C D E F

3 2 1

A B E F D C

slide-22
SLIDE 22

Each interior tree node acts as a fast-pass check for the subtree nodes

  • No need to traverse the subtree if the traversal can be pruned

22 1 2 3 C A B E F D A B C D E F

3 2 1

1 2 C 3

NNS

slide-23
SLIDE 23

Each interior tree node acts as a fast-pass check for the subtree nodes

  • No need to traverse the subtree if the query misses the

bounding box

23 1 2 3 C A B E F D A B C D E F

3 2 1

1 2 A B C 3

slide-24
SLIDE 24

Example range searches

  • Nearest neighbor search
  • 𝒍-nearest neighbor (𝒍NN)

search

  • Near neighbor counting
  • Rectangular range search
  • Rectangle queries
  • Three-sided queries
  • Segment (stabbing)

queries

24

  • Ray-scene intersection

queries

  • Collision detection
  • etc.
slide-25
SLIDE 25

Classic (sequential) data structures

  • Quad/octree
  • 𝒍-d tree
  • Interval tree
  • Segment tree
  • Range tree
  • Priority tree
  • Other augmented trees
  • R-tree, bounding volume hierarchy (BVH)

25

slide-26
SLIDE 26

“Modern” Geometry Problems

26

slide-27
SLIDE 27

Problems that are less “classic” (from MIT 6.838)

  • Clustering
  • Range searches in “high” (>5) dimensions
  • Low-distortion embeddings
  • Geometric algorithms for modern architecture
  • Geometric algorithms for streaming data

27

slide-28
SLIDE 28

Monday lecture (5/18)

  • Efficient BVH Construction via Approximate Agglomerative

Clustering, by Lei Zhang

  • Parallel Range, Segment and Rectangle Queries with

Augmented Maps, by Longze Su

  • Theoretically-Efficient and Practical Parallel DBSCAN,

by Jinyang Liu

  • Engineering a compact parallel Delaunay algorithm in 3D,

by Haide He

28

Wednesday lecture (5/20)

slide-29
SLIDE 29

Friday lecture (5/22): final project milestone

  • Every of you will give a 5-minute talk about the current

progress of your final project (with slides)

  • Reserve your time slot here:

https://docs.google.com/spreadsheets/d/1De2HOpzUewLK6l aMJqnxF5bahzSBu1fJUR_hSMM9qt8/edit?usp=sharing

29

Paper reading is due this Friday (5/15)