124
1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc int work with Daniel Spielman (MIT)

1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Embed Size (px)

Citation preview

Page 1: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

1

Smoothed Analysis of Algorithms

Shang-Hua Teng

Boston University

Akamai Technologies Inc

Joint work with Daniel Spielman (MIT)

Page 2: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

2

Outline

• Part I: Introduction to Algorithms

• Part II: Smoothed Analysis of Algorithms

• Part III: Geometric Perturbation

Page 3: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

3

Part I: Introduction to Algorithms

• Type of Problems

• Complexity of Algorithms

• Randomized Algorithms

• Approximation

• Worst-case analysis

• Average-case analysis

Page 4: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

4

Algorithmic Problems• Decision Problem:

– Can we 3-color a given graph G?

• Search Problem:– Given a matrix A and a vector b, find an x

– s.t., A x = b

• Optimization Problem: – Given a matrix A and a vector b, and an objective

vector c, find an x that

– maximize cT x s.t. A x b

Page 5: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

5

The size and family of a problem

• Instance of a problem– Input:

• for example, a graph, a matrix, a set of points

– desired output• {yes,no}, coloring, solution-vector, convex hull

– Input and output size• Amount of memory needed to store the input and output

• For example: number of vertices in a graph, dimensions of a matrix, the cardinality of a point set

• A problem is a family of instances.

Page 6: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

6

An Example

Median of a set of numbers

• Input: a set of numbers {a1,, a2,…, an}

• Output: ai that maximizes

n

