Top Banner
JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts
58

JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

Dec 31, 2015

Download

Documents

Cecily Bailey
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Space-FillingCurves

An Introduction

Presented by Levi Valgaerts

Page 2: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 3: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 4: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Basic concepts from set theory: surjective, injective, bijective mapping

1. Surjective map from A onto B:

with

the image of A under the function f

( ) ( ) |f A f x Ran f x A Dom f

( )f A B

Page 5: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Basic concepts from set theory: surjective, injective, bijective mapping

2. Injective map from A into B:

3. Bijective map from A onto B:

f is injective and surjective

1 2 1 2( ) ( )x x f x f x

Page 6: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Basic notations

• Subsets of : ,

• Binary notation:

Ternary notation:

Quaternary notation:

2 33 1 2 3 1 2 30 ... / 3 / 3 / 3 ..., 0,1 2jt t t t t t t or

n 0,1I 20,1

2 32 1 2 3 1 2 30 ... / 2 / 2 / 2 ..., 0 1jb b b b b b b or

2 34 1 2 3 1 2 30 ... / 4 / 4 / 4 ..., 0,1,2 3jq q q q q q q or

Page 7: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Basic notations (remarks)

• Periods

• Finite binaries

e.g. because

2 1 2 3 2 1 2 30 ... 0 ... ...n n n nb b b b b b b b b b

2 1 2 3 2 1 2 3

2 1 2 3 2 1 2 3

0 ... 0 ... 000...

0 ... 0 ... ( 1)1, 1

n n

n n

b b b b b b b b

b b b b b b b b b b b

2 20 1 0 02 1

1 1

2 2i nn

Page 8: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Curve definition

If is continuous, thenis called a curve. Without loss of generality we can assume thedomain to be I, f(0) and f(1) are the beginning and endpoint.

Notation:

Parameter representation with component functions:

: , nf a b ��������������

([ , ])f a b��������������

1 2 3( ) ( , (, )),f t x x x x t I

1

2

3

( )

( )

( ( ))

x t

x t

x t

Page 9: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Space-filling curve (SFC) definition

Curves that pass through every point of an n-dimensional region with positive area (for n=2) or volume (for n=3), such as the unit square Ω in or the unit cube in , are called space-filling curves.

Two main characteristics:

• continuous

• surjective

It can be shown that if f generates a space-filling curve, then it can not be bijective.

2 3

Page 10: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 11: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 12: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: geometric generation

• If I can be mapped continuously on Ω, then after partitioning I into four congruent subintervals and Ω into four congruent subsquares, each subinterval can be mapped continuously onto one of the subsquares. This partitioning can be carried out ad infinitum.

• The subsquares must be arranged such that adjacent subintervals are mapped onto adjacent subsquares.

• Inclusion relationship: if an interval corresponds to a square, then its subintervals must correspond to the subsquares of that square.

• This process defines a mapping , called the Hilbert space-filling curve.

( )hf I

Page 13: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: geometric generation

1

2 3

43

21

4

16

3/41/4

2/44/4

04/16

3/162/16

1/1616/16

1

0,0 0,0

1,1 1,1

1st iteration 2nd iteration 3rd iteration

Page 14: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: geometric generation

6th iteration

Page 15: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: geometric generation

The mapping is surjective: with every sequence of nested closed squares corresponds a sequence of nested closed intervals that define a unique .

The mapping is continuous: in the nth iteration I is partitioned in subintervals, thus

The mapping is nowhere differentiable.

:hf I

0t I

: ontohf I

22 n

21 2 1 2 1 2, 1/ 2 ( ) ( ) 5 / 2n n

h ht t I t t then f t f t

: ontohf I

Page 16: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation [Sagan]

• Establish a formula to calculate the exact coordinates of an image point if

• Use complex representation , and affine transforma-tions to wich Ω will be subjected recursively.

• Give an orientation to each subsquare such that the exit point of a subsquare coincides with the entry point of the next subsquare.

