Drawing trees in a streaming model Carla Binucci Ulrik Brandes Giuseppe Di Battista Walter Didimo...

Post on 27-Mar-2015

220 views 0 download

Tags:

transcript

drawing trees in a streaming model

Carla B

inucci

Carla B

inucci

Ulrik B

randes

Ulrik B

randes

Giuseppe Di B

attista

Giuseppe Di B

attista

Walte

r Didim

o

Walte

r Didim

o

Marco G

aertler

Marco G

aertler

Pietro P

alladino

Pietro P

alladino

Maurizio P

atrignani

Maurizio P

atrignani

Antonios S

ymvonis

Antonios S

ymvonis

Katharin

a Zweig

Katharin

a Zweig

Thanks to the Bertinoro Workshop on Graph Drawing, March 2008

drawing trees in a streaming model

Carla B

inucci

Carla B

inucci

Ulrik B

randes

Ulrik B

randes

Giuseppe Di B

attista

Giuseppe Di B

attista

Walte

r Didim

o

Walte

r Didim

o

Marco G

aertler

Marco G

aertler

Pietro P

alladino

Pietro P

alladino

Maurizio P

atrignani

Maurizio P

atrignani

Antonios S

ymvonis

Antonios S

ymvonis

Katharin

a Zweig

Katharin

a Zweig

Thanks to the Bertinoro Workshop on Graph Drawing, March 2008

drawing trees in a streaming model

Carla B

inucci

Carla B

inucci

Ulrik B

randes

Ulrik B

randes

Giuseppe Di B

attista

Giuseppe Di B

attista

Walte

r Didim

o

Walte

r Didim

o

Marco G

aertler

Marco G

aertler

Pietro P

alladino

Pietro P

alladino

Maurizio P

atrignani

Maurizio P

atrignani

Antonios S

ymvonis

Antonios S

ymvonis

Katharin

a Zweig

Katharin

a Zweig

Thanks to the Bertinoro Workshop on Graph Drawing, March 2008

drawing trees in a streaming model

Carla B

inucci

Carla B

inucci

Ulrik B

randes

Ulrik B

randes

Giuseppe Di B

attista

Giuseppe Di B

attista

Walte

r Didim

o

Walte

r Didim

o

Marco G

aertler

Marco G

aertler

Pietro P

alladino

Pietro P

alladino

Maurizio P

atrignani

Maurizio P

atrignani

Antonios S

ymvonis

Antonios S

ymvonis

Katharin

a Zweig

Katharin

a Zweig

Thanks to the Bertinoro Workshop on Graph Drawing, March 2008

streams of data• several applications produce (potentially infinite)

streams of data that are too many to be stored and that should be analyzed in real time– networking applications

IP packets, TCP connections, interface usage, …

– enviromental monitoring atmospheric sensor measures, satellite scans, …

– social networks applicationsemails, faxes, telephone calls, …

• in several cases such streams represent graphs

working with streams• streaming model of computation [Muthukrishnan]

– input: a stream of data– output: measure/compute some property– purpose: use limited resources

• streaming on graphs– triangle counting [Bar-Yossef et al][Buriol et al][Jowhari et al]

– computing clustering coefficient [Buriol et al]

– counting k3,3 [Buriol et al]

– testing matching, bipartiteness, connectivity, MST, t-spanners [Feigenbaum]

e1 e2

e3

e11e4

e5e6

e7

e8

e9

e10

e12

e13e14

e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14

e1 e2

e3

e11e4

e5e6

e7

e8

e9

e10e12

e13e14

e1 e2 e3 e4 e5 e6 e7 e8 e9 e10 e11 e12 e13 e14

persistence = 6

drawing a stream of edges

• the input is a stream of edges:

S = (e1, e2, e3, e4, e5, …)

• the drawing has a persistence k– k may be infinite

• at any time i we have to produce a drawing i of Gi = {ei-(k-1), ei-k,…,ei-1, ei }

– remove ei-k from i-1

– add ei to i-1

quality assessment: competitive ratio

• consider an algorithm A for drawing a stream of edges S = (e1, e2, e3, …)

• denote by • A(S) a quality measure of algorithm A on stream S• Opt(S) the quality measure of the optimal off-line

algorithm on S

• competitive ratio of algorithm A

• the quality measure we consider is the area

RA = maxS A(S)Opt(S)

