testing the diameter of graphs michal parnas dana ron

23
Testing the Diameter of Graphs Michal Parnas Dana Ron

Post on 19-Dec-2015

216 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: Testing the Diameter of Graphs Michal Parnas Dana Ron

Testing the Diameter of Graphs

Michal Parnas Dana Ron

Page 2: Testing the Diameter of Graphs Michal Parnas Dana Ron

Property Testing of Graphs

Let G = (V,E) be an undirected graph.

A Testing Algorithm of property P:

• The algorithm can query on the incidence relations of vertices in G.

• If G has property P: Accept. If G is “far” from P: Reject.

Page 3: Testing the Diameter of Graphs Michal Parnas Dana Ron

Previous Representations of Graphs

• Adjacency Matrix [GGR].

Queries: Is (u,v) E.

-far: n2 edges should be modified.

Dense graphs.

• Incidence Lists of bounded length d [GR].

Queries: Who is i’th neighbor of v?

-far: dn edges should be modified.

Sparse bounded degree graphs.

1

1

1

10

0

00

0

1 n

1

n

1 2 … d

1 2 … d

1

n

Page 4: Testing the Diameter of Graphs Michal Parnas Dana Ron

Our Model

G = (V,E) an undirected graph, |V| = n, |E| m.

Representation: Incidence lists of varying length.

Queries: Who is i’th neighbor of v?

-far: m edge modifications. 1

n

Page 5: Testing the Diameter of Graphs Michal Parnas Dana Ron

A Testing AlgorithmA testing algorithm for a parameterized property Ps is given:

• Distance parameter 0 < < 1. • Query access to a graph G having at most m edges.• Boundary function ().

The algorithm: • Should accept with probability at least 2/3, if G has property Ps.

• Should reject with probability at least 2/3, if G is -far from property . β(s)P

Ps

β(s)P

Accept

Reject

Page 6: Testing the Diameter of Graphs Michal Parnas Dana Ron

The Diameter Problem

Question: Is the diameter of G at most D or is it -far from diameter (D)?

The algorithms differ in:

• The boundary function (). • The query and time complexities.• The feasible values of .

Page 7: Testing the Diameter of Graphs Michal Parnas Dana Ron

Our Results ( D ) R e m a r k s

2 D + 2 A n y O n e S i d e dE r r o r

2D12

11

i