2 2/ 2 , 0,1,2,3,..., 0,1,2,3,...2n nt k n k

z

Page 17: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation

0 1 0 11

20 1

1

2

1

4

3

4

0th iteration 1st iteration 2nd iteration

Page 18: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation

0

1

2z zih

1

1

2 2

iz z h

2

1 1

2 2 2

iz z h

3

11

2 2

iz zi h

1 1 10 0 0

2 2 2

0 1 01 1 1 1

1 0 02 2 2 2

x x xH h

x x x

: h

1 1 11 1 1

2 2 2

1 0 01 1 1 1

0 1 12 2 2 2

x x xH h

x x x

: h

1 1 12 2 2

2 2 2

1 0 11 1 1 1

0 1 12 2 2 2

x x xH h

x x x

: h

1 1 13 3 3

2 2 2

0 1 21 1 1 1

1 0 12 2 2 2

x x xH h

x x x

: h

The four basic transformations (2 dimensional case):

Page 19: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation

• Represent as

• , , ad infinitum:

• For finite quaternaries (edges of subintervals in nth iteration):

t I 4 1 2 30 ..., 0,1,2 3jt q q q with q or

1 2( )h q qf t h h

1 2 3( ) lim ...

nh q q q qn

f t

h h h h

1( )h qf t h

1 2 34 1 2 3

0(0 ... ) ...

0nh n q q q qf q q q q

h h h h

1 2 34 1 2 3 0 0 0(0 ... ) ... ...nh n q q q qf q q q q h h h h h h h

Page 20: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation

• continued...

• Taking into account some properties of :

1 2 3 0 1 2 3 1

0 1 2 3 1

1

.

4 1 2 31

0 1... ... ...

0 2

1(0 ...) ...

2

n j j

h

j j

n

q q q q q q q q q qjj

f is cont

h q q q q q qjj

H H H H H h

f q q q H H H H H h

h h h h

jqH

0 3

4 1 2 3 0 31

1(0 ...) ,

2j j

j

e e

h qjj

f q q q H H h

´ (mod 2), 0 3kj jwith e number of k s preceding q k or

Page 21: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: a complex representation

• Further simplifications of the formula are possible...

• An example:

(0,0)

(5 / 8,3 / 4)

3h

2h

0h

4 2 0 3

0 5 / 8(0 203)

0 3/ 4hf

h h h

Page 22: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Approximating polygons for the Hilbert curve

The polygonal line that runs through the points

is called the nth approximating polygon or a discrete space filling curve.

Parametrization:

converges uniformly to the Hilbert curve

2 2 2 2 2(0), (1/ 2 ), (2 / 2 ), (3 / 2 ),..., ((2 1) / 2 ), (1),n n n n nh h h h h hf f f f f f

2 22 2 2 2

2 2 2

1 1: : ( ) 2 ( ) ( ) 2 ( ) ( ),

2 2 2 2

/ 2 ( 1) / 2 , 0,1,2,3,...2 1

n nn n h hn n n n

n n n

k k k kp I p t t f t f

for k t k k

{ }np

Page 23: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: representation through grammars

• Make use of four distinct templates to generate the discrete Hilbert curve: H,A,B and C.

• These templates will be translated to a first iteration of the curve according to a fixed scheme.

Page 24: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Hilbert curve: representation through grammars

• The resulting rules and transitions can be used to implement the recursive construction of the discrete Hilbert curve.

Page 25: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

3 dimensional SFCs

Page 26: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 27: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 28: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: definition

• with

is surjective and continuous on I, and represents a SFC.

• More interesting: geometric generation according to Hilbert

2 2 4

1 31

3 1 3 53 1 2 3 4

3 2 4

0 ( )( )...(0 ...)

0 ( )( )...

2 ( 0,1,2) .

t t t

p t tt

j j j

t k t k tf t t t t

k t k t

with kt t t and k is the th it of k

:pf I

Page 29: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: geometric generation

From the defining formula we can derive:

• ...

3 2 3 43 3 4 5

3 2 3 4