aaaaaa ijjijj |)}:{||,}:{min(|

1 2 3 4 5 6 7 8 9 10

Page 7: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

7

Quick Selection

Quick Selection ({a1,, a2,…, an}, k )

1. Choose a1 in {a1,, a2,…, an}

2. Divide the set into

3. Cases:

1. If k = |L| + 1, return a1;

2. If k < |L|, recursively apply Quick_Selection(L,k)

3. If k > |L|+1, recursively apply Quick_Selection(L,n-k-1)

}{},{},{ 111 aaRaaaL jj

Page 8: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

8

Worse-Case Time ComplexityLet T({a1,, a2,…, an} ) be the number of basic steps needed

in Quick-Selection for input {a1,, a2,…, an}.• We classify inputs by their size• Let An be the set of all input of size n.

• T(n) = n2 - n

}),,({max)( 1},{ 1

nAaa

aaTnTnn

Page 9: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

9

Better Algorithms from Worst-case View point

• Divide and Conquer– Linear-time algorithm– Blum-Floyd-Pratt-Rivest-Tarjan

Page 10: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

10

Average-Case Time Complexity

• Let An be the set of all input of size n.

• Choose {a1,, a2,…, an} uniformly at random

• E(T(n)) = O(n)

}),,({)( 1},{ 1

nAaa

aaTEnTAvgnn

Page 11: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

11

Randomized Algorithms

Quick Selection ({a1,, a2,…, an}, k )

1. Choose a random element s in {a1,, a2,…, an}

2. Divide the set into

3. Cases:1. If k = |L| + 1, return s;2. If k < |L|, recursively apply Quick_Selection(L,k) 3. If k > |L|+1, recursively apply

Quick_Selection(L,n-k-1)

}{},{},{ saRssaL jj

Page 12: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

12

Expected Worse-Case Complexityof Randomized Algorithms

}),,({max)( 1},{ 1

nAaa

aaTEnTEnn

E(T(n)) = O(n)

Page 13: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

13

Approximation Algorithms

Sampling-Selection ({a1,, a2, …, an})

1. Choose a random element ai from {a1,, a2,…, an}

2. Return ai.

ai is a δ–median if

Prob[ai is a (1/4)–median ] = 0.5

n

aaaaaa ijjijj |)}:{||,}:{min(|

Page 14: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

14

Approximation Algorithms

Sampling-Selection ({a1,, a2, …, an})

1. Choose a set S of random k elements from {a1,,

…, an}

2. Return the median ai of S.

Complexity: O(k) 21212/1Pr k

i emedianaisa

Page 15: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

15

When k = 3

a b c

M id d le -o f-3

Page 16: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

16

Iterative Middle-of-3(Miller-Teng)

m id -o f-3 m id -o f-3 m id -o f-3

m id -o f-3

Randomly assign elements from {a1,, a2, …, an} to the leaves

2/12/1Pr ki emedianaisa

Page 17: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

17

Summary

• Algorithms and their complexity

• Worst-case complexity

• Average-cast complexity

• Design better worse-case algorithm

• Design better algorithm with randomization

• Design faster algorithm with approximation

Page 18: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

18

Sad and Exciting Reality• Most interesting optimization problems are hard• P vs NP• NP-complete problems

– Coloring, maximum independent set, graph partitioning

– Scheduling, optimal VLSI layout, optimal web-traffic assignment, data mining and clustering, optimal DNS and TCPIP protocols, integer programming…

• Some are unknown:– Graph isomorphism

– factorization

Page 19: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

19

Good News

• Some fundamental problems are solvable in polynomial time– Sorting, selection, lower dimensional

computational geometry– Matrix problems

• Eigenvalue problem• Linear systems

– Linear programming (interior point method)– Mathematical programming

Page 20: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

20

Better News I

• Randomization helps– Testing of primes (essential to RSA)– VC-dimension and sampling for computational

geometry and machine learning– Random walks various statistical problems– Quicksort– Random routing on parallel network– Hashing

Page 21: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

21

Better News II

• Approximation algorithms– On-line scheduling– Lattice basis reduction (e.g. in cryptanalysis)– Approximate Euclidean TSP and Steiner trees– Graph partitioning– Data clustering– Divide-and-conquer method for VLSI layout

Page 22: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

22

Real Stories• Practical algorithms and heuristics

– Great-performance empirically – Used daily by millions and millions of people– Worked routinely from chip design to airline

scheduling

• Applications– Internet routing and searching– Scientific simulation– Optimization

Page 23: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

23

PART II: Smoothed Analysis of Algorithms

• Introduction of Smoothed Analysis

• Why smoothed analysis?

• Smoothed analysis of the Simplex Method for Linear Programming

Page 24: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

24

Smoothed Analysis of Algorithms: Why The Simplex Method Usually Takes

Polynomial Time

Daniel A. Spielman (MIT)

Shang-Hua Teng (Boston University)

Gaussian Perturbationwith variance 2

Page 25: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

25

Remarkable Algorithms and Heuristics

Work well in practice, but

Worst case: bad, exponential, contrived.

Average case: good, polynomial, meaningful?

Page 26: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

26

Random is not typical

Page 27: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

27

Smoothed Analysis of Algorithms:

worst casemaxx T(x)

average caseavgr T(r)

smoothed complexitymaxx avgr T(x+r)

Page 28: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

28

Smoothed Analysis of Algorithms

• Interpolate between Worst case and Average Case.

• Consider neighborhood of every input instance

• If low, have to be unlucky to find bad input instance

Page 29: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

29

Smoothed ComplexitySmoothed Complexity

Page 30: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

30

Classical Example: Simplex Method for Linear Programming

max zT xs.t. A x y

• Worst-Case: exponential

• Average-Case: polynomial

• Widely used in practice

Page 31: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

31

Carbs Protein Fat Iron Cost

1 slice bread 30 5 1.5 10 30¢

1 cup yogurt 10 9 2.5 0 80¢

2tsp Peanut Butter 6 8 18 6 20¢

US RDA Minimum 300 50 70 100

Minimize 30 x1 + 80 x2 + 20 x3

s.t. 30x1 + 10 x2 + 6 x3 300 5x1 + 9x2 + 8x3 50 1.5x1 + 2.5 x2 + 18 x3 70 10x1 + 6 x3 100 x1, x2, x3 0

The Diet Problem

Page 32: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

32

max zT xs.t. A x y

Max x1 +x2

s.t x1 1 x2 1 -x1 - 2x2 1

Linear Programming

Page 33: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

33

Smoothed Analysis of Simplex Method

max zT xs.t. A x y

G is Gaussian

max zT xs.t. (A +G) x y

Page 34: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

34

• Worst-Case: exponential

• Average-Case: polynomial

• Smoothed Complexity: polynomial

max zT xs.t. ai

T x ±1, ||ai|| 1

max zT xs.t. (ai+gi )T x ±1

Smoothed Analysis of Simplex Method

Page 35: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

35

Perturbation yields Approximation

For polytope of good aspect ratio

Page 36: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

36

But, combinatorially

Page 37: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

37

The Simplex Method

Page 38: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

38

• Simplex Method (Dantzig, ‘47)• Exponential Worst-Case (Klee-Minty ‘72) • Avg-Case Analysis (Borgwardt ‘77, Smale ‘82,

Haimovich, Adler, Megiddo, Shamir, Karp, Todd)• Ellipsoid Method (Khaciyan, ‘79)• Interior-Point Method (Karmarkar, ‘84)• Randomized Simplex Method (mO(d) )

(Kalai ‘92, Matousek-Sharir-Welzl ‘92)

History of Linear Programming

Page 39: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

39

Shadow Vertices

Page 40: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

40

Another shadow

Page 41: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

41

Shadow vertex pivot rule

objective

start z

Page 42: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

42

Theorem: For every plane, the expected size of the shadow of the perturbed tope is poly(m,d,1/)

Page 43: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

43

Theorem: For every z, two-Phase Algorithm runs in expected time

poly(m,d,1/)

z

Page 44: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

44

Vertex on a1,…,ad maximizes z iff

z cone(a1,…,ad )

0

a1

a2

z

z

A Local condition for optimality

Page 45: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

45

Polar ConvexHull(a1, a2, … am)

Primala1

T x 1a2

T x 1…am

T x 1

Page 46: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

46

Page 47: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

47

max z ConvexHull(a1, a2, ..., am)

z

Polar Linear Program

Page 48: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

48

Initial Simplex

Opt Simplex

Page 49: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

49

Shadow vertex pivot rule

Page 50: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

50

Page 51: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

51

Count facets by discretizing

to N directions, N

Page 52: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

52

Count pairs in different facets

Pr Different Facets[ ]< c/N

So, expect c Facets

Page 53: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

53

Expect cone of large angle

Page 54: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

54

Angle

Distance

Page 55: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

55

Isolate on one Simplex

Page 56: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

56

Integral Formulation

Page 57: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

57

Example:

For a and b Gaussian distributed points, given that ab intersects x-axis

Prob[ < ] = O(2)

a

b

Page 58: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

58

a

b

Page 59: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

59

a

b

Page 60: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

60

a

b

Page 61: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

61

ab

Page 62: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

62

Claim: For < P < 2

a

b

ba

dadbbaaxisabc,

10 )()(]0][[

]0Pr[ axisabP

Page 63: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

63

Change of variables

a

b

zu

v

da db = |(u+v)sin(du dv dz d

),,()( 00 zua

),,()( 11 zvb

Page 64: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

64

ddzdvduzvzuvucPzvu

),,(),,(|)|)( 10

,,

sin(

Analysis: For < P < 2

Slight change in has little effect on i for all but very rare u,v,z

Page 65: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

65

Distance: Gaussian distributed corners

a1

a2

a3

p

Page 66: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

66

Idea: fix by perturbation

Page 67: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

67

Trickier in 3d

Page 68: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

68

Future Research – Simplex Method

• Smoothed analysis of other pivot rules

• Analysis under relative perturbations.

• Trace solutions as un-perturb.

• Strongly polynomial algorithm for linear programming?

Page 69: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

69

A Theory Closer to Practice• Optimization algorithms and heuristics, such as

Newton’s Method, Conjugate Gradient, Simulated Annealing, Differential Evolution, etc.

• Computational Geometry, Scientific Computing and Numerical Analysis

• Heuristics solving instances of NP-Hard problems.

• Discrete problems?

• Shrink intuition gap between theory and practice.

Page 70: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

70

Part III: Geometric Perturbation

Three Dimensional Mesh Generation

Page 71: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Delaunay Triangulations for Well-Shaped 3D Mesh Generation

Shang-Hua Teng

Boston University

Akamai Technologies Inc.

Page 72: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Collaborators:

Siu-Wing Cheng, Tamal Dey, Herbert Edelsbrunner, Micheal FacelloDamrong GuoyGary Miller, Dafna Talmor, Noel WalkingtonXiang-Yang Li and Alper Üngör

Page 73: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

73

3D Unstructured Meshes

Page 74: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

74

Surface and 2D Unstructured Meshes

courtesy N. Amenta, UT Austin courtesy NASA

courtesy Ghattas, CMU

Page 75: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Numerical Methods

Point Set:Triangulation:

ad hoc

octree Delaunay

Domain, Boundary, and PDEs

element difference

volume

Finite

Ax=b

direct method

Mesh Generationgeometric structures

Linear Systemalgorithm

data structures

ApproximationNumerical Analysis

FormulationMath+Engineering

iterative method

multigrid

Page 76: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Outline• Mesh Generation in 2D

– Mesh Qualities

– Meshing Methods

– Meshes and Circle Packings

• Mesh Generation in 3D– Slivers

– Numerical Solution: Control Volume Method

– Geometric Solution: Sliver Removal by Weighted Delaunay Triangulations

– Smoothed Solution: Sliver Removal by Perturbation

Page 77: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Badly Shaped Triangles

Page 78: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Aspect Ratio (R/r)

Page 79: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Meshing Methods

• Advancing Front• Quadtree and Octree Refinement• Delaunay Based

– Delaunay Refinement– Sphere Packing– Weighted Delaunay Triangulation– Smoothing by Perturbation

The goal of a meshing algorithm is to generate a well-shaped mesh that is as small as possible.

Page 80: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Balanced Quadtree Refinements

(Bern-Eppstein-Gilbert)

Page 81: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Quadtree Mesh

Page 82: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Delaunay Triangulations

Page 83: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Why Delaunay?

• Maximizes the smallest angle in 2D.

• Has efficient algorithms and data structures.

• Delaunay refinement: – In 2D, it generates optimal size, natural

looking meshes with 20.7o (Jim Ruppert)

Page 84: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

84

Delaunay Refinement

(Jim Ruppert)

2D insertion 1D insertion

Page 85: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

85

Delaunay Mesh

Page 86: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

86

Local Feature Spacing (f)

f: R

The radius of the smallest sphere centered at a point that intersects or contains two non-incident input features

Page 87: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

87

Well-Shaped Meshes and f

Page 88: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

88

f is 1-Lipschitz and Optimal

Page 89: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

89

Sphere-Packing

Page 90: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

90

p

-Packing a Function f

• No large empty gap: the radius of the largest empty sphere passing q is at most f(q).

f(p)/2

q

Page 91: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

91

• The Delaunay triangulation of a -packing is a well-shaped mesh of optimal size.

• Every well-shaped mesh defines a -packing.

The Packing Lemma (2D)

(Miller-Talmor-Teng-Walkington)

Page 92: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

92

Part I: Meshes to Packings

Page 93: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

93

Part II: Packings to Meshes

Page 94: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

94

3D Challenges

• Delaunay failed on aspect ratio• Quadtree becomes octree

(Mitchell-Vavasis)• Meshes become much larger• Research is more Challenging!!!

Page 95: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Badly Shaped Tetrahedra

Page 96: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Slivers

Page 97: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Radius-Edge Ratio

(Miller-Talmor-Teng-Walkington)

R L

R/L

Page 98: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

98

The Packing Lemma (3D)

(Miller-Talmor-Teng-Walkington)

• The Delaunay Triangulation of a -packing is a well-shaped mesh (using radius-edge ratio) of optimal size.

• Every well-shaped (aspect-ratio or radius-edge ratio) mesh defines a -packing.

Page 99: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

99

Uniform Ball Packing

• In any dimension, if P is a maximal packing of unit balls, then the Delaunay triangulation of P has radius-edge at most 1.

||e|| is at least 2

r is at most 2r

Page 100: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

100

Constant Degree Lemma (3D)

(Miller-Talmor-Teng-Walkington)

• The vertex degree of the Delaunay triangulation with a constant radius-edge ratio is bounded by a constant.

Page 101: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

101

Delaunay Refinement in 3D Shewchuck

Page 102: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Slivers

Page 103: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Sliver: the geo-roach

Page 104: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Coping with Slivers: Control-Volume-Method(Miller-Talmor-Teng-Walkington)

Page 105: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Sliver Removal by Weighted Delaunay (Cheng-Dey-Edelsbrunner-Facello-Teng)

Page 106: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Weighted Points and Distance

p z

Page 107: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Orthogonal Circles and Spheres

Page 108: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Weighted Bisectors

Page 109: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Weighted Delaunay

Page 110: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Weighted Delaunay and Convex Hull

Page 111: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Parametrizing Slivers

DY

L

Page 112: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Interval Lemma

0 N(p)/3

• Constant Degree: The union of all weighted Delaunay triangulations with Property [] and Property [] has a constant vertex degree

Page 113: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Pumping Lemma

(Cheng-Dey-Edelsbrunner-Facello-Teng)

DY

z

H

r s

pP

q

Page 114: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

Sliver Removal by Flipping

• One by one in an arbitrary ordering• fix the weight of each point• Implementation: flip and keep the best

configuration.

Page 115: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

115

Experiments

(Damrong Guoy, UIUC)

Page 116: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

116

Initial tetrahedral mesh: 12,838 vertices, all vertices are on the boundary surface

Page 117: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

117

Dihedral angle < 5 degree: 13,471

Page 118: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

118

Slivers after Delaunay refinement: 881

Page 119: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

119

Slivers after sliver-exudation: 12

Page 120: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

120

15,503 slivers

142 slivers, less elements, better distribution

1183 slivers

Page 121: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

121

5636 slivers

18 slivers, less elements, better distribution

563 slivers Triceratops

Page 122: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

122

4532 slivers

1 sliver, less elements, better distribution

173 slivers

Heart

Page 123: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

123

Smoothing and Perturbation

• Perturb mesh vertices

• Re-compute the Delaunay triangulation

Page 124: 1 Smoothed Analysis of Algorithms Shang-Hua Teng Boston University Akamai Technologies Inc Joint work with Daniel Spielman (MIT)

124

Well-shaped Delaunay Refinement(Li and Teng)

• Add a point near the circumcenter of bad element

• Avoids creating small slivers

• Well-shaped meshes