computational geometry - people.engr.ncsu.edu · computational geometry • design and analysis of...

17
Computational Geometry Design and analysis of algorithms for solving geometric problems Modern study started with Michael Shamos in 1975 Facility location: geometric data structures used to “simplify” solution procedures -4 -3 -2 -1 0 1 2 3 4 -4 -3 -2 -1 0 1 2 3 4 51

Upload: others

Post on 17-Mar-2020

17 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Computational Geometry• Design and analysis of

algorithms for solving geometric problems– Modern study

started with Michael Shamos in 1975

• Facility location:– geometric data

structures used to “simplify” solution procedures

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

51

Page 2: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Convex Hull• Find the points that

enclose all points– Most important data

structure– Calculated, via

Graham’s scan in

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

52

( log ), pointsO n n n

Page 3: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Delaunay Triangulation• Find the triangula-

tion of points that maximizes the minimum angle of any triangle– Captures proximity

relationships– Used in 3-D

animation– Calculated, via

divide and conquer, in

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

53

( log ), pointsO n n n

Page 4: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Voronoi Diagram• Each region defines

area closest to a point– Open face regions

indicate points in convex hull

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

-10 -5 0 5 10-10

-8

-6

-4

-2

0

2

4

6

8

10

54

Page 5: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Voronoi Diagram• Voronoi diagram from smooshing paint between glass

– https://youtu.be/yDMtGT0b_kg

55

Page 6: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Delaunay-Voronoi• Delaunay triangula-

tion is straight-line dual of Voronoidiagram– Can easily convert

from one to another

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

56

Page 7: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Minimum Spanning Tree• Find the minimum

weight set of arcs that connect all nodes in a graph– Undirected arcs:

calculated, via Kruskal’s algorithm,

– Directed arcs:calculated, via Edmond’s branching algorithm, in

-4 -3 -2 -1 0 1 2 3 4-4

-3

-2

-1

0

1

2

3

4

57

( log ), arcs, nodesO m n m n

( ), arcs, nodesO mn m n

Page 8: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Kruskal’s Algorithm for MST• Algorithm:

1. Create set F of single node trees

2. Create set S of all arcs3. While S nonempty and F is

not yet spanning4. Remove min arc from S5. If removed arc connects two

different trees, then add to F, combining two trees into single tree

6. If graph connected, F forms single MST; otherwise, forms multi-tree min spanning forest

• Optimal “greedy” algorithm, runs in O(m logn)

• If directed arcs, O(mn)– useful in VRP to min vehicles– harder to code

58

-4 -3 -2 -1 0 1 2 3 4-3

-2

-1

0

1

2

3

1

2

3

4

5

6

7

8

4

15

12

5

13

7

10

16

2

17

11

1814

8

3

m = 15 arcs, n = 8 nodes

Page 9: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Min Spanning vs Steiner Trees • Steiner point added to reduce distance connecting three

existing points compared to min spanning tree

59

b a

b

b

a a

SteinerPoint

1 3 3 , 30 60 90 triangle2 2

Min spanning tree distance > Steiner tree distance

2 3

2 3 3

2 3

4 3

b a b a

b a

a a

= ⇒ = − −

>

>

>

>

Page 10: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Steiner Network

60

Page 11: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Metric Distances

61

x

y

Page 12: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Chebychev Distances

62

Proof

Page 13: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Great Circle Distances

13.35 mi

R

63

Page 14: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Metric Distances using dists

× ×× ×

××

• • = = = • • • •

3 2 2 2

3 2

4 51 'mi' 'km'

dists( , , ),2 1 2 Inf3 n d m d

n m

p pD X1 X2

[ ]• • = • • = • • ⇒ • •

, 2X1 X

[ ] [ ]= • • = • • ⇒, 2X1 X

• • • • = • • = • • ⇒ • • • •

, 2X1 X

[ ]= •d

[ ]= • • •d

• • • = • • • • • •

D

• • = = ⇒ • • , 2X1 X

• • = • • D

d = 2 d = 1

[ ]• = = • • ⇒ • , 2X1 X Error

2

1

3

4

5

64

Page 15: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Mercator Projection

-200 -150 -100 -50 0 50 100 150 200-80

-60

-40

-20

0

20

40

60

80

100

-150 -100 -50 0 50 100 150

-75

-50

-25

0

25

50

75

( )

( )

proj

1proj

1proj

sinh tan

tan sinh

x x

y y

y y

=

=

=

deg radrad deg

180and180x xx xπ

π⋅

= =

65

Page 16: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Circuity Factor

66-80 -79.5 -79 -78.5 -78 -77.5

35

35.2

35.4

35.6

35.8

36

36.2

36.4

36.6

From High Point to Goldsboro: Road = 143 mi, Great Circle = 121 mi, Circuity = 1.19

High Point

Goldsboro

road

road 1 2 1 2

: , where usually 1.15 1.5, weight of sample

( , ), estimated road distance from to

i

i

i iGC

GC

dCircuity Factor g v g v id

d g d P P P P

= ≤ ≤

≈ ⋅

Page 17: Computational Geometry - people.engr.ncsu.edu · Computational Geometry • Design and analysis of algorithms for solving geometric problems – Modern study started with Michael

Estimating Circuity Factors• Circuity factor depends on both the trip density and

directness of travel network– Circuity of high trip density areas should be given more

weight when estimating overall factor for a region– Obstacles (water, mountains) limit direct road travel

67

60k pop. 30k pop.

10k pop.

1,3

1,31.2

0.22

gv

==

1,2

1,2

1.1

0.67

g

v

=

=2,32,3 1.40.11

g

v

==

1 2