0 0 ...(0 00 ...)

0 0 ...pf t t t

3 2 3 43 3 4 5

3 2 3 4

0 0 ...(0 01 ...)

0 1 ...pf t t t

1 1 10, 0, 0,

9 3 3pf

t

1 2 1 1 2, 0, ,

9 9 3 3 3pf

t

1

2

3 4

5

6 7

8

9

0 11

3

2

3

1

3

2

3

1

Page 30: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: geometric generation

1st iteration 2nd iteration 3rd iteration

Page 31: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: a complex representation

• Define orientation of the subsquares:

• Define similarity transforms:

with

0 1

1 1 1, ,...

3 3 3 3

iz z z z p p

1 1

2 2

1 1, 0,1,...8

3 3j j j

x xP p j

x x

p

Page 32: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: a complex representation

• Use ternary representation of :

• Continue as with Hilbert´s curve...

we get the same result as in Peano´s definition

3 1 2 2 2 2 9 1 2 3 4 2 1 20 ... ... 0 (3 )(3 )...(3 )...n n n nt t t t t t t t t t

1 2 3 4 2 1 23 3 3( ) lim ...n np t t t t t t

nf t

p p p

t I

Page 33: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Approximating polygons for the Peano curve

Page 34: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Peano curve: representation through grammars

Page 35: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 36: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 37: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Sierpinski curve: generation

Originaly defined as a map from I onto , but it can be considered as a map

from I onto a right isosceles triangle .

sf 2

1,1

Page 38: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Sierpinski curve: generation

• Partition I into congruent subintervals and intocongruent subtriangles.

• In deriving an algabraic representation it is easier to divide I into subintervals, thus using quaternaries:

(2,0)(0,0)

(1,1)

n=0 n=1 n=2

2n

2n

22 n

0 1 2 14 1 2 31

1(0 ...) ...

2 j js q q q q qjj

f q q q S S S S s

Page 39: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Sierpinski curve: generation

with similarity transforms:

0

1

2

3

/ 2

/ 2 1

/ 2 1

/ 2 1

z z

z zi

z zi i

z z

S

S

S

S

1 1 10 0 0

2 2 2

1 1 11 1 1

2 2 2

1 1 12 2

2 2 2

1 0 01 1 1 1

0 1 02 2 2 2

0 1 21 1 1 1

1 0 02 2 2 2

0 1 21 1 1 1

1 0 22 2 2

x x xS s

x x x

x x xS s

x x x

x x xS

x x x

: S

: S

: S 2

1 1 13 3 3

2 2 2

2

1 0 21 1 1 1

0 1 02 2 2 2

s

x x xS s

x x x

: S

Page 40: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Sierpinski curve: generation

• Taking into account some properties of :

4 1 2 31

1(0 ...) ( 1)

2j j

js qjj

f q q q S s

jqS

2́ (mod 2)

1́ 2́ (mod 4)

j j

j j

with number of s preceding q

and number of s and s preceding q

Page 41: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Sierpinski curve: approximating polygons

(2,0)(0,0)

(1,1)

n=0 n=1 n=2 n=3

Page 42: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 43: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 44: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Lebesgue curve: introduction

Introduction of a remarkable subset of I, the Cantor Set

,of wich all elements can be

represented by

may be constructed by recursively removing the middle third of every closed subinterval beginning with I. The numbers that are generated in this proces do not contain a 1 in their ternary representation.

3 1 2 3{0 (2 )(2 )(2 )... | 0 1}jt t t t or

31 2 42 3 4

22 2 2..., 0 1

3 3 3 3 j

tt t twith t or

Page 45: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Lebesgue curve: introduction

1.

2.

3. ...

0 1

1

3

2

3

1

9

2

9

7

9

8

9

1

27

2

27

7

27

8

27

1 20, ,1

3 3

1 2 1 2 7 80, , , ,1

9 9 3 3 9 9

Page 46: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Lebesgue curve: definition

We define the continuous and surjective mapping