m)2i(

nlogn 2i

11

T w o S i d e dE r r o r

4 D / 3 + 2 4/1n~ i = 2

D + 4 )n(logpoly/1f o r D = p o l y ( l o g n )

i = l o g ( D / 2 + 1 )

1O~

Time and Query Complexity:

1.

2.

Page 8: Testing the Diameter of Graphs Michal Parnas Dana Ron

Related Work• Testing Algebraic Properties (Linearity and Low degree)

Program Testing: Blum & Luby & Rubinfeld, Rubinfeld, Rubinfeld & Sudan ...

PCP: Babai & Fortnow & Lund, Babai & Fortnow & Lund & Szegedy, Feige & Goldwasser, Lovasz & Safra & Szegedy,

Arora & Lund & Safra, Arora & Safra...

• Testing Graph Properties (Colorability, Connectivity, Properties defined by first order formula)

Goldreich & Goldwasser & Ron, Goldreich & Ron,

Alon & Fischer & Krivelevich & Szegedy, Alon & Krivelevich.

• Testing Other Properties (Monotonicity, Regular languanges)

Goldreich & Goldwasser & Lehman & Ron, Dodis & Goldreich & Lehman & Raskhodnikova & Ron & Samorodnitsky, Ergun & Kannan & Kumar & Rubinfeld & Viswanathan, Kearns & Ron, Alon & Krivelevich & Newman & Szegedy.

Page 9: Testing the Diameter of Graphs Michal Parnas Dana Ron

AlgorithmInput: D, n, m, .Parameters: C, k, .

• Set

• Uniformly select starting vertices.

• For each starting vertex - perform a BFS to distance at most C until k vertices are reached.

• If at most S starting vertices reach < k vertices then accept, otherwise reject.

mn,ε/1S

Time and Query Complexity: O(k2S)= O(k2/n,m)

εn

mε mn,

Page 10: Testing the Diameter of Graphs Michal Parnas Dana Ron

Illustration of the Algorithm

1

S

C2

3

Page 11: Testing the Diameter of Graphs Michal Parnas Dana Ron

Proof of Correctness

Good Vertex: If C-neighborhood contains k vertices.

Bad Vertex: If C-neighborhood contains < k vertices.

CWe Show:

• Diameter D Almost (all) vertices are good.

• Diameter > (D) Many vertices are bad.

Page 12: Testing the Diameter of Graphs Michal Parnas Dana Ron

Lemma 1:If at least (1-1/k)n of the vertices are good, then the graph can be transformed into a graph with diameter at most 4C+2 by adding at most 2n/k edges.

Proof:

c

c

c

cGood

Good

Good

GoodBad

Bad

BadBad

Reducing the Diameter

Page 13: Testing the Diameter of Graphs Michal Parnas Dana Ron

Lemma 2: If at least (1-/2)n of the vertices are good, where k = (4/)ln(4/),then the graph can be transformed into a graph with diameter at most 2C+2, by adding at most n edges.

Proof: Select centers in a greedy manner and connect them.Balls may overlap.

Corollary: If G is -far from diameter 2C+2, then there exist more than nn,m/2 bad vertices, where k= (4 /n,m)ln(4 /n,m).

Proof: Set = n,m in Lemma 2.

Page 14: Testing the Diameter of Graphs Michal Parnas Dana Ron

Proof of Item 1

Parameters: C = D = 0

• Diameter D All vertices are good.

• Diameter > (D) = 2D+2 bad vertices.

mn,mn, εε

4ln

4k

mn,ε

4S

n2

mn,εLemma 2

Page 15: Testing the Diameter of Graphs Michal Parnas Dana Ron

Proof of Item 2

Parameters:

22

D

2

DC

1i

mn,mn, εε

4ln

4k

4

εα mn,

mn,ε

48S

• Diameter > 2C+2 = (D) =

2D12

11

i

n2

mn,εLemma 2bad vertices (fraction of bad 2).

Page 16: Testing the Diameter of Graphs Michal Parnas Dana Ron

Item 2 - Continued

• Diameter D Fraction of bad vertices /2.

Lemma 3: Let

Diameter D number of bad vertices ki+1.

22

D

2

DC

1i

Lemma 3

Page 17: Testing the Diameter of Graphs Michal Parnas Dana Ron

Proof of Lemma 3

Assume there are more than ki+1 bad vertices.

Diameter D D/2 - neighborhoods intersect.

D/2

u1

ut

u2

v

u2

v

utu1

u1,…,ut bad vertices, t = ki.

2

Dh

Page 18: Testing the Diameter of Graphs Michal Parnas Dana Ron

Tree Lemma (Special Case)

Let T be a tree of height h and size t.

There exists a leaf in T whose 4h/3-neighborhood

contains at least vertices.tv

3

h

h3

2

i = 2, C = 2D/3. By Tree Lemma, there exists a leaf uj whose C-neighborhood containsat least vertices. uj is not bad.kkt i

Proof:

(Proof of Lemma 3)

Page 19: Testing the Diameter of Graphs Michal Parnas Dana Ron

Tree Lemma

Let T be a tree of height h and size t, and let a < h.

There exists a leaf in T whose (h+a)-neighborhood

contains at least vertices.1)a/)ahlog((

1

t

|)u(|maxmin)a,h,t(f ahleafuT

a2,ah,1b

1tf1bmin)a,h,t(f 1b

Proof: Define -

Solve recursively -

Page 20: Testing the Diameter of Graphs Michal Parnas Dana Ron

-farFor any fixed parameterized property Ps, any 0 < < 1, and any integer m > 0,a graph G having at most m edges is -far from property Ps

if the number of edges that need to be added and/or removed from G in order to obtain a graph having the property,is greater than m. Otherwise, G is -close to Ps.

Page 21: Testing the Diameter of Graphs Michal Parnas Dana Ron

Range of

Corollary:Every connected graph with n vertices and m edges

is -close to having diameter D for every Dm

n2ε

Theorem: Every connected graph on n vertices can be transformed into a graph of diameter at most D by adding at most 2n/(D-1) edges.

εn

mε mn, Set:

Page 22: Testing the Diameter of Graphs Michal Parnas Dana Ron

Reducing the Diameter of a GraphLemma: If the C-neighborhood of each vertex contains k vertices, then the graph can be transformed into a graph withdiameter at most 4C+2 by adding at most n/k edges.

c

c

c

c

Page 23: Testing the Diameter of Graphs Michal Parnas Dana Ron

Our Results

• For (D) = 2D+2, and every , a one-sided error algorithm.

• For every (D) = 2 i log (D/2 + 1) a two-sided error algorithm, where =

• For Example: i = 2, (D) = 4D/3 + 2, =

i = log(D/2 + 1), (D) = D + 4

4/1n~

2D12

11

i

3

1O~

εTime and Query Complexity:

m)2i(

nlogn 2i

11