340 likes | 445 Views
3. drawing trees in a streaming model. Carla Binucci. Pietro Palladino. Maurizio Patrignani. Antonios Symvonis. Marco Gaertler. Walter Didimo. Ulrik Brandes. Giuseppe Di Battista. Katharina Zweig. Thanks to the Bertinoro Workshop on Graph Drawing, March 2008. 5.
E N D
3 drawing trees in a streaming model Carla Binucci Pietro Palladino Maurizio Patrignani Antonios Symvonis Marco Gaertler Walter Didimo Ulrik Brandes Giuseppe Di Battista Katharina Zweig Thanks to the Bertinoro Workshop on Graph Drawing, March 2008
5 drawing trees in a streaming model Carla Binucci Pietro Palladino Maurizio Patrignani Antonios Symvonis Marco Gaertler Walter Didimo Ulrik Brandes Giuseppe Di Battista Katharina Zweig Thanks to the Bertinoro Workshop on Graph Drawing, March 2008
2 drawing trees in a streaming model Carla Binucci Pietro Palladino Maurizio Patrignani Antonios Symvonis Marco Gaertler Walter Didimo Ulrik Brandes Giuseppe Di Battista Katharina Zweig Thanks to the Bertinoro Workshop on Graph Drawing, March 2008
3 drawing trees in a streaming model Carla Binucci Pietro Palladino Maurizio Patrignani Antonios Symvonis Marco Gaertler Walter Didimo Ulrik Brandes Giuseppe Di Battista Katharina 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 applications emails, 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]
e14 e1 e2 e3 e4 e5 e6 e13 e8 e9 e10 e11 e12 e7 e14 e13 e8 e10 e11 e4 e1 e2 e12 e7 e3 e6 e5 e9
persistence = 6 e14 e2 e3 e4 e5 e6 e1 e8 e9 e10 e11 e12 e13 e7 e14 e13 e8 e4 e1 e11 e2 e12 e10 e7 e3 e6 e5 e9
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 iof 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 ?
intuition of the approach persistence = 6
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 onand set nexti+1=(nexti+1) mod m • otherwise, set nexti+1=nexti
conditions for algorithm GC to work algorithm Greedy-Clockwise guarantees a non-intersecting drawing if Condition 1: point is not used in i by any vertex Condition 2: current edge ei does not introduce a crossing
Condition 1 is enough lemma let 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
proof that Condition 1 suffices i(x) < i(u) < i(y) < i(v) x u ei y v
legs, feet, heels, and toes u leg of u ei ej foot toe heel w v
regular foot (r-foot) u ei ej j-i=5 persistence k = 5 j-i ≤ k
extra-large foot (xl-foot) u ei j-i=9 persistence k = 5 j-i > k v
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 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 1 correctness • 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 SnowPlow old()
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)
summary of the results competitive 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?