Delaunay triangulations: properties, algorithms, and ... · 3-6 Delaunay Triangulation:...

of 182 /182
1-1 Delaunay triangulations: properties, algorithms, and complexity Olivier Devillers

Embed Size (px)

Transcript of Delaunay triangulations: properties, algorithms, and ... · 3-6 Delaunay Triangulation:...

  • 1 - 1

    Delaunay triangulations: properties, algorithms, and complexity

    Olivier Devillers

  • 1 - 2

    Delaunay triangulations: properties, algorithms, and complexity

    Olivier Devillers

    Extra question: what is the difference

    between an algorithm and a program?

  • 2

    Algorithm

    Recipe to go from the input to the output

    Formalized description in some language

    May use data structure

    Proof of correctness

    Complexity analysis

  • 3 - 1

    Delaunay Triangulation: definition, empty circle property

  • 3 - 2

    Delaunay Triangulation: definition, empty circle property

    Point set

  • 3 - 3

    Delaunay Triangulation: definition, empty circle property

    Point set

    Query

  • 3 - 4

    Delaunay Triangulation: definition, empty circle property

    Point set

    Query

  • 3 - 5

    Delaunay Triangulation: definition, empty circle property

    Point set

    Query

  • 3 - 6

    Delaunay Triangulation: definition, empty circle property

    Point set

    Query

    Nearest neighbor

  • 3 - 7

    Delaunay Triangulation: definition, empty circle property

    Point set

    Voronoi diagram

  • 3 - 8

    Delaunay Triangulation: definition, empty circle property

    Point set

    Voronoi diagram

  • 3 - 9

    Delaunay Triangulation: definition, empty circle property

    Point set

    Voronoi diagram

  • 3 - 10

    Delaunay Triangulation: definition, empty circle property

    Point set

    Voronoi diagram

  • 3 - 11

    Delaunay Triangulation: definition, empty circle property

    Point set

    Delaunay triangulation

    Voronoi diagram

  • 3 - 12

    Delaunay Triangulation: definition, empty circle property

    Point set

    Empty circle property

    Delaunay triangulation

  • 3 - 13

    Delaunay Triangulation: definition, empty circle property

    Point set

    Empty circle property

    Delaunay triangulation

  • 4 - 1

    Delaunay Triangulation: size

  • 4 - 2

    Delaunay Triangulation: size

    Euler relation

    Vertice

    sEdg

    esFac

    es

    n e t+ 1 = 2 +

  • 4 - 3

    Delaunay Triangulation: size

    Euler relation

    Vertice

    sEdg

    esFac

    es

    n e t+ 1 = 2 +

    triangular faces 3t+ k = 2e

  • 4 - 4

    Delaunay Triangulation: size

    t = 2n k 2 < 2n

    e = 3n k 3 < 3n

    Euler relation

    Vertice

    sEdg

    esFac

    es

    n e t+ 1 = 2 +

    triangular faces 3t+ k = 2e

  • 4 - 5

    Delaunay Triangulation: size

    Euler relation

    Vertice

    sEdg

    esFac

    es

    n e t+ 1 = 2 +

    triangular faces 3t+ k = 2e

    X

    p2Sd(p) = 2e = 6n 2k 6

    E(d(p)) = 1nX

    p2Sd(p) < 6

    average on the choice of point p in set of points S

  • 5 - 1

    Delaunay Triangulation: max-min angle

  • 5 - 2

    Delaunay Triangulation: max-min angle

    Triangulation Delaunay

  • 5 - 3

    Delaunay Triangulation: max-min angle

    Triangulation Delaunay

    smallest angle

  • 5 - 4

    Delaunay Triangulation: max-min angle

    Triangulation Delaunay

    smallest angle

  • 5 - 5

    Delaunay Triangulation: max-min angle

    Triangulation Delaunay

    smallest angle

  • 5 - 6

    Delaunay Triangulation: max-min angle

    Triangulation Delaunay

    smallest angle

    second smallest angle

  • 6 - 1

    Delaunay Triangulation: max-min angle

    Proof

  • 6 - 2

    Delaunay Triangulation: max-min angle

    Delaunay edgeDefinition

  • 6 - 3

    Delaunay Triangulation: max-min angle

    Delaunay edge

    9 empty circle

    Definition

  • 6 - 4

    Delaunay Triangulation: max-min angle

    Delaunay edgelocally w.r.t. a triangulationDefinition

  • 6 - 5

    Delaunay Triangulation: max-min angle

    Delaunay edgelocally w.r.t. a triangulation

    9 circlenot enclosing the two neighbors

    Definition

    neighbor = visible from the edge

  • 7 - 1

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

  • 7 - 2

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

    Proof:

    choose an edge

  • 7 - 3

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

    Proof:

    choose an edge

    edges of the quadrilateral

    are locally Delaunay

  • 7 - 4

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

    Proof:

    choose an edge

    edges of the quadrilateral

    are locally Delaunay

  • 7 - 5

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

    Proof:

    choose an edge

    edges of the quadrilateral

    are locally Delaunay

    Vertices visible through one edge are outside circle

  • 7 - 6

    Delaunay Triangulation: max-min angle

    Lemma (8 edge: locally Delaunay) () Delaunay

    Proof:

    choose an edge

    edges of the quadrilateral

    are locally Delaunay

    Vertices visible through one edge are outside circle

    Induction ! all vertices outside circle

  • 8 - 1

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Two possible triangulation

  • 8 - 2

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Case 1: smallest angle in corner

  • 8 - 3

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Case 1: smallest angle in corner

    9 a smaller angle 2 other triangulation

    <

  • 8 - 4

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Case 2: smallest angle

    along diagonal

  • 8 - 5

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Case 2: smallest angle

    along diagonal

  • 8 - 6

    Delaunay Triangulation: max-min angle

    Lemma For four points in convex position

    Delaunay () maximize the smallest angle

    Case 2: smallest angle

    9 a smaller angle 2 other triangulation

    <

    along diagonal

  • 9 - 1

    Delaunay Triangulation: max-min angle

    Map: Triangulations ! R6n3k4 smallest angle 1

  • 9 - 2

    Delaunay Triangulation: max-min angle

    Map: Triangulations ! R6n3k4 smallest angle 1second smallest angle 2

  • 9 - 3

    Delaunay Triangulation: max-min angle

    Map: Triangulations ! R6n3k4 smallest angle 1second smallest angle 2third smallest angle 3

  • 9 - 4

    Delaunay Triangulation: max-min angle

    Map: Triangulations ! R6n3k4 smallest angle 1second smallest angle 2third smallest angle 3

    (1,2,3, . . . ,6n3k4)

  • 9 - 5

    Delaunay Triangulation: max-min angle

    Map: Triangulations ! R6n3k4 smallest angle 1second smallest angle 2third smallest angle 3

    (1,2,3, . . . ,6n3k4)

    sort triangulations in lexicographic order

  • 10 - 1

    Delaunay Triangulation: max-min angle

    Theorem:

    Delaunay maximizes minimum angles (in lexicographic order)

  • 10 - 2

    Delaunay Triangulation: max-min angle

    Theorem:

    Delaunay maximizes minimum angles (in lexicographic order)

    Proof:Let T be the triangulation maximizing angles

  • 10 - 3

    Delaunay Triangulation: max-min angle

    Theorem:

    Delaunay maximizes minimum angles (in lexicographic order)

    Proof:Let T be the triangulation maximizing angles

    =) 8 convex quadrilateral (from 2 triangles 2 T )

    the diagonal maximizes smallest angle (in quad)

  • 10 - 4

    Delaunay Triangulation: max-min angle

    Theorem:

    Delaunay maximizes minimum angles (in lexicographic order)

    Proof:Let T be the triangulation maximizing angles

    =) 8 convex quadrilateral (from 2 triangles 2 T )

    the diagonal maximizes smallest angle (in quad)

    =) 8 edge, it is locally Delaunay

  • 10 - 5

    Delaunay Triangulation: max-min angle

    Theorem:

    Delaunay maximizes minimum angles (in lexicographic order)

    Proof:Let T be the triangulation maximizing angles

    =) 8 convex quadrilateral (from 2 triangles 2 T )

    the diagonal maximizes smallest angle (in quad)

    =) 8 edge, it is locally Delaunay

    =) T = Delaunay

  • 11 - 1

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

  • 11 - 2

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

  • 11 - 3

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

    compute Delaunay triang.

  • 11 - 4

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

    compute Delaunay triang.

    find lowest point

  • 11 - 5

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

    compute Delaunay triang.

    find lowest point

    enumerate x coordinatesin ccw CH order

  • 11 - 6

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

    compute Delaunay triang.

    find lowest point

    enumerate x coordinatesin ccw CH order

    O(n)

    f(n)

    O(n)

    O(n)

    Lower bound on sorting

    =) f(n) +O(n) (n log n)

  • 11 - 7

    Delaunay triangulation Lower bound

    A stupid algorithm for sorting numbers

    project on parabola

    compute Delaunay triang.

    find lowest point

    enumerate x coordinatesin ccw CH order

    O(n)

    f(n)

    O(n)

    O(n)

    Lower bound on sorting

    =) f(n) +O(n) (n log n)

  • 12 - 1

    Delaunay Triangulation: predicates

  • 12 - 2

    Delaunay Triangulation: predicates

    Orientation predicate

    p

    qrpqr + ?

    xq xp xr xpyq yp yr yp

    =

    1 1 1

    xp xq xryp yq yr

    > 0

    pqr - ?

    1 1 1

    xp xq xryp yq yr

    < 0

    pqr 0 ?

    1 1 1

    xp xq xryp yq yr

    = 0

    p

    q

    r

    p

    q

    r

  • 12 - 3

    Delaunay Triangulation: predicates

    pqr ccw triangle

    pq

    r

    query s

    s

    inside circumcircle

    Incircle predicate

  • 12 - 4

    Delaunay Triangulation: predicates

    pqr ccw triangle

    pq

    r

    query s

    s

    cocircular

  • 12 - 5

    Delaunay Triangulation: predicates

    pqr ccw triangle

    pq

    r

    query s

    s

    outside circumcircle

  • 12 - 6

    Delaunay Triangulation: predicates

    pqr ccw triangle

    pq

    r

    query s

  • 12 - 7

    Delaunay Triangulation: predicates

    Space of circles

    p = (x, y) p? = (x, y, x2 + y2)

  • 12 - 8

    Delaunay Triangulation: predicates

    Space of circles

    circle through pqr plane through p?q?r?

    s inside/outside of

    above/below s?

    incircle predicate

    3D orientation predicate

  • 12 - 9

    Delaunay Triangulation: predicates

    Space of circles

    circle through pqr plane through p?q?r?

    s inside/outside of

    above/below s?

    incircle predicate

    3D orientation predicatesign

    1 1 1 1

    xp xq xr xsyp yq yr ys

    x2p + y2p x

    2q + y

    2q x

    2r + y

    2r x

    2s + y

    2s

  • 13

    Delaunay Triangulation: data structure

    Data structure for (Delaunay) triangulation

    Representing incidences

    Representing hull boundary

    Representing users data put c in trianglesolors

  • 14 - 1

    Delaunay Triangulation: very naive algorithm

  • 14 - 2

    Delaunay Triangulation: very naive algorithm

    For each triple of points (p, q, r)

    For each point s

    If pqr ccw

    If s in circle pqr

    Delaunay = true;

    Delaunay = false;

    Output pqr

  • 14 - 3

    Delaunay Triangulation: very naive algorithm

    For each triple of points (p, q, r)

    For each point s

    If pqr ccw

    If s in circle pqr

    Delaunay = true;

    Delaunay = false;

    Output pqr

    Correctness: easy

  • 14 - 4

    Delaunay Triangulation: very naive algorithm

    For each triple of points (p, q, r)

    For each point s

    If pqr ccw

    If s in circle pqr

    Delaunay = true;

    Delaunay = false;

    Output pqr

    Correctness: easy

    Complexity: O(n4)

  • 14 - 5

    Delaunay Triangulation: very naive algorithm

    For each triple of points (p, q, r)

    For each point s

    If pqr ccw

    If s in circle pqr

    Delaunay = true;

    Delaunay = false;

    Output pqr

    Correctness: easy

    Complexity: O(n4)

    does not compute incidences

  • 15 - 1

    Delaunay Triangulation: incremental algorithm

  • 15 - 2

    Delaunay Triangulation: incremental algorithm

    New point

  • 15 - 3

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

  • 15 - 4

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 5

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 6

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 7

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 8

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 9

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 10

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 11

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

  • 15 - 12

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

    not unique

  • 15 - 13

    Delaunay Triangulation: incremental algorithm

    New point

    Locate

    e.g.: visibility walk

    not unique

  • 15 - 14

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

  • 15 - 15

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

  • 15 - 16

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

    May loop

  • 15 - 17

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

    May loop

    Not Delaunay

  • 15 - 18

    Delaunay Triangulation: pencils of circles

    Power of a point w.r.t a circle

    x2 + y2 2ax 2by + c

    blue yields smaller power

    black yields smaller power

    equal power

    (x2 + y2 2a0x 2b0y + c0)

    +(1 ) ( ) = 0

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

  • 15 - 19

    Delaunay Triangulation: incremental algorithm

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

  • 15 - 20

    Delaunay Triangulation: incremental algorithm

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

    Green power Red power

  • 15 - 21

    Delaunay Triangulation: incremental algorithm

    Visibility walk terminates

    Delaunay Triangulation: incremental algorithm

    Green power Red power