and extend f continuously into I by linear interpolation in every interval that is removed in the generation of :

with removed in the nth iteration step. Further we say

on . Than defines the Lebesgue space-filling curve.

:f

2 1 3 53 1 2 3

2 2 4 6

0 ...(0 (2 )(2 )(2 )...)

0 ...

t t tf t t t

t t t

1( ) ( )( ) ( )( ) ,l n n n n n n

n n

f t f a b t f b t a a t bb a

,n na b

( ) ( )lf t f t lf

Page 47: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

The Lebesgue curve: generation and approxima-ting polygons

1st iteration 4th iteration2nd iteration

Page 48: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 49: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Contents

1. Introductory section

2. Types of space-filling curves1. The Hilbert space-filling curve

2. The Peano space-filling curve

3. The Sierpinski space-filling curve

4. The Lebesgue space-filling curve

3. Application of space-filling curves

Page 50: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

2 dimensional SFCs give a recipe for going through a set of 2 dimensional data that are arranged on a grid:

• going through pixels that make up an image being scanned

• matrix operations in linear algebra

• going through / representing a 2D computational grid

• ...

Favorable property: better exploitation of the 2D locality due to the recursive nature / self-similarity.

Application of space-filling curves

Page 51: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

1. Representation of computational grids (1)

Acceptable computational complexity is required in implemen-ting computational grids. Especially for adaptively refined grids the manipulation part cannot be too expensive choice of ap-propriate data structures is important.

Often applied: space trees of which the leaves correspond to the grid cells that are enumerated by a discrete SFC. For adaptively refined grids we use different iterates depending on the level of refinement.

Page 52: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

1. Representation of computational grids (2)

Page 53: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

2. Implementation with respect to cache-efficiency (1)

• Data access of hierarchically stored data can be slow. By using SFC we try to process the data linearly in a way that reduces data access time and cache misses.

• Build a fixed number of stacks to avoid random access in the memory, such that data (information in a grid point) needed in the operation sequence is always on top. The corresponding processing order of the grid cells is defined by a SFC.

Page 54: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

2. Implementation with respect to cache-efficiency (2)

Use of two stacks with a Peano curve on a 2D regular grid

Page 55: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

2. Implementation with respect to cache-efficiency (3)

Consequences:

• Memory behaviour becomes deterministic and processing order is easily inverted.

• The discrete operator has to be decomposed per cell such that the accumulated effect corresponds to the execution of the whole operator after one run over all cells.

Page 56: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

3. Grid partitioning and parallellisation (1)

For running a PDE solver on a parallel computer we need to partition the data and map each block to a processor such that data transfer between the processors is as small as possible.

Multi-dimensional data can be mapped to a one-dimensional sequence using the inverse of a discrete SFC mapping. The points on I that are the images of nodes in space can be grouped together and mapped on a processor. We use seperators to form partitions that contain the same number of nodes for perfect load balance.

Page 57: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

Application of space-filling curves

3. Grid partitioning and parallellisation (2)

• Set of points:

where of equal workload, gives small seperators \

, in fact quasi-optimal seperator sizes where other partition methods fail.

{ | }i iS x x

11{ | ( ) }i j i j

j

S x s f x s

jj

I I

jI ( )jf I

Page 58: JASS 2005 Saint Petersburg Space-Filling Curves An Introduction Presented by Levi Valgaerts.

JASS 2005 Saint Petersburg

List of references

[1] Hans Sagan, Space-Filling Curves, Springer-Verlag, 1994.[2] Michael Bader, Raumfüllende Kurven, Institut für Informatik der Technischen Universität München, 2004.[3] F. Günther, M. Mehl, M. Pögl, C. Zenger, A cache-aware algorithm for PDEs on hierarchical data structures based on space-filling curves.[4] Gerhard Zumbusch, Adaptive Parallel Multilevel Methods for Partial Differential Equations.[5] R. Dafner, D. Cohen-Or, Y. Matias, Context-based Space Filling Curves, 2000.[6] www.wikipedia.org