previous literature• incremental graph drawing [de Fraysseix, Pach,

Pollack][Biedl,Kant] …– precomputed vertex ordering

• dynamic graph drawing [Branke][Huang, Eades, Wang][Papakostas, Tollis]…– sequence of graphs where two consecutive drawings

should be similar– arbitrary insertions/deletions allowed

• the “no change scenario” of [Papakostas, Tollis] corresponds to streamed graph drawing with infinite persistence

a specific streaming problem

• we restrict to straight-line planar grid drawings

• we assume that the current graph Gi is always connected

• we focus on trees

• the edges of the stream correspond to an Eulerian tour of the tree– this guarantees that Gi is connected

problem statement

• is it possible to draw the stream of edges produced by an Eulerian tour of a tree– with limited area – with persistence k – such that edges are straight-line segments

and each drawing is planar

?

persistence = 6

intuition of the approach

algorithm Greedy Clockwise (GC)

• assume to have m points p0, p1, …, pm in convex position

• greedily use them in clockwise order – at time 1 draw the first edge on p0 and p1 and

set next2 = 2

– at time i• if you need to insert a vertex, place it on

and set nexti+1=(nexti+1) mod m

• otherwise, set nexti+1=nexti

inextp

persistence = 6

conditions for algorithm GC to work

algorithm Greedy-Clockwise guarantees a non-intersecting drawing if

inextpCondition 1: point is not used in i by any vertex

Condition 2: current edge ei does not introduce a crossing

Condition 1 is enough

lemmalet i-1 be the drawing of Gi-1 built by algorithm GC and consider a vertex v that should be added to Gi-1 at time i

if Condition 1 is satisfied, then no crossing is introduced by drawing v on inextp

proof that Condition 1 suffices

i(x) < i(u) < i(y) < i(v)

ei

u

v

inextp

x

y

legs, feet, heels, and toes

leg of u

footheeltoe

eiej

u

vw

regular foot (r-foot)

eiej

u

j-i=5persistence k = 5j-i ≤ k

extra-large foot (xl-foot)

ei

u

vj-i=9persistence k = 5j-i > k

r-feet and xl-feet

• regular foot (or r-foot)– when j-i ≤ k

– u is present in i-1, i, i+1,…, j+k

– has maximum size k/2

• extra-large foot (or xl-foot)– when j-i > k

– u is not present from i+k on

when algorithm GC does not work?u

when algorithm GC works?

theorem 1

algorithm GC draws without crossings the stream of edges produced by an Eulerian tour of a tree of maximum degree at most d on k/2(d-1)+k+1 points in convex position

also RGC=O(d3k2)

technical lemma

• consider Algorithm GC on m points in convex position

• suppose that for each vertex v it holds that during the time elapsing from when v is discovered and when it disappears from the drawing at most m-1 other vertices are discovered

• then Condition 1 holds at each time

proof of theorem 1correctness • we show that the time elapsing from when a vertex v is

discovered and when it disappears from the drawing is at most k/2(d-1)+k– hint: v may have at most d-1 r-feet of size k/2

quality• m points in convex position require an O(m3) area• the area used for our k/2(d-1)+k+1 points is (d3k3)• any off-line algorithm requires (k) area to place O(k)

points• therefore, the competitive ratio is O(d3k2)

algorithm SnowPlow (SP)• alternates GC with its mirrored version, called

Greedy Counter-Clockwise (GCC)

• call old(i) the oldest vertex of i, i.e., the vertex that appears in i, i-1,…,i-j with highest j

• the decision of switching from GC to GCC (or vice versa) is taken each time a new foot of old(i) is entered

• you switch to GCC only if you have used GC enough to ensure that GCC finds a free vertex on the left of old(i)

algorithm SnowPlowold()

when algorithm SP works

• switching condition– if you have used at least k/2 points on one

side (GC) you switch to the other side (GCC)

• theorem 2: algorithm SP draws without crossings and with persistence k a stream of edges produced by an Eulerian tour of a tree on 2k-1 points in convex position

• RSP=O(k2)

algorithm SnowPlow and xl-feetold()

summary of the resultscompetitive ratios of the proposed algorithms

open problems• our competitive ratios are high: do better

solutions exist?• computing tighter lower bounds for streaming

algorithms evaluation• larger classes of planar (or general) graphs • persistence:

– what if persistence is different for different edges– what if k=O(log n), where n is the size of the stream?

• what if the degree of each vertex is known in advance?

thank you for your attention